Javascript issues after update to 1.36.16 possibly?

Discussions related to the 1.36.x series of ZoneMinder
misterpat
Posts: 15
Joined: Tue Jan 22, 2019 9:54 pm

Javascript issues after update to 1.36.16 possibly?

Post by misterpat »

Upon updating to 1.36.16 on 2 different installations, we are no longer able to login. By deleting the ? after the /, the console would load. Once on the console, streaming loads an image and not the video. Changing the video size doesn't work either. On the console, all the selection boxes are open.

I've deleted all cookies and used different browsers, no luck.

Everything was working great on 1.36.15

Thanks for any ideas with this.

Logging in and it hangs here till i remove the ?
zm2.jpg
zm2.jpg (17.1 KiB) Viewed 4908 times
Group, Function Storage and Monitor selections all stuck open.
zm1.jpg
zm1.jpg (36.94 KiB) Viewed 4908 times
Edit: Debian 11 installed from zmrepo.
User avatar
iconnor
Posts: 2900
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Javascript issues after update to 1.36.16 possibly?

Post by iconnor »

Entirely possible. Update to 1.36.17.
misterpat
Posts: 15
Joined: Tue Jan 22, 2019 9:54 pm

Re: Javascript issues after update to 1.36.16 possibly?

Post by misterpat »

iconnor wrote: Fri Jun 03, 2022 1:48 pm Entirely possible. Update to 1.36.17.
That was my first thought before posting. Upgraded both installations to 1.36.17 and the issue remains. In the bottom picture I posted, it says 1.36.17.
User avatar
iconnor
Posts: 2900
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Javascript issues after update to 1.36.16 possibly?

Post by iconnor »

Okay, well it's definitely a javascript issue. Why don't you right click-> inspect element, click on console and tell us what the error is?
misterpat
Posts: 15
Joined: Tue Jan 22, 2019 9:54 pm

Re: Javascript issues after update to 1.36.16 possibly?

Post by misterpat »

iconnor wrote: Fri Jun 03, 2022 4:41 pm Okay, well it's definitely a javascript issue. Why don't you right click-> inspect element, click on console and tell us what the error is?
Here ya go!

Thanks for taking a look at this!
zm3.jpg
zm3.jpg (35.54 KiB) Viewed 4853 times
User avatar
iconnor
Posts: 2900
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Javascript issues after update to 1.36.16 possibly?

Post by iconnor »

Ok now going to need you to right click, view page source and tell us what is on or around line 624. There should be some obvious errors there.
misterpat
Posts: 15
Joined: Tue Jan 22, 2019 9:54 pm

Re: Javascript issues after update to 1.36.16 possibly?

Post by misterpat »

iconnor wrote: Fri Jun 03, 2022 6:54 pm Ok now going to need you to right click, view page source and tell us what is on or around line 624. There should be some obvious errors there.
Not sure this is correct, but here is the page source from 613-660. This is logged in on /?view=console

Code: Select all

var stateStrings = new Array();
stateStrings[STATE_UNKNOWN] = "Unknown";
stateStrings[STATE_IDLE] = "Idle";
stateStrings[STATE_PREALARM] = "Prealarm";
stateStrings[STATE_ALARM] = "Alarm";
stateStrings[STATE_ALERT] = "Alert";
stateStrings[STATE_TAPE] = "Record";

const ZM_ADD_JPEG_COMMENTS = '0';
const ZM_AUDIT_CHECK_INTERVAL = '900';
const ZM_AUDIT_MIN_AGE = '86400';
const ZM_AUTH_HASH_IPS = '1';
const ZM_AUTH_HASH_LOGINS = '0';
const ZM_AUTH_HASH_SECRET = '********';
const ZM_AUTH_HASH_TTL = '2';
const ZM_AUTH_RELAY = 'hashed';
const ZM_AUTH_TYPE = 'builtin';
const ZM_BANDWIDTH_DEFAULT = 'high';
const ZM_BULK_FRAME_INTERVAL = '100';
const ZM_CAPTURES_PER_FRAME = '1';
const ZM_CHECK_FOR_UPDATES = '0';
const ZM_COLOUR_JPEG_FILES = '0';
const ZM_COOKIE_LIFETIME = '3600';
const ZM_CPU_EXTENSIONS = '1';
const ZM_CSP_REPORT_URI = '';
const ZM_CSS_DEFAULT = 'dark';
const ZM_DEFAULT_ASPECT_RATIO = '4:3';
const ZM_DUMP_CORES = '0';
const ZM_DYN_CURR_VERSION = '1.36.17';
const ZM_DYN_DB_VERSION = '1.36.17';
const ZM_DYN_DONATE_REMINDER_TIME = '1628158802';
const ZM_DYN_LAST_CHECK = '1636218053';
const ZM_DYN_LAST_VERSION = '1.34.26';
const ZM_DYN_NEXT_REMINDER = '1625562638';
const ZM_DYN_SHOW_DONATE_REMINDER = '0';
const ZM_EMAIL_HOST = 'localhost';
const ZM_ENABLE_CSRF_MAGIC = '1';
const ZM_EVENT_CLOSE_MODE = 'idle';
const ZM_EVENT_IMAGE_DIGITS = '5';
const ZM_FAST_IMAGE_BLENDS = '1';
const ZM_FEATURES_SNAPSHOTS = '0';
const ZM_FFMPEG_FORMATS = 'mpg mpeg wmv asf avi* mov swf 3gp**';
const ZM_FFMPEG_INPUT_OPTIONS = '';
const ZM_FFMPEG_OPEN_TIMEOUT = '10';
const ZM_FFMPEG_OUTPUT_OPTIONS = '-r 25';
const ZM_FILTER_EXECUTE_INTERVAL = '60';
const ZM_FILTER_RELOAD_DELAY = '300';
const ZM_FONT_FILE_LOCATION = '/usr/share/zoneminder/fonts/default.zmfnt';
sitruc
Posts: 4
Joined: Sun Jun 05, 2022 1:29 am

