PHP Fatal error: Uncaught Error: Undefined constant "ISPC_APP_VERSION"

Discussion in 'ISPConfig 3 Priority Support' started by Stelios, Jun 21, 2024.

  1. Stelios

    Stelios Active Member HowtoForge Supporter

    Hi,

    I'm trying to update one of a many servers to the latest version (all rest worked fine) but on this one I get:

    PHP Fatal error: Uncaught Error: Undefined constant "ISPC_APP_VERSION" in /usr/local/ispconfig/server/scripts/ispconfig_update.php:96
    Stack trace:
    #0 {main}
    thrown in /usr/local/ispconfig/server/scripts/ispconfig_update.php on line 96

    I double checked that /usr/local/ispconfig/server/lib/mysql_clientdb.conf has indeed the proper information.

    How can I pass that error?
     
  2. Stelios

    Stelios Active Member HowtoForge Supporter

    Further to my post, if I run it directly from the download sources I get:

    Operating System: Debian 12.0 (Bookworm) or compatible

    Code:
    PHP Warning:  Undefined variable $conf in /home/myusername/ispconfig3_install/install/update.php on line 113
    PHP Stack trace:
    PHP   1. {main}() /home/myusername/ispconfig3_install/install/update.php:0
    PHP Warning:  Trying to access array offset on value of type null in /home/myusername/ispconfig3_install/install/update.php on line 160
    PHP Stack trace:
    PHP   1. {main}() /home/myusername/ispconfig3_install/install/update.php:0
    PHP Warning:  Trying to access array offset on value of type null in /home/myusername/ispconfig3_install/install/update.php on line 161
    PHP Stack trace:
    PHP   1. {main}() /home/myusername/ispconfig3_install/install/update.php:0
    PHP Warning:  Trying to access array offset on value of type null in /home/myusername/ispconfig3_install/install/update.php on line 163
    PHP Stack trace:
    PHP   1. {main}() /home/myusername/ispconfig3_install/install/update.php:0
    PHP Warning:  Trying to access array offset on value of type null in /home/myusername/ispconfig3_install/install/update.php on line 164
    PHP Stack trace:
    PHP   1. {main}() /home/myusername/ispconfig3_install/install/update.php:0
    PHP Warning:  Trying to access array offset on value of type null in /home/myusername/ispconfig3_install/install/update.php on line 165
    PHP Stack trace:
    PHP   1. {main}() /home/myusername/ispconfig3_install/install/update.php:0
    PHP Warning:  Trying to access array offset on value of type null in /home/myusername/ispconfig3_install/install/update.php on line 167
    PHP Stack trace:
    PHP   1. {main}() /home/myusername/ispconfig3_install/install/update.php:0
    PHP Warning:  Trying to access array offset on value of type null in /home/myusername/ispconfig3_install/install/update.php on line 168
    PHP Stack trace:
    PHP   1. {main}() /home/myusername/ispconfig3_install/install/update.php:0
    PHP Deprecated:  gethostbyname(): Passing null to parameter #1 ($hostname) of type string is deprecated in /home/myusername/ispconfig3_install/install/update.php on line 186
    PHP Stack trace:
    PHP   1. {main}() /home/myusername/ispconfig3_install/install/update.php:0
    PHP   2. gethostbyname($hostname = NULL) /home/myusername/ispconfig3_install/install/update.php:186
     
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    Most likely, your system has no ISPConfig configuration file, or it is empty or damaged. Check /usr/local/ispconfig/server/lib/config.inc.php
     
    Th0m likes this.
  4. Stelios

    Stelios Active Member HowtoForge Supporter

    The file is indeed empty. What can I do?
     
  5. till

    till Super Moderator Staff Member ISPConfig Developer

    Does the file /usr/local/ispconfig/interface/lib/config.inc.php is still intact? If yes, copy it to /usr/local/ispconfig/server/lib/config.inc.php
     
  6. Stelios

    Stelios Active Member HowtoForge Supporter

    The file /usr/local/ispconfig/interface/lib/config.inc.php is empty too
     
  7. till

    till Super Moderator Staff Member ISPConfig Developer

    Check if you have any ispconfig backups in /var/backup folder. They should contain copies of these two config files. Restore the two config files from these backups.
     
  8. Stelios

    Stelios Active Member HowtoForge Supporter

    Would it be a problem if I copy those from another server (on the same multi server setup)?
     
  9. till

    till Super Moderator Staff Member ISPConfig Developer

    The file sare server specific, they contain the passwords for the mysql database. So, if you copy them, then you must manually adjust the usernames and passwords in the files. The local ispconfig mysql user is always named 'ispconfig', but the user to log into the master differs and is called ispcsrv plus a number. Also, the server_id must be adjusted in that config file.

    Which services does this server run? You can e.g. find the password of the local ispconfig user in some of the postfix config files but also in a config file from pure-ftpd.
     
  10. Stelios

    Stelios Active Member HowtoForge Supporter

    The server is running email only; nothing else.
     
  11. till

    till Super Moderator Staff Member ISPConfig Developer

    Then, you can find the password of the ispconfig mysql user in the postfix mysql config files.
     
  12. Stelios

    Stelios Active Member HowtoForge Supporter

    I found the details of the ispconfig file in mysql_virtual_client.cf file. I copied over from another email server the /usr/local/ispconfig/interface/lib/config.inc.php into my problematic server /usr/local/ispconfig/server/lib/config.inc.php
    I edit the password of the user and then tried to update and got the following:

    Code:
    PHP Warning:  Trying to access array offset on value of type null in /tmp/user/0/update_runner.sh.0og363buPp/install/lib/update.lib.php on line 147
    PHP Stack trace:
    PHP   1. {main}() /tmp/user/0/update_runner.sh.0og363buPp/install/update.php:0
    PHP   2. updateDbAndIni() /tmp/user/0/update_runner.sh.0og363buPp/install/update.php:338
    PHP Deprecated:  stripslashes(): Passing null to parameter #1 ($string) of type string is deprecated in /tmp/user/0/update_runner.sh.0og363buPp/install/lib/update.lib.php on line 147
    PHP Stack trace:
    PHP   1. {main}() /tmp/user/0/update_runner.sh.0og363buPp/install/update.php:0
    PHP   2. updateDbAndIni() /tmp/user/0/update_runner.sh.0og363buPp/install/update.php:338
    PHP   3. stripslashes($string = NULL) /tmp/user/0/update_runner.sh.0og363buPp/install/lib/update.lib.php:147
    Unable to read server configuration from database
    The above throws when I entered the details for mysql to access the controlpanel server
     
  13. Stelios

    Stelios Active Member HowtoForge Supporter

    From a more detailed look of the file it seems that I need to found the password for the user ispcsrv12 as that seems to be the one that connects to the controlpanel server.
    Is it anywhere in any file that I can see it?
     
  14. till

    till Super Moderator Staff Member ISPConfig Developer

    You must adjust the password of the ispconfig user, the server_id and the name of the ispcsrv user, so that the ID in the name is correct.

    No. But it does not matter for the update as the password is set during update when you chose reconfigure services in master database.
     
  15. Stelios

    Stelios Active Member HowtoForge Supporter

    But I'm not reaching to that level look below:

    MySQL master server database name [dbispconfig]:

    Checking ISPConfig database .. OK
    PHP Warning: Trying to access array offset on value of type null in /tmp/user/0/update_runner.sh.2ugCtIDt2M/install/lib/update.lib.php on line 147
    PHP Stack trace:
    PHP 1. {main}() /tmp/user/0/update_runner.sh.2ugCtIDt2M/install/update.php:0
    PHP 2. updateDbAndIni() /tmp/user/0/update_runner.sh.2ugCtIDt2M/install/update.php:338
    PHP Deprecated: stripslashes(): Passing null to parameter #1 ($string) of type string is deprecated in /tmp/user/0/update_runner.sh.2ugCtIDt2M/install/lib/update.lib.php on line 147
    PHP Stack trace:
    PHP 1. {main}() /tmp/user/0/update_runner.sh.2ugCtIDt2M/install/update.php:0
    PHP 2. updateDbAndIni() /tmp/user/0/update_runner.sh.2ugCtIDt2M/install/update.php:338
    PHP 3. stripslashes($string = NULL) /tmp/user/0/update_runner.sh.2ugCtIDt2M/install/lib/update.lib.php:147
    Unable to read server configuration from database


    It throws the above error after filling the db details (correct) and stops
     
  16. Stelios

    Stelios Active Member HowtoForge Supporter

    From a further reading it might be the server_id number as obviously I got there the number 2 which I guess is on the server that I copied from. Where can I find the server_id of the server that I want to fix?
     
  17. Stelios

    Stelios Active Member HowtoForge Supporter

    ok found it by doing a grep in the cf files; changed it and that fixed the problem. Thanks a lot.
     
  18. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    in the ispconfig master servers dbispconfig database.
    Code:
    select server_id, server_name from dbispconfig.server;
    
     
  19. Stelios

    Stelios Active Member HowtoForge Supporter

    Hi again, I've updated as mentioned above fine; the config file shows 3.2.12 version but even after a reboot of all servers and 2 hours is still showing the old version. Do I have to check something else? Usually after an upgrade it is a matter of a few minutes to reflect the version under monitoring tab.
     
  20. nhybgtvfr

    nhybgtvfr Well-Known Member HowtoForge Supporter

    i think that can, on occasion, take quite a while to update the version number.. maybe check it again tomorrow.
     

Share This Page