Page 1 of 1

Unable to access the Vicidial Admin Page After SVN/DB Update

PostPosted: Mon Apr 11, 2022 6:34 am
by Ikram_Ali
Hi,
I am unable to access the admin page of Vicidial after an SVN update. I can access the 'http://192.168.219.235/agc/vicidial.php' but not http://192.168.219.235/vicidial/admin.php.

While trying to access admin, it shows-

This page isn’t working
192.168.219.235 is currently unable to handle this request.
HTTP ERROR 500

I followed the UPGRADE script (/usr/src/astguiclient/trunk/UPGRADE)

################ UPGRADE

NOTE: Upgrading from 2.11 to 2.13 is below the first section
NOTE: Upgrading from 2.9 to 2.11 is below the first section
NOTE: Upgrading from 2.7 to 2.9 is below the first section
NOTE: Upgrading from 2.4 to 2.7 is below the first section
NOTE: Upgrading from 2.2.1 to 2.4 is below the first section
NOTE: Upgrading from 2.0.5 to 2.2.0 is below the second section
NOTE: Upgrading from 2.0.4 to 2.0.5 is below the third section
NOTE: Upgrading from 2.0.3 to 2.0.4 is below the fourth section
NOTE: Upgrading from 2.0.2 to 2.0.3 is below the fifth section
NOTE: Upgrading from 2.0.1 to 2.0.2 is in the next section
NOTE: Upgrading from 1.1.12-3 to 2.0.1 is at the bottom

########## UPGRADING FROM 2.13 TO 2.14 ##########

OPTIONAL STEPS(But highly recommended) - Backup existing system:

1. Run this for a 1-server system or server with database on it:
(this may take hours on large system)
/usr/share/astguiclient/ADMIN_backup.pl --debugX

2. Run this on dialer/Asterisk-only servers:
(do not run this if you only have one server):
/usr/share/astguiclient/ADMIN_backup.pl --debugX --without-db --without-web


REQUIRED STEPS!!!

1. Check system_settings, make sure you are at DB Schema Version 1478 or higher
If not, run the instructions for 2.11 to 2.13 before this section.

2. upgrade the MySQL asterisk database(you have two options):
A. Running the upgrade file directly from Linux:
mysql -f --database=asterisk < /path/from/root/extras/upgrade_2.14.sql

B. Going into mysql and executing the upgrade sql file:
mysql
use asterisk
\. /path/from/root/extras/upgrade_2.14.sql
quit

3. install new files:
perl ./install.pl
NOTES: If you have customized any scripts in the bin or agi folders,
then make sure you back them up before running the install.pl script.
This script will replace existing files in the astguiclient installation.

4. For each of your ViciDial servers, go the Admin -> Servers -> Modify Server
page and set each one to "Rebuild conf files = Y" and click submit.
This will rebuild the conf files to ensure any changes are updated.

5. On one server only, update your phone codes data:
/usr/share/astguiclient/ADMIN_area_code_populate.pl --purge-table --debug

Please find below the details of my Vicidial.

[root@localhost trunk]# cat /usr/src/astguiclient/trunk/version
2.14b0.5

[root@localhost trunk]# asterisk -rx "core show version"
Asterisk 1.8.23.0-vici built by root @ localhost.localdomain on a x86_64 running Linux on 2022-04-10 01:31:03 UTC

[root@localhost trunk]# cat /etc/redhat-release
CentOS release 6.10 (Final)

mysql> SELECT db_schema_version FROM system_settings;
+-------------------+
| db_schema_version |
+-------------------+
| 1657 |
+-------------------+
1 row in set (0.00 sec)

I know, I'M using too old versions but I just want to see, how it works.

Re: Unable to access the Vicidial Admin Page After SVN/DB Up

PostPosted: Mon Apr 11, 2022 9:06 am
by mflorell
See if there are any errors shown in the apache error_log file

Re: Unable to access the Vicidial Admin Page After SVN/DB Up

PostPosted: Mon Apr 18, 2022 6:23 am
by Ikram_Ali
Thanks mflorell for your kind reply.

We checked and got this.

[Mon Apr 18 16:22:45 2022] [notice] suEXEC mechanism enabled (wrapper: /usr/sbin/suexec)
[Mon Apr 18 16:22:45 2022] [notice] Digest: generating secret for digest authentication ...
[Mon Apr 18 16:22:45 2022] [notice] Digest: done
[Mon Apr 18 16:22:57 2022] [notice] Apache/2.2.15 (Unix) DAV/2 PHP/5.3.3 configured -- resuming normal operations
[Mon Apr 18 16:22:57 2022] [warn] ./mod_dnssd.c: No services found to register
[Mon Apr 18 16:48:00 2022] [error] [client 10.67.89.37] Directory index forbidden by Options directive: /var/www/html/
[Mon Apr 18 16:48:00 2022] [error] [client 10.67.89.37] File does not exist: /var/www/html/favicon.ico, referer: http://10.86.234.172/
[Mon Apr 18 16:48:12 2022] [error] [client 10.67.89.37] PHP Parse error: syntax error, unexpected '[' in /var/www/html/vicidial/admin.php on line 48152

