Fatal error Trunks after update to 3.1.5-4

Fatal error: Uncaught TypeError: Argument 1 passed to vitalpbx\query::select() must be an instance of vitalpbx\schema, null given, called in /usr/share/vitalpbx/www/modules/pjsip_transports/PJSIPTransport.php on line 0 and defined in /usr/share/vitalpbx/www/includes/query.php:0 Stack trace: #0 /usr/share/vitalpbx/www/modules/pjsip_transports/PJSIPTransport.php(0): vitalpbx\query::select(NULL) #1 /usr/share/vitalpbx/www/modules/trunks/trunks.php(0): modules\pjsip_transports\PJSIPTransport::getDefaultByProtocol(‘udp’) #2 /usr/share/vitalpbx/www/modules/trunks/trunks.php(0): modules\trunks\trunks->read(‘0’, Array) #3 /usr/share/vitalpbx/www/includes/app/Core.php(0): modules\trunks\trunks->getContent() #4 /usr/share/vitalpbx/www/includes/app/Core.php(0): app\Core->loadModuleAction(’\modules\trunks…’, ‘getContent’) #5 /usr/share/vitalpbx/www/includes/app/Core.php(0): app\Core->_loadModule() #6 /usr/share/vitalpbx/www/index.php(0): app\Core->run() #7 {main} thrown in /usr/share/vitalpbx/www/includes/query.php on line 0

Go to the Linux console and execute the command below as root.

vitalpbx --build-db

Please post the command’s output here.

Thanks, it solved all the problems with the web-interface.

vitalpbx --build-db
Importing 20211028.1.silk_codec.sql…
Importing 20211028.2.rm_cli_commands_tbl.sql…
Importing 20211122.1.cdr_cloud.sql…
Importing 20211123.1.outbound_queues.sql…
Importing 20211125.queues_unav_agents.sql…
Importing 20211210.1.virtual_devices.sql…
Importing 20211214.1.transports.sql…
Importing 20211215.1.pjsip_profiles_transports.sql…
Importing 20211215.2.trunks_transport.sql…
Importing 20211221.1.lets_sub_domains.sql…
Importing 20220131.1.deprecate_push.sql…
Importing 20220203.2.direct_pickup_single_digit.sql…
Importing 20220204.1.obsolete_firewall_rules.sql…
Importing 20220302.1.whitelist_push.sql…
task-manager
dahdi
clearlyip
ha
bulk-extensions
dynamic-destinations
phone-books
maintenance
custom-contexts
domotic
queues-callback
xepm
multi-tenant
provisioning
ms-teams
trunks-passthrough
branding
virtual-faxes
openvpn
Importing 20180612.1.vpn_server.sql…
PHP Fatal error: Uncaught Exception: ERROR 1062 (23000) at line 42: Duplicate entry ‘OpenVPN’ for key ‘name’
in /usr/share/vitalpbx/scripts/apply_migrations:0
Stack trace:
#0 /usr/share/vitalpbx/scripts/apply_migrations(0): patcher->shellcmd(‘/bin/bash -c se…’)
#1 /usr/share/vitalpbx/scripts/apply_migrations(0): patcher->import_dbscript(‘20180612.1.vpn_…’, ‘/usr/share/vita…’)
#2 /usr/share/vitalpbx/scripts/apply_migrations(0): patcher->apply(‘migrations/open…’)
#3 {main}
thrown in /usr/share/vitalpbx/scripts/apply_migrations on line 0
Done

If you don’t have any configuration in the OpenVPN module, you can remove it and then reinstall it.

After the above procedure try executing the command of my previous post again.

vitalpbx --build-db