Hey,
after (manually) upgrading to 1.32 all runs smooth so far besides API.
CakePHP complains it cannot access "Mysql" and throws
Notice (8): Use of undefined constant ZM_DB_SSL_CA_CERT - assumed 'ZM_DB_SSL_CA_CERT' [CORE/Cake/Model/ConnectionManager.php, line 69]
Notice (8): Use of undefined constant ZM_DB_SSL_CLIENT_KEY - assumed 'ZM_DB_SSL_CLIENT_KEY' [CORE/Cake/Model/ConnectionManager.php, line 69]
Notice (8): Use of undefined constant ZM_DB_SSL_CLIENT_CERT - assumed 'ZM_DB_SSL_CLIENT_CERT' [CORE/Cake/Model/ConnectionManager.php, line 69]
which is due to the new zm.conf file now brings these 3 vars to configure.
Was not able to find in wiki, forum or docs any hint how to configure - and why. My DB is in the same isolated net and not SSL_secured?!
Help appreciated.
A.
Upgrade 1.30.4 -> 1.32 API issue accessing Mysql
Re: Upgrade 1.30.4 -> 1.32 API issue accessing Mysql
You may have to remove the entry in the my.cnf file that was for Zoneminder 1.30.4. The database has been "fixed" so that entry is not needed.
In the [mysqld] section remove the following for ZM 1.32.0
sql_mode = NO_ENGINE_SUBSTITUTION
However, the install package for 1.32.0 has been removed from the PPA and this is one thing I have not tested.
In the [mysqld] section remove the following for ZM 1.32.0
sql_mode = NO_ENGINE_SUBSTITUTION
However, the install package for 1.32.0 has been removed from the PPA and this is one thing I have not tested.
Re: Upgrade 1.30.4 -> 1.32 API issue accessing Mysql
Done.
Issue fixed! Requires zoneminder restart to show effect.
This also might have solved my load related issues reported here:
viewtopic.php?f=38&t=27521
A.
Issue fixed! Requires zoneminder restart to show effect.
This also might have solved my load related issues reported here:
viewtopic.php?f=38&t=27521
A.
Re: Upgrade 1.30.4 -> 1.32 API issue accessing Mysql
I tried this fix and removed that option in the my.cnf and the problem either remained or got worse. Had to put it back. I do not like that I have to treat zoneminder 1.32 so carefully. Seems the whole version is seriously unstable.
Re: Upgrade 1.30.4 -> 1.32 API issue accessing Mysql
I am having the same problem and removing from /etc/mysql/my.cnf
sql_mode = NO_ENGINE_SUBSTITUTION
didn't help.
I have 3 installs of this and this is the only location with an SSL cert. Here's what /api/monitors.json reports.
sql_mode = NO_ENGINE_SUBSTITUTION
didn't help.
I have 3 installs of this and this is the only location with an SSL cert. Here's what /api/monitors.json reports.
Anyone else have luck figuring this out?Notice (8): Use of undefined constant ZM_DB_SSL_CA_CERT - assumed 'ZM_DB_SSL_CA_CERT' [CORE/Cake/Model/ConnectionManager.php, line 69]
Notice (8): Use of undefined constant ZM_DB_SSL_CLIENT_KEY - assumed 'ZM_DB_SSL_CLIENT_KEY' [CORE/Cake/Model/ConnectionManager.php, line 69]
Notice (8): Use of undefined constant ZM_DB_SSL_CLIENT_CERT - assumed 'ZM_DB_SSL_CLIENT_CERT' [CORE/Cake/Model/ConnectionManager.php, line 69]
{ "code": 500, "name": "Database connection "Mysql" is missing, or could not be created.", "message": "SQLSTATE[HY000] [2006] MySQL server has gone away", "url": "\/zm\/api\/monitors.json" }
Re: Upgrade 1.30.4 -> 1.32 API issue accessing Mysql
I had the same problem after upgrading Ubuntu to 18.0.4 (which wrecked a bunch of other stuff too, argh.) I noticed that the 1.32 version of /etc/zm/zm.conf has a couple of new entries and if you choose the apt-defaults, it will continue to use the old zm.conf (the new one will be named zm.conf.dpkg-dist):
There's also a dire warning about using the ZM_SERVER_HOST var, which wasn't present in older versions:
After I added these new directives into the current zm.conf file (I also unset ZM_SERVER_HOST variable as well) and restarted ZM/logged back in, https://myzmserver/zm/api/monitors.json started showing the monitors properly again. As I don't have any certs active for the DB, I just left all the ZM_DB_* vars as empty.
Note: Prior to all this, I also disabled the sql_mode directive in /etc/mysql/my.cnf as well.
Code: Select all
...
# SSL CA certificate for ZoneMinder database
ZM_DB_SSL_CA_CERT=
# SSL client key for ZoneMinder database
ZM_DB_SSL_CLIENT_KEY=
# SSL client cert for ZoneMinder database
ZM_DB_SSL_CLIENT_CERT=
Code: Select all
# Do NOT set ZM_SERVER_HOST if you are not using Multi-Server
# You have been warned
#
# The name specified here must have a corresponding entry
# in the Servers tab under Options
ZM_SERVER_HOST=
Note: Prior to all this, I also disabled the sql_mode directive in /etc/mysql/my.cnf as well.