javascript errors in web interface

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
bluedreams
Posts: 3
Joined: Tue Apr 08, 2025 3:26 pm

javascript errors in web interface

Post by bluedreams »

I recently installed zoneminder 1.36.33 on my debian bookworm server. Everything worked as expected and after a little struggle I got the API working with zmninja. I rarely use the web interface except when I need to make settings changes that cant be done in zmninja. Yesterday I put in a new drive just for zoneminder to record to, but when I went to add the storage device in the web interface I noticed things were not working properly. The page loaded but the css was broken. After a night of troubleshooting from my phone, I finally had a chance to sit down at my computer today. I checked the console in my browser to find that I'm getting tons of javascript errors.

I have attached the exported error log.

I have seen this issue come up in other posts but I'm failing to find a resolution. I have tried running `sudo zmupdate.pl` with no success. I also saw a recent post here that recommended "refreshing cache or disabling extensions" but I am struggling to understand what that means. Can anybody point me in the right direction?
Attachments
console-export-2025-4-8_11-55-52.txt
console logs
(8.11 KiB) Downloaded 119 times
bluedreams
Posts: 3
Joined: Tue Apr 08, 2025 3:26 pm

Re: javascript errors in web interface

Post by bluedreams »

I also tried checking the site in multiple browsers including firefox, chromium, firefox mobile, and brave mobile. All have the same result. I have done multiple system restarts as well. The zoneminder logs themselves were mostly empty and after resolving a couple issues, including a missmatched time zone in my php.ini, nothing has changed the issue. This is when I went to the browser console.
adam.robertson
Posts: 23
Joined: Tue Mar 25, 2025 2:19 pm

Re: javascript errors in web interface

Post by adam.robertson »

There were some things that kept throwing me off when I was setting up ZM on Debian:

1. Permissions ..ZM runs under the user www-data on Debian, so you have to make sure all the places have permissions for www-data
2. Paths ... Sometimes the paths are wrong. In my case it was the path to cache...I think I just made a symlink for cache and it fixed some stuff. There is a file in /etc/zm/ that has some of the paths you can check.

for permissions, try something like (from some of my install notes):

sudo chown -R www-data:www-data /etc/zm

sudo chown -R www-data:www-data /usr/share/zoneminder/www

sudo chown -R www-data:www-data /usr/lib/zoneminder

sudo chown -R www-data:www-data /var/cache/zoneminder


If that is still not working, then try this:

sudo ln -s /var/cache/zoneminder/ /var/cache/zoneminder/cache

...which basically just creates a symlink to the cache folder inside itself in case your path to cache is looking for /var/cache/zoneminder/cache
bluedreams
Posts: 3
Joined: Tue Apr 08, 2025 3:26 pm

Re: javascript errors in web interface

Post by bluedreams »

hi!

so, I kinda knew from reading github issues and previous experience that those folders are no longer supposed to be set to www-data ownership with the exception of cache. I tried anyway as a hail mary and now its broken my database according to systemctl and zoneminder just doesnt start anymore even after reverting ownership back to root. I'm probably going to completely wipe and start over again. Thanks though
adam.robertson
Posts: 23
Joined: Tue Mar 25, 2025 2:19 pm

Re: javascript errors in web interface

Post by adam.robertson »

Sorry that happened. It is working for me.

Having said that, I have run across an odd little thing that may or may not be related to your thing. (I should probably post this on github issues)

On my setup I have /etc/zm/conf.d/db-user.conf that has my database credentials. The contents of that file look like this (but altered here to change my actual user and pw):

Code: Select all

ZM_DB_USER = zm_user
ZM_DB_PASS = Qt*CYBv/NtvtJeL(

During upgrades, before I run the upgrade I have to wrap that password in quotes, or the upgrade fails with errors:

Code: Select all

Setting up zoneminder (1.37.66~20250409.237-bookworm) ...
/var/lib/dpkg/info/zoneminder.postinst: 1: /etc/zm/conf.d/db-user.conf: ZM_DB_USER: not found
/var/lib/dpkg/info/zoneminder.postinst: 2: /etc/zm/conf.d/db-user.conf: Syntax error: "(" unexpected
dpkg: error processing package zoneminder (--configure):
 installed zoneminder package post-installation script subprocess returned error exit status 2

However, if I wrap the password in quotes, like below:

Code: Select all

ZM_DB_USER = zm_user
ZM_DB_PASS = "Qt*CYBv/NtvtJeL("
..then the upgrade will go all the way through with no issues....BUT, then I have to remember to unquote the password after the update/upgrade completes, or Zoneminder will run, but not be able to connect to the cameras or database....simply unquoting the password fixes the issue and everything runs normally until the next time I am upgrading.
Post Reply