NetXMS Support Forum

English Support => General Support => Topic started by: krvns on December 24, 2018, 01:21:13 PM

Title: Problems with startup (DB, service netxmsd)
Post by: krvns on December 24, 2018, 01:21:13 PM
Hello.

After installation of components I have some problems:

- i want to initialization DB:
nxdbmgr init /usr/lib/postgresql/9.5/bin/initdb

but result:

SQL query failed (42601 ERROR:  syntax error at or near "
LINE 1:ELF
        ^):
ELF
Database initialization failed


In the logfile:

*I* Platform subagent "/usr/lib/x86_64-linux-gnu/netxms/linux.nsm" successfully loaded
*I* Database driver "pgsql.ddr" loaded and initialized successfully
*E* SQL query failed (Query = "SELECT var_value FROM metadata WHERE var_name='SchemaVersion'"): 42P01 ERROR:  relation "metadata" does not exist
LINE 1: SELECT var_value FROM metadata WHERE var_name='SchemaVersion...
                              ^
*E* SQL query failed (Query = "SELECT var_value FROM config WHERE var_name='DBFormatVersion'"): 42P01 ERROR:  relation "config" does not exist
LINE 1: SELECT var_value FROM config WHERE var_name='DBFormatVersion...
                              ^
* Unable to get database schema version

What I can change to fix it?


- if I login with admin/netxms in web management console, i always have "Connection refused".

- and one problem yet:

root@nxms:~# service netxmsd status

● netxmsd.service - NetXMS Server
   Loaded: loaded (/lib/systemd/system/netxmsd.service; disabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since MSK; 30min ago
  Process: 3172 ExecStart=/usr/bin/netxmsd -d (code=exited, status=0/SUCCESS)
Main PID: 3176 (code=exited, status=3)

nxms systemd[1]: Starting NetXMS Server...
nxms systemd[1]: netxmsd.service: PID file /var/run/netxmsd.pid not readable (yet?) after start: No s
nxms systemd[1]: Started NetXMS Server.
nxms systemd[1]: netxmsd.service: Main process exited, code=exited, status=3/NOTIMPLEMENTED
nxms systemd[1]: netxmsd.service: Unit entered failed state.
nxms systemd[1]: netxmsd.service: Failed with result 'exit-code'.


I use:
- Ubuntu server 16.04
- PostgreSQL 9.5.13
- tomcat8

--
Thanks for help
Title: Re: Problems with startup (DB, service netxmsd)
Post by: Tursiops on December 26, 2018, 11:56:54 PM
You are trying to import a binary file, not the actual dbinit file.
For Postgres, the file you need to import is named dbinit_pgsql.sql.
The documentation (https://www.netxms.org/documentation/adminguide/installation.html) gives the following sample command (your actual paths will likely differ):
/usr/local/bin/nxdbmgr init /usr/local/share/netxms/sql/dbinit_pgsql.sql