Zoneminder interface 404 error right after install

wolfslab

Cadet
Joined
Apr 22, 2019
Messages
7
I have just tried to install zoneminder plugin on a fresh install of FreeNAS (already setup storage and shares) and whenever I navigate to its IP address, it says "404 not found" and changes the url to http://192.168.1.97/zm. Not sure why its doing this. I am installing it from the plugins page. Latest version of stable FreeNAS.
 

castanza128

Cadet
Joined
Jul 2, 2019
Messages
4
This happened to me today, as well.
It installed fine yesterday, but I had the wrong network settings. So today I deleted the jail, reinstalled with the proper settings I wanted, 404 error from nginx on the management page just like you're getting :(
I tried all sorts of things, thinking it was me, or the new interface I created. Then I installed it over again, and scrolled through the install log. It said something about "zoneminder files don't exist" in the folder they are supposed to be in.
I think the zoneminder repository is down today, or something. I think it's not getting the zoneminder files when it creates the jail.
Or maybe I installed them too many times in a day and got banned?
edit:
zoneminder does not exist in /etc/rc.d or the local startup
directories (/usr/local/etc/rc.d), or is not executable
That's what it says, exactly.
 
Last edited:

marcusmarcus

Explorer
Joined
May 27, 2011
Messages
89
Doing this for me as well. Any update on this. Why would it be intended that this can only be installed once? Does not make sense to me. I installed it once for testing and it worked fine. I then removed it. Then I got a decent security camera and wanted to set it back up, but when I install it again, it is getting the 404 error. I have tried multiple times, tried creating a new JAIL volume and activating that and it still gives 404 error. Hopefully this is resolved soon. I could not get Zoneminder working manually, though I did not try too hard as I would prefer to just go through the plugins.
 

marcusmarcus

Explorer
Joined
May 27, 2011
Messages
89
Hi,
Did you try it with the latest update from yesterday?

I do not see any updates from yesterday.
Do you mean FreeNAS update? Checked and no updates available.
Do you mean plugin update? I checked in available plugins and it still shows version 1.32.3_2, which is the same version I tried installing the last few days. I cannot update the plugin because it is not installing properly first so nothing to update.

Could you explain what you meant by your earlier comment about "Actually this is intended"? I cannot figure out why this would be intended.
 
M

miwi

Guest
Please remove the broken install, reboot the FreeNAS box and install the plugin fresh.
 

marcusmarcus

Explorer
Joined
May 27, 2011
Messages
89
I removed the install, I tried installing it again, but still same issue.
I ran "iocage update zoneminder" command and started the plugin, now I get
"Unable to connect to ZM db.SQLSTATE[HY000] [2002] No such file or directory"

I tried your way and removed the broken install, rebooted the FreeNAS box and installed the plugin fresh.
Now it works!

Thanks!
 

ere109

Contributor
Joined
Aug 22, 2017
Messages
190
Worked for me after same issue. Thank you.
 

fitzgerald99

Cadet
Joined
Mar 30, 2023
Messages
2
I have the same issue after install the Zoneminder plugin on my TrueNAS Core-13.0-U3.1, then I start to debug this issue and found that zoneminder didn't install on the Jail created, so we need to install it manually.

Here is the steps:

1. Remember the database password from POST INSTALL NOTES
2. Go to Jails => zoneminder(you may use different jail name) => SHELL
3. run command: pkg install zoneminder
4. run command: mysql -u dbadmin -p zm < /usr/local/share/zoneminder/db/zm_create.sql
5. input the password from POST INSTALL NOTES, then wait it finish.
6. run command: touch /usr/local/etc/zoneminder/zm-freenas.conf
use vi to edit /usr/local/etc/zoneminder/zm-freenas.conf and add those lines
ZM_DB_NAME=zm
ZM_DB_USER=dbadmin
ZM_DB_PASS=(password from POST INSTALL NOTES)
7. service zoneminder start

Now we can go to the admin portal and start to use Zoneminder.

Hope this can help someone want to use Zoneminder on TrueNAS Core.
 

leon59

Cadet
Joined
Apr 2, 2023
Messages
2
I have the same issue after install the Zoneminder plugin on my TrueNAS Core-13.0-U3.1, then I start to debug this issue and found that zoneminder didn't install on the Jail created, so we need to install it manually.

Here is the steps:

1. Remember the database password from POST INSTALL NOTES
2. Go to Jails => zoneminder(you may use different jail name) => SHELL
3. run command: pkg install zoneminder
4. run command: mysql -u dbadmin -p zm < /usr/local/share/zoneminder/db/zm_create.sql
5. input the password from POST INSTALL NOTES, then wait it finish.
6. run command: touch /usr/local/etc/zoneminder/zm-freenas.conf
use vi to edit /usr/local/etc/zoneminder/zm-freenas.conf and add those lines
ZM_DB_NAME=zm
ZM_DB_USER=dbadmin
ZM_DB_PASS=(password from POST INSTALL NOTES)
7. service zoneminder start

Now we can go to the admin portal and start to use Zoneminder.

