web_php and web_js errors - ex. socket_sendto etc. [SOLVED]

Discussions related to the 1.36.x series of ZoneMinder
Post Reply
jeremyb
Posts: 18
Joined: Mon May 29, 2023 10:28 pm

web_php and web_js errors - ex. socket_sendto etc. [SOLVED]

Post by jeremyb »

Hello,

Getting Errors:

5/30/23, 4:07:37 AM UTC web_php 1361 ERR No data to read from socket /usr/share/zoneminder/www/includes/functions.php 1882
5/30/23, 4:07:37 AM UTC web_php 1361 ERR Timed out waiting for msg /run/zm/zms-841428s.sock /usr/share/zoneminder/www/ajax/stream.php 114
5/30/23, 4:07:32 AM UTC web_php 755 ERR socket_sendto( /run/zm/zms-050126s.sock ) failed: Connection refused /usr/share/zoneminder/www/includes/functions.php 1882
5/30/23, 4:07:27 AM UTC web_php 1361 ERR socket_sendto( /run/zm/zms-020058s.sock ) failed: Connection refused /usr/share/zoneminder/www/includes/functions.php 1882


Everything seems to be working except this. Usually shows when looking through playbacks or moving around in the webGUI. I've searched the forums and other places. Most recent solution said to setup SSL. Is this really the solution? Other solutions seem to have already been resolved and not my case, or the solution is no longer an option.

I'm thinking this has to do with me needing to make an additional change or added setting to the monitor configs.

Here is my setup (everything is default unless specified):

SERVER:
This is a fresh install with the following configuration:
- Latest Proxmox VE on Dell R710 (24 x Intel(R) Xeon(R) CPU X5670 @ 2.93GHz (2 Sockets)) w/ H700 HW RAID - RAID1 (2) SSD & RAID1 (2) HDD
- Container: 8 Cores, 32GiB Ram, 4GiB Swap, 500GiB Disk on 1TB SSD RAID1 - Unprivileged and Nesting - Running Debian 11
- Latest Zoneminder v1.36.33 from ZM repo
- (3) UVC 720p and (1) UVC G3 1080p Ubiquiti (Firmware v4.23.8.) Cam streams from Unifi Video RTSP Service (Controller v 3.10.13)

CLIENT:
- OS: Latest Windows 10
- Browsers: Latest Firefox

NETWORK:
- Gigabit Ethernet
- Client to Switch to Server


SETUP TO ZM AFTER INSTALL:

##Basic initial setting changes on GUI
Options -> System -> LANG_DEFAULT = en_us
Options -> System -> TIMEZONE = UTC
Options -> System -> TELEMETRY_DATA = "uncheck"
Options -> Logging -> LOG_LEVEL-DATABASE = Warning


##Add Cameras on GUI
Console -> ADD -> ...
General:
Name = Office
Source:
Source Path = rtsp://10.0.0.21:7447/645410d8e4b0db099c349744_0
Capture Resolution = 720p
Storage:
Video Writer = Camera Passthrough

Console -> ADD -> ...
General:
Name = Dining Room and Kitchen
Source:
Source Path = rtsp://10.0.0.21:7447/645410d8e4b0db099c349745_0
Capture Resolution = 720p
Storage:
Video Writer = Camera Passthrough

Console -> ADD -> ...
General:
Name = Back Door
Source:
Source Path = rtsp://10.0.0.21:7447/645410d8e4b0db099c349743_0
Capture Resolution = 720p
Storage:
Video Writer = Camera Passthrough

Console -> ADD -> ...
General:
Name = Tower - Lower
Source:
Source Path = rtsp://10.0.0.21:7447/645410d8e4b0db099c349740_0
Capture Resolution = 1080p
Storage:
Video Writer = Camera Passthrough



*** You may not need further information, but here it is if you do ***


INSTALL SETUP:

Install procedure:

####Debian 11
####PVE Container

##Initial Container Setup

##root login with console

#Update/Upgrade
apt update
apt upgrade

#Install sudo
apt install sudo

#Add sudo user
adduser jeremy
usermod -aG sudo jeremy

#Set timezone
timedatectl set-timezone UTC
timedatectl show

#reboot
reboot

#*Take snapshot*

##Install Zoneminder + LAMP / wiki method - (official failed) (https://wiki.zoneminder.com/Debian_11_B ... der_1.36.x)

#Install LAMP
sudo apt install apache2 php mariadb-server php-mysql libapache2-mod-php

#Secure MySQL or Mariadb, create root password et. al.
sudo mysql_secure_installation

current PW: enter for none
socket auth: Y
Change Root PW: Y (enter your new root mysql Password)
Remove anon: Y
Remove Remote: Y
Remove test: Y
Reload Priv: Y


#Mariadb additional settings The default values for the database are adequate for initial setup. However, I recommend you make these changes before installing Zoneminder. Note: If you have sufficient memory double the values below. Edit the Mariadb config file:
sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf

Add the following in the [mysql] area:

innodb_file_per_table = ON
innodb_buffer_pool_size = 256M
innodb_log_file_size = 32M

*Note: it's mysqld area, not mysql

#Reatart Mariadb:
sudo service mysql restart

#Create install script
nano zm-install