Can you please advise...

Current server IP is 10.86.234.172. Actually, it's on VMWARE so IP getting changed as per the connected network.

Re: Unable to access the Vicidial Admin Page After SVN/DB Up

PostPosted: Mon Apr 18, 2022 8:35 am
by mflorell
Looks like you're using PHP 5.3.3, which was released 12 years ago. I don't think we have any clients running a version that old that we can test on, but it looks like if you just comment out line 48152 in admin.php it might work. If not, I would strongly suggest upgrading PHP on your system since that version has several serious security issues that have been fixed in more recent versions of PHP.

Re: Unable to access the Vicidial Admin Page After SVN/DB Up

PostPosted: Wed Apr 20, 2022 12:34 am
by martinch
That line will not work in 5.3.3...it's super old! I'm living in the mid 2000s too for what it's worth.

If you upgrade to even 5.4+ then you can replace that line with;

Code: Select all
$error_msg = error_get_last();
$error_msg = $error_msg["message"];


func()[] syntax was introduced in PHP 5.4.

But then again, there may be other deprecated stuff all over the shot. It would be a good opportunity to jump to PHP 8 if you can. :) ViCiDial is keeping up with the latest PHP versions. I don't blame you for wanting to stick to what you know though.

Kudos to the #php guys for helping with this.

Thanks,
Martin.

Re: Unable to access the Vicidial Admin Page After SVN/DB Up

PostPosted: Wed Apr 20, 2022 6:38 am
by Ikram_Ali
mflorell wrote:Looks like you're using PHP 5.3.3, which was released 12 years ago. I don't think we have any clients running a version that old that we can test on, but it looks like if you just comment out line 48152 in admin.php it might work. If not, I would strongly suggest upgrading PHP on your system since that version has several serious security issues that have been fixed in more recent versions of PHP.


You are saviour mflorell.

Thanks, it worked after commenting the line number 48152 in admin.php.

Although, I will update the php file.

Re: Unable to access the Vicidial Admin Page After SVN/DB Up

PostPosted: Wed May 11, 2022 1:35 pm
by williamconley
Since you're on VMware ... you should know that you can install a Fresh New ViciBox on a new VPS (test the ability to dial through your carriers in autodial mode so you KNOW this server works). Screen shot the admin->system settings and admin->servers (select this server). We've even been known to dump the tables for those two records so we can put them back after bringing in the DB rather than making manual changes. Or just Make a backup of the DB. Just in case.

Then copy the DB from your old server to your new server and upgrade the DB to the latest db schema (with instructions in /usr/src/astguiclient/trunk/UPGRADE). Note that I prefer to delete all the lines that have already been run. EG: If the DB Schema in the old system is 2552, delete all the .sql commands before the one that changes the DB schema to 2552. Every other line in the upgrade file is an "upgrade db schema" line, so they are easy to find/follow/delete. So when you upgrade, you only upgrade from the previous schema to the end of the last upgrade file.

At that point you'll likely need to make a few changes to admin->system settings and admin->servers (select your server) from your screen shots, but you'll end up with a brand new server that does not have issues with deprecated functions and NO danger to the original server at all.

Re: Unable to access the Vicidial Admin Page After SVN/DB Up

PostPosted: Thu Jul 20, 2023 8:31 am
by bronson
williamconley wrote:Since you're on VMware ... you should know that you can install a Fresh New ViciBox on a new VPS (test the ability to dial through your carriers in autodial mode so you KNOW this server works). Screen shot the admin->system settings and admin->servers (select this server). We've even been known to dump the tables for those two records so we can put them back after bringing in the DB rather than making manual changes. Or just Make a backup of the DB. Just in case.

Then copy the DB from your old server to your new server and upgrade the DB to the latest db schema (with instructions in /usr/src/astguiclient/trunk/UPGRADE). Note that I prefer to delete all the lines that have already been run. EG: If the DB Schema in the old system is 2552, delete all the .sql commands before the one that changes the DB schema to 2552. Every other line in the upgrade file is an "upgrade db schema" line, so they are easy to find/follow/delete. So when you upgrade, you only upgrade from the previous schema to the end of the last upgrade file.

At that point you'll likely need to make a few changes to admin->system settings and admin->servers (select your server) from your screen shots, but you'll end up with a brand new server that does not have issues with deprecated functions and NO danger to the original server at all.


Hi William,

Thanks for posting this. I'm looking to give this method a try. Could you clarify something for me please?

How do you recommend completing this step?
copy the DB from your old server to your new server


Sorry if it's an amateurish question, I'm not very experienced in Linux or system administration. I've managed to get my dialer up and running from reading the manuals and through this forum.

Thank you.