Unable to remove a subscription: ERROR: Call to a member function removeUser

Refers to:

  • Plesk 12.5 for Linux
  • Plesk 11.0 for Windows
  • Plesk 12.0 for Windows
  • Plesk 12.0 for Linux
  • Plesk 12.5 for Windows

Created:

2016-11-16 13:21:35 UTC

Modified:

2016-12-21 20:32:30 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Unable to remove a subscription: ERROR: Call to a member function removeUser

Symptoms

Unable to remove a subscription, the following error appears in Plesk GUI:

ERROR: Call to a member function removeUser() on a non-object (Abstract.php:988)

Cause

Database inconsistency, particularly by missing entry in ServiceInstances table.

Resolution

  1. Create a backup of Plesk database:

    On Windows Server OSes:

    "%plesk_dir%MySQL\\bin\\mysqldump.exe" -uadmin -p******** -P8306 psa > C:\\psa_db_dump.sql

    On Linux OSes:

    # mysqldump -uadmin -p`cat /etc/psa/.psa.shadow ` psa > psa_dump_`date +%F`.sql
  2. Find missing record (consider replacing domain.tld with domain name in question):

    mysql> select id,name from domains where name='domain.tld';
    +-----+----------------------+
    | id | name |
    +-----+----------------------+
    | 138 | domain.tld |
    +-----+----------------------+
    1 row in set (0.00 sec)

    mysql> select id,object_id from Subscriptions where object_id=138 and object_type='domain';
    +-----+-----------+
    | id | object_id |
    +-----+-----------+
    | 236 | 138 |
    +-----+-----------+
    1 row in set (0.00 sec)

    mysql> select * from ServiceInstances where servicePackageId=236;
    Empty set (0.00 sec)
  3. Generate some uuid using the following commands

    On Linux OSes:

    # UUID=$(cat /proc/sys/kernel/random/uuid);echo $UUID
    bb4b3444-b9b9-4900-862b-d4419c3fb844

    On Windows Server OSes (use powershell):

    > $uuid = [guid]::NewGuid(); $uuid
    Guid
    ----
    3e930ae3-42ce-45e1-aa83-cc808304d90b
  4. Make sure that there are no entries in ServiceInstances table with this uuid:

    mysql> select * from ServiceInstances where reference='bb4b3444-b9b9-4900-862b-d4419c3fb844';
    Empty set (0.01 sec)
  5. Insert missing record to ServiceInstances table:

    mysql> insert into ServiceInstances(serviceInstallationId, servicePackageId, reference, status, enabled) values(2, 236, 'fd678c14-6ce8-11e4-b116-123b93f75cba', 1, 1);
    Query OK, 1 row affected (0.01 sec)
  6. Try to remove the subscription again.

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