NetXMS 1.2.17 crashed and doesn't start anymore

Started by VMGuy, January 06, 2015, 03:19:30 AM

Previous topic - Next topic

VMGuy

Hi,

I just had/have a strange issue where the backend crashed and isn't able to start anymore.

That's what happened:
- I created a new script in the script library
- When I was finished I closed the script and was asked to save it
- I clicked yes and got an error - Something like "Broken pipe"
- Then the backend crashed and wasn't reachable anymore

And now I can't even start it.
The last entry in the log file is this:
...
[05-Jan-2015 22:42:18.366] [DEBUG] Script Filter::SNMP added to library
[05-Jan-2015 22:42:18.366] [DEBUG] Script Filter::Agent added to library
[05-Jan-2015 22:42:18.366] [DEBUG] Script Filter::AgentOrSNMP added to library
[05-Jan-2015 22:42:18.366] [DEBUG] Script DCI::SampleTransform added to library
[05-Jan-2015 22:42:18.366] [DEBUG] Script Hook::ConfigurationPoll added to library


After the last loaded script there should be the newly created one. I assume it can't be loaded and crashes the server.
I already did a DB check, but no problem was found.

What can I do to fix that?
Any chance to remove it from the database?

Thanks, VMGuy

tomaskir

In the database, go to the "script_library" table and change the script to "return true;".
Server should start now.

Was the script used in any Script DCIs or anywhere else?

VMGuy

Thanks for the table name.
I removed this script from the table and now the server starts.

Thanks for that.

No the script wasn't used yet.
It should be a script for handling SNMP traps.

Victor Kirhenshtein

Hi,

do you still have/remember source code of problematic script?

Best regards,
Victor

VMGuy

It's still on my screen as result of the select statement before I deleted it.
It was a copy of a script I found in this forum and I started playing around with it.

|     10001 | Acronis_Backup_Trap     |
sub main() {
    switch($event->parameters[1]) {
      case "Unkown":
        evt = "ACRONIS_BACKUP_UNKOWN";
        break;
      case "Information"
        evt = "ACRONIS_BACKUP_INFO";
        break;
      case "Warning"
        evt = "ACRONIS_BACKUP_WARNING";
        break;
      case "Error"
        evt = "ACRONIS_BACKUP_ERROR";
        break;
      default:
        evt = "ACRONIS_BACKUP_INFO";
        break;
    }
    PostEvent($node, evt, null, $event->parameters[1]);  // pass message as first parameter to generated event
  } else {
    PostEvent($node, "ACRONIS_BACKUP_CLOSE");
  }
}