Applicable to:
- Plesk for Linux
Symptoms
-
When accessing Tools & Settings > Services Management in Plesk, the below error is displayed:
PLESK_INFO: ERROR: Call to a member function getWebServerPackage() on a non-object (class.ServiceControl.php:76)
-
Reconfiguring Apache fails with this error:
CONFIG_TEXT: 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
Empty ServiceNodeEnvironment
value due to database inconsistency:
MYSQL_LIN: select * from ServiceNodeEnvironment where name='httpd';
Empty set (0.00 sec)
MYSQL_LIN: select * from ServiceNodeEnvironment where name='httpd';
+---------------+------------------------+-------+----------------------+
| serviceNodeId | section | name | value |
+---------------+------------------------+-------+----------------------+
| 1 | componentsPackages | httpd | |
+---------------+------------------------+-------+----------------------+
1 row in set (0.00 sec)
Resolution
-
Connect to the server using SSH.
-
# MYSQL_PWD=
cat /etc/psa/.psa.shadow
mysqldump -u admin psa > psadate +%F_%H.%M
.sql -
Delete record from psa database to avoid duplicate entries:
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa -e"delete from ServiceNodeEnvironment where name='httpd';"
-
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`')"
-
Connect to the server using SSH.
-
# MYSQL_PWD=
cat /etc/psa/.psa.shadow
mysqldump -u admin psa > psadate +%F_%H.%M
.sql -
Delete record from psa database to avoid duplicate entries:
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa -e"delete from ServiceNodeEnvironment where name='httpd';"
-
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`')"
Alternative steps:
-
Execute the following command in order to know the apache version and release:
# dpkg-query -W -f='${Version} ${Release}' apache2
2.4.10-1ubuntu1.1~ubuntu14.04.2 -
Insert the version and release to the database:
# MYSQL_PWD=`cat /etc/psa/.psa.shadow` mysql -u admin psa -e"insert into ServiceNodeEnvironment values(1,'componentsPackages','httpd','2.4.10-1ubuntu1.1~ubuntu14.04.2');"
Comments
0 comments
Please sign in to leave a comment.