Hope this can help someone want to use Zoneminder on TrueNAS Core.
Thank you, it worked for me, but only on the first start.
If I restart the jail I get an error :
"Unable to connect to ZM db using dsn mysql:host=localhost;dbname=zm
SQLSTATE[HY000] [2002] No such file or directory"

on the shell, if i start manually the service, I have this detail
DBI connect('database=zm;host=localhost','dbadmin',...) failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) at /usr/local/lib/perl5/site_perl/ZoneMinder/Database.pm line 110.
DBI connect('database=zm;host=localhost','dbadmin',...) failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) at /usr/local/lib/perl5/site_perl/ZoneMinder/Database.pm line 110.
04/02/23 16:59:25.002095 zmpkg[24306].ERR [ZoneMinder::Database:114] [Error reconnecting to db: errstr:Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) error val:]
04/02/23 16:59:25.002273 zmpkg[24306].ERR [ZoneMinder::Database:114] [Error reconnecting to db: errstr:Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) error val:]
DBI connect('database=zm;host=localhost','dbadmin',...) failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) at /usr/local/lib/perl5/site_perl/ZoneMinder/Database.pm line 110.
04/02/23 16:59:25.002431 zmpkg[24306].ERR [ZoneMinder::Database:114] [Error reconnecting to db: errstr:Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) error val:]
Unable to connect to DB. ZM Cannot continue.

Any idea to solve the problem ?
 

RalphG

Cadet
Joined
Apr 1, 2023
Messages
2
I have the same issue after install the Zoneminder plugin on my TrueNAS Core-13.0-U3.1, then I start to debug this issue and found that zoneminder didn't install on the Jail created, so we need to install it manually.

Here is the steps:

1. Remember the database password from POST INSTALL NOTES
2. Go to Jails => zoneminder(you may use different jail name) => SHELL
3. run command: pkg install zoneminder
4. run command: mysql -u dbadmin -p zm < /usr/local/share/zoneminder/db/zm_create.sql
5. input the password from POST INSTALL NOTES, then wait it finish.
6. run command: touch /usr/local/etc/zoneminder/zm-freenas.conf
use vi to edit /usr/local/etc/zoneminder/zm-freenas.conf and add those lines
ZM_DB_NAME=zm
ZM_DB_USER=dbadmin
ZM_DB_PASS=(password from POST INSTALL NOTES)
7. service zoneminder start

Now we can go to the admin portal and start to use Zoneminder.

Hope this can help someone want to use Zoneminder on TrueNAS Core.
Thanks. That has got Zoneminder running on my "new" server. Previously I was running it on a Centos 7 server.
 

fitzgerald99

Cadet
Joined
Mar 30, 2023
Messages
2
Thank you, it worked for me, but only on the first start.
If I restart the jail I get an error :
"Unable to connect to ZM db using dsn mysql:host=localhost;dbname=zm
SQLSTATE[HY000] [2002] No such file or directory"

on the shell, if i start manually the service, I have this detail
DBI connect('database=zm;host=localhost','dbadmin',...) failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) at /usr/local/lib/perl5/site_perl/ZoneMinder/Database.pm line 110.
DBI connect('database=zm;host=localhost','dbadmin',...) failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) at /usr/local/lib/perl5/site_perl/ZoneMinder/Database.pm line 110.
04/02/23 16:59:25.002095 zmpkg[24306].ERR [ZoneMinder::Database:114] [Error reconnecting to db: errstr:Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) error val:]
04/02/23 16:59:25.002273 zmpkg[24306].ERR [ZoneMinder::Database:114] [Error reconnecting to db: errstr:Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) error val:]
DBI connect('database=zm;host=localhost','dbadmin',...) failed: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) at /usr/local/lib/perl5/site_perl/ZoneMinder/Database.pm line 110.
04/02/23 16:59:25.002431 zmpkg[24306].ERR [ZoneMinder::Database:114] [Error reconnecting to db: errstr:Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) error val:]
Unable to connect to DB. ZM Cannot continue.

Any idea to solve the problem ?

I had this issue too, it removed the old version of MySql server and installed a new one when we installed the zoneminder, but new version of MySql has issue to start.

I have given up using this software and started to use Agent DVR (https://www.ispyconnect.com/download.aspx) and it's very easy to install on my ubuntu server.
 

steliosmarko

Cadet
Joined
Jun 12, 2023
Messages
1
For whom is still interested...

fitzgerald99's steps above are accurate with one addition, after step 3, you should also run:

pkg install mysql80-server [mysql v. 8 as of this writing]

if you notice the prompts, when you run pkg install zoneminder, it removes the mysql57 client AND server and only installs the new client and perl5 DBD. Just install the server back and follow the rest of the steps for the configuration as above.
Also, don't forget to run,

service mysql-server enable (to start the db after reboots)

You may need to edit your /var/db/mysql/my.cnf and comment out or remove references to query_cache-{type,size} and also, sql_mode (altogether or attributes). [/var/db/mysql/zoneminder.err is your friend!]

With those actions, you should be able to start mysql and zoneminder.

Good luck, and cheers.
 

victort

Guru
Joined
Dec 31, 2021
Messages
952
To whom it may concern…

 
Top