Services management menu returns error : Call to a member function getWebServerPackage() on a non-object (class.ServiceControl.php:76)

Created:

2016-11-16 12:54:48 UTC

Modified:

2017-05-28 17:07:20 UTC

1

Was this article helpful?


Have more questions?

Submit a request

Services management menu returns error : Call to a member function getWebServerPackage() on a non-object (class.ServiceControl.php:76)

Applicable to:

  • Plesk 12.5 for Linux
  • Plesk 11.5 for Linux
  • Plesk 12.0 for Windows
  • Plesk 12.0 for Linux

Symptoms

When accessing Tools & Settings > Services Management in Plesk, the below error is displayed:

ERROR: Call to a member function getWebServerPackage() on a non-object (class.ServiceControl.php:76)

or

Several functions in Plesk, including adding a domain and accessing the Web Server Configuration Troubleshooting tool, give PHP errors. Additionally, reconfiguring Apache fails with this error:

 Details: PHP Fatal error:  Call to a member function getScheme() on a non-object in /usr/local/psa/admin/plib/WebServerManager/Adapter/Apache.php on line 800

Cause

The issue is caused by database inconsistency that is, most likely, occurred after an upgrade.

The following query returns empty set or empty value as below:

mysql> select * from ServiceNodeEnvironment where name='httpd';
Empty set (0.00 sec)

or

mysql> select * from ServiceNodeEnvironment where name='httpd';
+---------------+--------------------+-------+----------------------+
| serviceNodeId | section | name | value |
+---------------+--------------------+-------+----------------------+
| 1 | componentsPackages | httpd | |
+---------------+--------------------+-------+----------------------+
1 row in set (0.00 sec)

Resolution

Insert the necessary record into Plesk database (both commands check the Apache package version on either RPM or DPKG system and insert it into the database. Should be executed as is):

1. For RPM-based operating systems:

  1. Delete record from psa database to avoid dublicate entries:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa -e"delete from ServiceNodeEnvironment where name='httpd';"
  2. Insert record as below:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa -e"insert into ServiceNodeEnvironment values(1,'componentsPackages','httpd','`rpm -q --qf "%{VERSION}.%{RELEASE}\

    " httpd`')"

2. For DPKG-based operating systems:

  1. Delete record from psa database to avoid dublicate entries:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa -e"delete from ServiceNodeEnvironment where name='httpd';"
  2. Insert record as below:

    # MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa -e"insert into ServiceNodeEnvironment values(1,'componentsPackages','httpd','`dpkg-query -W -f='${Version} ${Release}\

    ' apache2`')"

Have more questions? Submit a request
Please sign in to leave a comment.