Force Alarm inside monitor page and fps count , 1.32.1 was working, 1.32.2 not working - BUG - when on virualhost

Forum for questions and support relating to the 1.32.x releases only.
Post Reply
mistral77
Posts: 17
Joined: Fri Jul 06, 2018 11:51 am

Force Alarm inside monitor page and fps count , 1.32.1 was working, 1.32.2 not working - BUG - when on virualhost

Post by mistral77 »

Hello

Force Alarm inside monitor page and fps count , not working again with 1.32.2 !
It was fixed on 1.32.1 !

Ubuntu 16.04

Force Alarm does not do anything, and fps just displaying "- fps"!

Thank u!
Last edited by mistral77 on Tue Oct 16, 2018 7:24 pm, edited 1 time in total.
mistral77
Posts: 17
Joined: Fri Jul 06, 2018 11:51 am

Re: Force Alarm inside monitor page and fps count , 1.32.1 was working, 1.32.2 not working

Post by mistral77 »

Well,
I have checked on a second test installation, and the issue is not exists !

Is it something that i can check ,to solve the issue , on my main installation?

Thank u?
mistral77
Posts: 17
Joined: Fri Jul 06, 2018 11:51 am

Re: Force Alarm inside monitor page and fps count , 1.32.1 was working, 1.32.2 not working

Post by mistral77 »

In Chrome's developer tools i am seeing the following error that not exists on second istallation!

"Failed to load http://homeserver/zm/index.php/zm/index ... command=99: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://homeserver:8085' is therefore not allowed access."


Is this related ?

Thanks
Nocifer
Posts: 37
Joined: Mon Oct 01, 2018 4:05 pm

Re: Force Alarm inside monitor page and fps count , 1.32.1 was working, 1.32.2 not working

Post by Nocifer »

Hmm, I've also been seeing lots of mostly 405 errors to the erroneous URL "http://localhost/index.php/index.php" in the Monitor view and the Zone view, and I also have the same problem with Force Alarm not working.

I've so far managed to track this URL as being erroneously created by Ajax objects with the property "url: monitorUrl+thisUrl". In the browser console, typing console.log(monitorUrl) and console.log(thisUrl) will give me "http://localhost/index.php" and "index.php", respectively, but the really fun part is that this does not always happen: if I refresh the page repeatedly, some times (like 1 in 20) they will either work correctly (code 200) and keep on working until I refresh the page again, or else console.log(thisUrl) will give me "undefined".

I'd really love to find the reason behind this.
mistral77
Posts: 17
Joined: Fri Jul 06, 2018 11:51 am

Re: Force Alarm inside monitor page and fps count , 1.32.1 was working, 1.32.2 not working

Post by mistral77 »

So,
my problem is because I run the ZM on a virtual host (: 8085) - i always did it, and the problem was created by upgrading to 1.32.0 version, disappeared with 1.32.1, and came back with 1.32.2 ! Is there anything I can set up on Apache or else, or is it a ZM bug that will be solved?

Here is my virtual host file:

Code: Select all

<VirtualHost *:8085>

RedirectMatch permanent ^/$ http://homeserver:8085/zm/

# Remember to enable cgi mod (i.e. "a2enmod cgi").
ScriptAlias /zm/cgi-bin "/usr/lib/zoneminder/cgi-bin"
<Directory "/usr/lib/zoneminder/cgi-bin">
    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
    AllowOverride All
    Require all granted
</Directory>

# Order matters. This alias must come first.
Alias /zm/cache /var/cache/zoneminder/cache
<Directory /var/cache/zoneminder/cache>
    Options -Indexes +FollowSymLinks
    AllowOverride None
    <IfModule mod_authz_core.c>
        # Apache 2.4
        Require all granted
    </IfModule>
    <IfModule !mod_authz_core.c>
        # Apache 2.2
        Order deny,allow
        Allow from all
    </IfModule>
</Directory>

Alias /zm /usr/share/zoneminder/www
<Directory /usr/share/zoneminder/www>
  Options -Indexes +FollowSymLinks
  <IfModule mod_dir.c>
    DirectoryIndex index.php
  </IfModule>
</Directory>

# For better visibility, the following directives have been migrated from the
# default .htaccess files included with the CakePHP project.
# Parameters not set here are inherited from the parent directive above.
<Directory "/usr/share/zoneminder/www/api">
   RewriteEngine on
   RewriteRule ^$ app/webroot/ [L]
   RewriteRule (.*) app/webroot/$1 [L]
   RewriteBase /zm/api
</Directory>

<Directory "/usr/share/zoneminder/www/api/app">
   RewriteEngine on
   RewriteRule ^$ webroot/ [L]
   RewriteRule (.*) webroot/$1 [L]
   RewriteBase /zm/api
