# Error When Creating New VPN Client (Undefined array key "client-to-client")

**URL:** https://forums.vitalpbx.org/t/error-when-creating-new-vpn-client-undefined-array-key-client-to-client/5813
**Category:** VitalPBX
**Created:** [October 25, 2025, 3:57pm UTC](https://forums.vitalpbx.org/t/error-when-creating-new-vpn-client-undefined-array-key-client-to-client/5813 "2025-10-25T15:57:56Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![lmoreira](https://forums.vitalpbx.org/user_avatar/forums.vitalpbx.org/lmoreira/32/592_2.png) [@lmoreira](https://forums.vitalpbx.org/u/lmoreira)
#### Post date: [October 25, 2025, 3:57pm UTC](https://forums.vitalpbx.org/t/error-when-creating-new-vpn-client-undefined-array-key-client-to-client/5813/1 "2025-10-25T15:57:56Z")

</div>

Dear VitalPBX Community,

I am encountering an error when trying to create a new VPN client through the VitalPBX graphical interface. The issue specifically arises when I click “Save” or “Apply” after filling in the details for a new OpenVPN client.

The exact error message displayed is:

```auto
An exception occurred
Exception: Undefined array key "client-to-client" in file /usr/share/vitalpbx/www/modules/vpn_server/OpenVPN.php on line 0

```

And the full error trace:

```auto
Error Trace
#	File	Function
1	/usr/share/vitalpbx/www/index.php:0	app\Core->run(...args);
2	/usr/share/vitalpbx/www/includes/app/Core.php:0	app\Core->_loadModule(...args);
3	/usr/share/vitalpbx/www/includes/app/Core.php:0	app\Core->loadModuleAction(...args);
4	/usr/share/vitalpbx/www/modules/vpn_server/vpn_server.php:0	modules\vpn_server\vpn_server->putClient(...args);
5	/usr/share/vitalpbx/www/modules/vpn_server/OpenVPN.php:0	modules\vpn_server\OpenVPN->configureClient(...args);
6	/usr/share/vitalpbx/www/modules/vpn_server/OpenVPN.php:0	modules\vpn_server\OpenVPN->getServerConf(...args);
7	/usr/share/vitalpbx/www/modules/vpn_server/OpenVPN.php:0	{closure}(...args);

```

VitalPBX Version: 4.5.1-4  
PBX Engine 20.15.0-1  
VPN Server Module Version: 4.5.0-2

Steps to Reproduce:

1. Access the VitalPBX GUI.
2. Navigate to the VPN Server module.
3. Click “Add New VPN Client.”
4. Fill in the required information (name, type, etc.).
5. Click “Save” or “Apply.”

Expected Behavior:  
The new VPN client should be created successfully, and configurations should be applied without errors.

Current Behavior  
The “Undefined array key “client-to-client”” exception occurs, and the VPN client is not created.

It appears that an array key “client-to-client” is not defined at some point in the OpenVPN configuration or in how VitalPBX interacts with this configuration. Line 0 in the `OpenVPN.php` file suggests the problem might be in how data is read or accessed.

Any assistance or guidance to resolve this issue would be greatly appreciated.

Thank you!  
Luciano Moreira  
Lógic Digital

---

<div class="post-metadata">

### Author: ![system](https://forums.vitalpbx.org/uploads/default/original/1X/672b458a1d454755270c2c16adc5316b641c3c6a.png) [@system](https://forums.vitalpbx.org/u/system)
#### Post date: [November 24, 2025, 3:58pm UTC](https://forums.vitalpbx.org/t/error-when-creating-new-vpn-client-undefined-array-key-client-to-client/5813/2 "2025-11-24T15:58:48Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
