[solved] undef[407]: FAT [Can't get ServerId for Server xxx

Forum for questions and support relating to the 1.30.x releases only.
Locked
marcmerlin
Posts: 93
Joined: Thu Jan 17, 2013 6:13 pm

[solved] undef[407]: FAT [Can't get ServerId for Server xxx

Post by marcmerlin »

For indexing purposes if it helps someone, the actual fix was to comment out ZM_SERVER_HOST in /etc/zm/zm.conf
In my case, it was set because I misunderstood what multi server meant. I have a multi host setup on that machine, and I thought it was linked to http multi homing, and it was not at all.

Details:
Jan 25 19:07:06 gargamel zmdc[27058]: INF ['zmc -m 22' starting at 18/01/25 19:07:06, pid = 27489]
Jan 25 19:07:06 gargamel zmdc[27489]: INF ['zmc -m 22' started at 18/01/25 19:07:06]
Jan 25 19:07:06 gargamel zmdc[27058]: ERR ['zmc -m 20' exited abnormally, exit status 255]
Jan 25 19:07:06 gargamel zmdc[27058]: ERR ['zmc -m 22' exited abnormally, exit status 255]

gargamel:~# strace -s 256 -f zmc -m 22 2>&1 | less
After upgrading to ZM 1.30 (from 1.28), it would fail to start.
Strace showed:
send(3, "9\0\0\0\3SELECT Id FROM Servers WHERE Name='gargamel.merlins.org'", 61, 0) = 61
recv(3, "\1\0\0\1\1*\0\0\2\3def\2zm\7Servers\7Servers\2Id\2Id\f?\0\n\0\0\0\3#B\0\0\0\5\0\0\3\376\0\0\"\0\5\0\0\4\376\0\0\"\0", 16384, 0) = 69
send(4, "<139>Jan 25 19:10:12 undef[407]: ERR [Bogus number of lines return from query, 0 returned for query SELECT Id FROM Servers WHERE Name='gargamel.merlins.org'.]", 158, MSG_NOSIGNAL) = 158
gettimeofday({1516936212, 798324}, NULL) = 0
stat64("/etc/localtime", {st_mode=S_IFREG|0644, st_size=2819, ...}) = 0
gettid() = 407
time([1516936212]) = 1516936212
getpid() = 407
send(4, "<139>Jan 25 19:10:12 undef[407]: FAT [Can't get ServerId for Server gargamel.merlins.org]", 89, MSG_NOSIGNAL) = 89

My Servers table shows that it does have Id, Name, Hostname, State_Id
but the table was empty :(
No idea why zmupdate didn't put anything. I had to find
https://host/zm/?view=options&tab=servers and add the server

Finally zoneminder starts, but this was non obvious. No idea why this upgrade has been so bad for me, but hopefully this gets indexed and helps someone.

gargamel:/tmp# mysql -uuser -ppwd zm -e "select * From Servers WHERE Name='gargamel.merlins.org'"
+----+----------------------+----------------------+----------+
| Id | Name | Hostname | State_Id |
+----+----------------------+----------------------+----------+
| 2 | gargamel.merlins.org | gargamel.merlins.org | NULL |
+----+----------------------+----------------------+----------+
Locked