Articles in this section

Node.js menu on a migrated subscription in Plesk doesn't work: Call to a member function getPath() on null

kb: bug kb: fixed

Applicable to:

  • Plesk for Linux

Symptoms

  • Unable to open Subscriptions > example.com > Node.js for newly migrated domain:

    PLESK_ERROR: Server Error
    500
    Error
    Call to a member function getPath() on null

  • Domain example.com has non-existent ext-nodejs-handlerPath:

    # plesk db "select val from dom_param where param='ext-nodejs-handlerPath' and dom_id=(select id from domains where name='example.com' limit 1);"
    +-----------------------------+
    | val |
    +-----------------------------+
    | /opt/plesk/node/17/bin/node |
    +-----------------------------+

    # ls -l /opt/plesk/node/17/bin/node
    ls: cannot access /opt/plesk/node/17/bin/node: No such file or directory

  • Other Node.js handlers versions are found on the server:

    # ls -1 /opt/plesk/node/*/bin/node
    /opt/plesk/node/10/bin/node
    /opt/plesk/node/12/bin/node
    /opt/plesk/node/14/bin/node
    /opt/plesk/node/16/bin/node

Cause

Product issue:

  • #EXTNODEJS-122 "Opening the extension on domains with non-existent handlers no longer results in Internal Server Error 500."
    Fixed in:

Resolution

Please consider updating your server:

Workaround

If update is not possible for some reason you may try the following

workaround

As a workaround apply one of the following alternatives:

  • Re-install Node.js extension by removing and installing this again with this instructions.

  • Update the the ext-nodejs-handlerPath on the database:

    1. Connect to the server via SSH

    2. Backup the Plesk 'psa' database

    3. Login to the database

      # plesk db

    4. Modify the ext-nodejs-handlerPath to /opt/plesk/node/16/bin/node:

      # update dom_param set val='/opt/plesk/node/16/bin/node' where dom_id=(select id from domains where name='example.com' limit 1) and param='ext-nodejs-handlerPath';

      Note: Change example.com and the node version 16 accordingly based on the versions found on the server.

    5. Log into Plesk

    6. Go to Domains > example.com > Node.js.

    7. Click Disable node.js button.

    8. Click Enabled node.js button.

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.