Articles in this section

Unable to change login settings of WordPress instance: Cannot read property 'login' of undefined

Plesk for Linux kb: technical ABT: Group B

Applicable to:

  • Plesk for Linux
  • Plesk for Windows

Symptoms

  • Unable to change login settings in Domains > example.com > WordPress instance > Setup:

    PLESK_INFO: Something went wrong.
    r is underfined

    or

    PLESK_INFO: Something went wrong.
    Cannot read property 'login' of undefined

    or

    PLESK_ERROR: Administrator account not found for this WordPress instance. Please create administrator account manually in WordPress

  • Opening http://example.com/wp-admin.php redirects to http://example.com or shows the error below:

    PLESK_INFO: Sorry, you are not allowed to access this page.

  • There is no "Administrator" user for the instance:

    # plesk ext wp-toolkit --wp-cli -instance-id 1 -- user list --format=json --quiet --role=administrator

    Note: instance-id can be seen in the address bar of a browser by opening the instance in Domains > example.com > WordPress instance:
    ID

  • In Domains > example.com > WordPress instance > Database > open in phpMyAdmin > example_usermeta there are no records with meta_key example_capabilities and example_user_level for user_id 1:
    Table

Cause

Corrupted WordPress instance database.

Resolution

  1. Log into Plesk.

  2. Open Domains > example.com > WordPress instance > Database > necessary database > open in phpMyAdmin > example_usermeta.

  3. Click Insert button:
    Insert

  4. Type the following:

    First query:

    CONFIG_TEXT: user_id - 1
    meta_key - example_capabilities
    meta_value - a:1:{s:13:"administrator";b:1;}

    1

    The second query:

    CONFIG_TEXT: user_id - 1
    meta_key - example_user_level
    meta_value - 10

    1

  5. Click Go:
    1

Note: If the table does not exist, the last backup should be restored or Wordpress Support Contacted, to further assistance to reacreate the table.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.