#!/bin/sh
clear
read -p "This script installs ZoneMinder 1.36.x on Debian 11 with LAMP (MySQL or Mariadb) installed...
This script must be run as root!
Press Enter to continue or Ctrl + c to quit" nothing
clear
apt install -y lsb-release gnupg2
echo "deb https://zmrepo.zoneminder.com/debian/release-1.36 "`lsb_release -c -s`"/" | sudo tee /etc/apt/sources.list.d/zoneminder.list
wget -O - https://zmrepo.zoneminder.com/debian/ar ... eyring.gpg | sudo apt-key add -
read -p "Warning! Check above to insure the line says OK. If not the GPG signing key was not installed and you will need to figure out why before continuing.
Press enter to continue" nothing
apt update
clear
apt install -y zoneminder
systemctl enable zoneminder
service zoneminder start
adduser www-data video
a2enconf zoneminder
a2enmod rewrite
a2enmod headers
a2enmod expires
service apache2 reload
clear
read -p "Install complete. Open Zoneminder/Options and set the timezone. Press enter to continue" nothing
clear

#change permissions
chmod 755 zm-install

#execute
sudo ./zm-install
Last edited by jeremyb on Thu Jun 01, 2023 1:56 am, edited 1 time in total.
jeremyb
Posts: 18
Joined: Mon May 29, 2023 10:28 pm

Re: socket_sendto Error

Post by jeremyb »

Okay,

AI and I figured things out. ha

I've learned web_php and web_js errors are on the client side. After rolling back zm server on a snapshot to before I added the monitors, I noticed I was getting these errors and more that had to do with things that weren't even setup. My browser was trying to tell ZM to do things in the background. I cleared cache in edge, firefox and chrome. This fixed the errors but Edge kept throwing web_js errors and Firefox kept throwing web_php errors. Chrome isn't throwing any errors. The way zm webgui looks is different now on all three browsers. I'm thinking a prior version of ZM cached and wouldn't clear. AI and searches showed people checking and changing settings with mixed results. I understand why there are mixed results as many of the suggestions could clear some or most of the bad cache but not a proper correction. Hope the edge and firefox browsers will eventually be more compatible or I'll end up investigating more at a later time if it's on my end.


*Notes:

Errors on Edge Browser:
6/1/23, 12:53:52 AM UTC web_js 256 ERR Uncaught RangeError: Maximum call stack size exceeded zm/skins/classic/js/video.js 460
6/1/23, 12:53:05 AM UTC web_js 258 ERR Uncaught RangeError: Maximum call stack size exceeded zm/skins/classic/js/video.js 992
6/1/23, 12:52:53 AM UTC web_js 1279 ERR Uncaught RangeError: Maximum call stack size exceeded zm/skins/classic/js/video.js 460

Errors on Firefox Browser:
5/30/23, 10:57:18 PM UTC web_php 228 ERR socket_sendto( /run/zm/zms-907692s.sock ) failed: Connection refused /usr/share/zoneminder/www/includes/functions.php

AI response about my issues:

According to a post on the ZoneMinder Forums, if your backend is working and you get socket_sendto errors, that almost always means you have an Apache configuration issue, most likely a problem with your ScriptAlias. The ScriptAlias has to agree with what is in PATH_ZMS under options1.
- ScriptAlias is correct (Was an issue users had in the past)

According to a post on the ZoneMinder Forums, one user found that removing SWF from the MPEG_LIVE_FORMAT section in the images tab fixed the issue for them1.
- I'm thinking this might have worked as they are forcing old cache to not be used by calling a different process, but not proper and can cause other issues.

Another user on the ZoneMinder Forums mentioned that the socket files that end with a ‘s’ or a ‘w’ are to do with streaming. They are created by the call to cgi program zms or nph-zms. The error you are seeing comes from stream.php where it checks for existence of the socket files before continuing to process the stream2.
- I got chrome working and never looked into this.

A search suggested setting up auth and another setting up ssl. Once again, I shouldn't need to do this to correct these errors. I understand these may work but all you are doing is making a change to a server to have the client pull fresh data because it's coming from a difference source. The Auth one only partially worked for me and I was about to setup SSL before I had a realization. Just clear the cache client side!


Hope this helps someone.
User avatar
iconnor
Posts: 2860
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: web_php and web_js errors - ex. socket_sendto etc. [SOLVED]

Post by iconnor »

Fairly good responses from AI.

The socket js errors can happen as long as streaming is generally working I wouldn't worry about them. They should be very few and far between though. If you get them a lot then we should dig in.

Mostly I want to entirely replace how to stream video so I'm not sure how worth it it is to spend more time on it.
jeremyb
Posts: 18
Joined: Mon May 29, 2023 10:28 pm

Re: web_php and web_js errors - ex. socket_sendto etc. [SOLVED]

Post by jeremyb »

Understood.

I'm getting familiar with everything ZM to prime myself for helping with development later. I'm making a list for myself as i grind through everything.

I was thinking about creating a patch for myself to change the web errors to a different category and option to change the color. Light green or light grey will work for me. I'm always curious when I see orange or red colors. haha

I'll send everything I do to github later to be evaluated.
User avatar
iconnor
Posts: 2860
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: web_php and web_js errors - ex. socket_sendto etc. [SOLVED]

Post by iconnor »

Awesome, welcome aboard!

Yeah we could definitely demote the error level.
Post Reply