Re: Javascript issues after update to 1.36.16 possibly?

Post by sitruc »

I had the same problem. The jav script syntax error was due to my hash secret (options-system-AUTH_HASH_SECRET) which has some specil chracters in it. It was working fine before. I change the AUTH_HASH_SECRET to simple text, saved and it now seems to work!
User avatar
iconnor
Posts: 2900
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Javascript issues after update to 1.36.16 possibly?

Post by iconnor »

That's interesting. The HASH_SECRET is supposed to be marked private, and hence NOT included in the javascript config.

Please try
sudo zmupdate.pl -f

and if it persists, mysql -u zmuser -p zm
select Private from Config where Name='ZM_AUTH_HASH_SECRET';

Is it a 1 or a zero? (or true or false). If false, then we need to look further. the zmupdate.pl -f should have replaced the entire config, writing a new entry with Private=true for that entry (and others).

Isaac
User avatar
iconnor
Posts: 2900
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Javascript issues after update to 1.36.16 possibly?

Post by iconnor »

Uh oh. The Private field is only in master. I'll be releasing 1.36.18 in a few minutes to address this.
sitruc
Posts: 4
Joined: Sun Jun 05, 2022 1:29 am

Re: Javascript issues after update to 1.36.16 possibly?

Post by sitruc »

Thanks, this drove me crazy at first as I had no idea what the problem was. I reinstalled everything, but it persisted until I changed my hash string. i hope others don't fall into the same trap.
misterpat
Posts: 15
Joined: Tue Jan 22, 2019 9:54 pm

Re: Javascript issues after update to 1.36.16 possibly?

Post by misterpat »

Upon updating to 1.36-18 I now have a 500 error.

Apache error log

Code: Select all

PHP Fatal error:  Uncaught PDOException: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'Private' in 'field list' in /usr/share/zoneminder/www/includes/config.php:167\nStack trace:\n#0 /usr/share/zoneminder/www/includes/config.php(167): PDO->query()\n#1 /usr/share/zoneminder/www/includes/config.php(141): loadConfig()\n#2 /usr/share/zoneminder/www/index.php(46): require_once('/usr/share/zone...')\n#3 {main}\n  thrown in /usr/share/zoneminder/www/includes/config.php on line 167, referer: http://zoneminder/zm/?view=console

Code: Select all

root@zoneminder:~# zmupdate.pl -f

Freshening configuration in database
Migratings passwords, if any...
Loading config from DB 221 entries
Saving config to DB 221 entries
DBD::mysql::st execute failed: Unknown column 'Private' in 'field list' at /usr/share/perl5/ZoneMinder/Config.pm line 244.
Can't execute when updating config entry ZM_SKIN_DEFAULT: Unknown column 'Private' in 'field list' at /usr/bin/zmupdate.pl line 333.
Am I missing a step?
User avatar
iconnor
Posts: 2900
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Javascript issues after update to 1.36.16 possibly?

Post by iconnor »

if on a debian based system, the update to .18 should have automatically run zmupdate.pl (without the -f). However if that has not occurred, the run it manually.

sudo zmupdate.pl
sudo zmupdate.pl -f
misterpat
Posts: 15
Joined: Tue Jan 22, 2019 9:54 pm

Re: Javascript issues after update to 1.36.16 possibly?

Post by misterpat »

That worked without the -f

Still no good on a desktop. Chrome on Linux mint.

Thanks for the help!

Edit: Still hangs up on login.
misterpat
Posts: 15
Joined: Tue Jan 22, 2019 9:54 pm

Re: Javascript issues after update to 1.36.16 possibly?

Post by misterpat »

Just a follow up,

Still not working on 1.36.18. Same problems as before.

Any other things to try?
Post Reply