Error in Montage Review

Current Development version likely to have breaking changes
Post Reply
flaviohenriquew
Posts: 1
Joined: Sun Apr 21, 2024 8:45 pm

Error in Montage Review

Post by flaviohenriquew »

Hello!!!
I recently installed the latest version of zoneminder via ppa using master.

Code: Select all

sudo add-apt-repository ppa:iconnor/zoneminder-master
sudo apt update
I'm having a problem with Montage Review. When installing zoneminder, I changed Apache to port 8084. I can enter the system but in montage review when viewing past videos it shows "No event". When opening the console I came across the following error:

Code: Select all

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://ip/zm/api/frames/index/EventId:156/EventId:157/EventId:158/EventId:159/EventId:160/EventId:161.json?auth=f779bd0dd21bab269fbc88668f858a6a (reason: CORS request failed). Status code: (null).

There was an error js_logger-base-1713361024.js:91:11
    Error http://ip:8084/zm/cache/js_logger-base-1713361024.js:91
    error http://ip:8084/zm/cache/skins_classic_views_js_montagereview-base-1713361024.js:1213
    jQuery 4
Uncaught (in promise) undefined skins_classic_views_js_montagereview-base-1713361024.js:1213:19
    error http://ip:8084/zm/cache/skins_classic_views_js_montagereview-base-1713361024.js:1213
    jQuery 4

 undefined skins_classic_views_js_montagereview-base-1713361024.js:220:15
Apparently an error in the event route that is trying to access the address with port 80 instead of 8084. In the API tab under Options it is enabled
In the log tab:

Code: Select all

4/21/24, 6:06:04 PM GMT-3	web_js	344865	ERR	There was an error - error()	?view=montagereview&filtering=&MonitorName=&Source=&filter%5BQuery%5D%5Bterms%5D%5B0%5D%5Battr%5D=Archived&filter%5BQuery%5D%5Bterms%5D%5B0%5D%5Bop%5D=%3D&filter%5BQuery%5D%5Bterms%5D%5B0%5D%5Bval%5D=&filter%5BQuery%5D%5Bterms%5D%5B1%5D%5Bcnj%5D=and&filte	-
4/21/24, 6:03:00 PM GMT-3	web_js	339385	ERR	There was an error - error()	?view=montagereview	
In Apache it was configured this way
/etc/apache2/conf-available/zoneminder.conf

Code: Select all

<VirtualHost *:8084>
    # Configurações do ZoneMinder
    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>

    # Alias e diretório para o cache do ZoneMinder
    Alias /zm/cache /var/cache/zoneminder/cache
    <Directory /var/cache/zoneminder/cache>
        Options -Indexes +FollowSymLinks
        AllowOverride None
        <IfModule mod_authz_core.c>
            Require all granted
        </IfModule>
    </Directory>

    # Alias e diretório para o diretório principal do ZoneMinder
    Alias /zm /usr/share/zoneminder/www
    <Directory /usr/share/zoneminder/www>
        Options -Indexes +FollowSymLinks
        <IfModule mod_dir.c>
            DirectoryIndex index.php
        </IfModule>
    </Directory>

    # Configurações adicionais para API do ZoneMinder
    <Directory "/usr/share/zoneminder/www/api">
        AllowOverride All
        Options -Indexes +FollowSymLinks
        RewriteEngine on
        RewriteRule ^$ app/webroot/ [L]
        RewriteRule (.*) app/webroot/$1 [L]
        RewriteBase /zm/api

        # Configurações de CORS
        Header set Access-Control-Allow-Origin "*"
        Header set Access-Control-Allow-Methods "GET, POST, OPTIONS"
        Header set Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept"
    </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>

    <LocationMatch "^/zm/api/.*">
        Header set Access-Control-Allow-Origin "*"
        Header set Access-Control-Allow-Methods "GET, POST, OPTIONS"
        Header set Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept"
    </LocationMatch>

    <LocationMatch "^/zm/api/frames/index/EventId:\d+\.json$">
        Header set Access-Control-Allow-Origin "*"
        Header set Access-Control-Allow-Methods "GET, POST, OPTIONS"
        Header set Access-Control-Allow-Headers "Origin, X-Requested-With, Content-Type, Accept"
    </LocationMatch>
</VirtualHost>
in the file /etc/apache2/ports.conf I added the line at the end of the file: Listen 8084
Post Reply