</Directory>

<Directory "/usr/share/zoneminder/www/api/app/webroot">
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
    RewriteBase /zm/api
</Directory>

</VirtualHost>
I have also tried to add " Header set Access-Control-Allow-Origin "*" " with no effect!


Thank u!
sphillips
Posts: 12
Joined: Fri Jul 06, 2018 10:21 am

Re: Force Alarm inside monitor page and fps count , 1.32.1 was working, 1.32.2 not working - BUG - when on virualhost

Post by sphillips »

having same problem.... i run zoneminder web on diferent port than 80 and i use a custom virtualhost for it on domain:port/zm get the errors
Browser error

Code: Select all

Failed to load http://domainName/zm/index.php/zm/index.php?view=request&request=stream&connkey=977627&command=99: Response for preflight is invalid (redirect)
I tried removing virtualhost but doesnt seem to work for me, the problem is still there.

if using local address http://192.168.x.x/zm works without problems
sphillips
Posts: 12
Joined: Fri Jul 06, 2018 10:21 am

Re: Force Alarm inside monitor page and fps count , 1.32.1 was working, 1.32.2 not working - BUG - when on virualhost

Post by sphillips »

i think the problem here is not directing to the right port.
@mistral77 browser error is trying to access his domain without port and his virtualhost is on port 8085, same with me my error tries my domain on default 80 port but im actually using another port.

i have no ideia how to go from here thou....
mistral77
Posts: 17
Joined: Fri Jul 06, 2018 11:51 am

Re: Force Alarm inside monitor page and fps count , 1.32.1 was working, 1.32.2 not working - BUG - when on virualhost

Post by mistral77 »

Can any of the developers give us a point to start? What file can we edit to solve the issue ? I believe that it must be a simple solution !
Thanks!
sphillips
Posts: 12
Joined: Fri Jul 06, 2018 10:21 am

Re: Force Alarm inside monitor page and fps count , 1.32.1 was working, 1.32.2 not working - BUG - when on virualhost

Post by sphillips »

apparently the issue is known im pretty sure it applies to this problem at https://github.com/ZoneMinder/zoneminder/issues/2253
Did not try the hack fix yet if anyone happens to try first, let us know.
Nocifer
Posts: 37
Joined: Mon Oct 01, 2018 4:05 pm

Re: Force Alarm inside monitor page and fps count , 1.32.1 was working, 1.32.2 not working - BUG - when on virualhost

Post by Nocifer »

@sphillips

Well, I'm the one who opened that issue you linked, so I can confirm it's a perfectly working solution... but for a different issue. This one here is something else - it has to do with internal variables having the wrong value, which unfortunately is not something that can be fixed by creating a hacky softlink.

@mistral77

I've already given us a point to start (though I'm not a developer of ZM) in my previous post:
I've so far managed to track this URL as being erroneously created by Ajax objects with the property "url: monitorUrl+thisUrl". In the browser console, typing console.log(monitorUrl) and console.log(thisUrl) will give me "http://localhost/index.php" and "index.php", respectively, but the really fun part is that this does not always happen: if I refresh the page repeatedly, some times (like 1 in 20) they will either work correctly (code 200) and keep on working until I refresh the page again, or else console.log(thisUrl) will give me "undefined".
The Ajax calls that use these variables and produce the errors are in skins/classic/views/js/watch.js and skins/classic/views/js/zone.js, but where these variables are actually defined and where they get their false values from, I have yet to find due to lack of time to properly debug the issue.
sphillips
Posts: 12
Joined: Fri Jul 06, 2018 10:21 am

Re: Force Alarm inside monitor page and fps count , 1.32.1 was working, 1.32.2 not working - BUG - when on virualhost

Post by sphillips »

@Nocifer just wanted to say thanks for taking the time and explaining stuff with @mistral77 github issue opened developers (@connortechnology) took the time to fix the issue.
Nocifer
Posts: 37
Joined: Mon Oct 01, 2018 4:05 pm

Re: Force Alarm inside monitor page and fps count , 1.32.1 was working, 1.32.2 not working - BUG - when on virualhost

Post by Nocifer »

@sphillips

Thanks, but it's really iconnor that should be thanked, all I did was observe the same issue you and mistral77 also observed, while they're the one who actually found out what's wrong and fixed it :)
User avatar
iconnor
Posts: 2900
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Force Alarm inside monitor page and fps count , 1.32.1 was working, 1.32.2 not working - BUG - when on virualhost

Post by iconnor »

Hey guys it's a team effort. Thanks to all for clear communication, hand holding and being there when I'm not so that I can concentrate on the fix.

Nocifer glad to have you on board.

1.32 has been a bit rough, but had to happen so that we can move forward.
Post Reply