Adding new (manual) server-ip leads to error

  • Currently, I'm running two servers, as my old one will be migrated to new one (almost finished). I set up everything so far and it's running fine. Now the point is, my new server will use the IPs from my old server but is currently (temporarily) set up with other IPs (v4/v6.) I'm aware, that I'm responsible to change the network-configuration of my linux machine. Anyway: imscp has to re-generate all configs again. In order to prepare this step, I tried to add the IP (/27-network) from my old-server to the new one via imscp's gui, but ran into " Modules::ServerIP::add: Can't call method "isEmpty" on an undefined value at /var/www/imscp/engine/PerlLib/iMSCP/EventManager.pm line 231."
    Please note: the IP from my old server is not yet part of my network-configuration - so imscp cannot determine it automatically or take notice of it in any way. However, I tried to add it in manual-mode.


    Don't know if it's working as intended (and I did something wrong) or this is a bug. Maybe the preferred way is to call
    /var/www/imscp/engine/setup/imscp-reconfigure -dr primary_ip when the network-configuration was changed to the new (so to old) ip.



    Version: Git master (a few days old)

  • @biologist



    I tried to add the IP (/27-network) from my old-server to the new one via imscp's gui, but ran into " Modules::ServerIP::add: Can't call method "isEmpty" on an undefined value at /var/www/imscp/engine/PerlLib/iMSCP/EventManager.pm line 231."

    I cannot reproduce the problem with current 1.5.x branch. I need more information:

    • List of plugins installed and activated on your i-MSCP installation
    • List of listener files installed on your i-MSCP installation

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • @biologist


    I can reproduce the problem with the DefaultServerPage plugin:

    Shell-Script
    1. 192.168.1.139 (enp0s3:1004)Modules::ServerIP::add: Can't call method "isEmpty" on an undefined value at /var/www/imscp/engine/PerlLib/iMSCP/EventManager.pm line 231.

    An event listener from the DefaultServerPage plugin self unregister at some point (expected) but it seem that something goes wrong in that case... I'll investigate and fix, either the plugin or core.


    I can reprodue with following code snippet too:

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • @biologist


    Here come a patch.


    How to process

    • Download the patch attached below somewhere on your server (such as in /root directory)
    • Test the patch as follow: patch --dry-run -p0 -d /var/www/imscp < Fixed__Can_t_call_method__isEmpty__on_an_undefined_value_when_a_listener_self_un_register_.patch
    • Then if all goes well, effectively apply the patch as follow: patch -p0 -d /var/www/imscp < Fixed__Can_t_call_method__isEmpty__on_an_undefined_value_when_a_listener_self_un_register_.patch

    Once done, retry.


    @biologist Please can you test the hotfix patch that I made available there?


    Thanks ;)

  • A fix has been added in our development branch. See https://github.com/i-MSCP/imsc…efaa51576009035d9ddef8c3e
    This fix will be part of next release.


    Thank you for your report.
    Thread closed.

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • Sorry for my late answer..
    What can I say? Works! :-)
    Indeed, I've got this plugin installed (beside von LE, opendkim, phpswitcher and sa).


    Thank you!

  • Thank you!

    You're welcome ;)

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206