linuxserver / docker-zoneminder

10 stars 11 forks source link

API not working and error in apache_error.log #11

Closed nic0dk closed 5 years ago

nic0dk commented 6 years ago

linuxserver.io

having problem access the API and getting a cakephp error - aswell i see som weird errors on the logs. the web gui is working fine, aswell the recording

lastest docker image from here, on ubuntu 17.10 docker-compose build --no-cache with the docker-compose file below ``` version: '3' services: zoneminder: build: . container_name: zoneminder_ioserver restart: always ports: - 8000:80 environment: - PGID=1001 - PUID=1001 volumes: - /etc/localtime:/etc/localtime:ro - /home/nico/docker/zoneminder_docker/config:/config - /mnt/qnap/CCTV:/data shm_size: 4096M ```

screenshot of the API interface API cakePHP error

/docker/zoneminder_docker/config/log/zoneminder$ tail cake_error.log

#3 [internal function]: App::shutdown()
#4 {main}
2018-05-08 21:55:50 Error: Fatal Error (64): require_once() [<a href='http://php.net/function.require'>function.require</a>]: Failed opening required '../../../includes/config.php' (include_path='.:/usr/share/php') in [/usr/share/webapps/zoneminder/htdocs/api/app/Config/bootstrap.php, line 123]
2018-05-08 21:55:50 Error: [FatalErrorException] require_once() [<a href='http://php.net/function.require'>function.require</a>]: Failed opening required '../../../includes/config.php' (include_path='.:/usr/share/php')
Stack Trace:
#0 /usr/share/webapps/zoneminder/htdocs/api/lib/Cake/Error/ErrorHandler.php(212): ErrorHandler::handleFatalError(64, 'require_once() ...', '/usr/share/weba...', 123)
#1 /usr/share/webapps/zoneminder/htdocs/api/lib/Cake/Core/App.php(970): ErrorHandler::handleError(64, 'require_once() ...', '/usr/share/weba...', 123, Array)
#2 /usr/share/webapps/zoneminder/htdocs/api/lib/Cake/Core/App.php(943): App::_checkFatalError()
#3 [internal function]: App::shutdown()
#4 {main}

and from apache log

nico@hassio:~/docker/zoneminder_docker/config/log/zoneminder$ tail apache-error.log
[Tue May 08 22:15:33.945503 2018] [:error] [pid 334] [client 192.168.1.107:19268] PHP Warning:  symlink(): No such file or directory in /usr/share/webapps/zoneminder/htdocs/includes/functions.php on line 2056, referer: http://192.168.1.4:8000/index.php
[Tue May 08 22:16:35.051456 2018] [:error] [pid 329] [client 192.168.1.107:19278] PHP Warning:  symlink(): No such file or directory in /usr/share/webapps/zoneminder/htdocs/includes/functions.php on line 2056, referer: http://192.168.1.4:8000/index.php
[Tue May 08 22:16:35.052811 2018] [:error] [pid 329] [client 192.168.1.107:19278] PHP Warning:  symlink(): No such file or directory in /usr/share/webapps/zoneminder/htdocs/includes/functions.php on line 2056, referer: http://192.168.1.4:8000/index.php
[Tue May 08 22:16:35.053941 2018] [:error] [pid 329] [client 192.168.1.107:19278] PHP Warning:  symlink(): No such file or directory in /usr/share/webapps/zoneminder/htdocs/includes/functions.php on line 2056, referer: http://192.168.1.4:8000/index.php
[Tue May 08 22:16:35.055028 2018] [:error] [pid 329] [client 192.168.1.107:19278] PHP Warning:  symlink(): No such file or directory in /usr/share/webapps/zoneminder/htdocs/includes/functions.php on line 2056, referer: http://192.168.1.4:8000/index.php
[Tue May 08 22:16:35.056135 2018] [:error] [pid 329] [client 192.168.1.107:19278] PHP Warning:  symlink(): No such file or directory in /usr/share/webapps/zoneminder/htdocs/includes/functions.php on line 2056, referer: http://192.168.1.4:8000/index.php
[Tue May 08 22:16:35.057190 2018] [:error] [pid 329] [client 192.168.1.107:19278] PHP Warning:  symlink(): No such file or directory in /usr/share/webapps/zoneminder/htdocs/includes/functions.php on line 2056, referer: http://192.168.1.4:8000/index.php
[Tue May 08 22:16:35.058289 2018] [:error] [pid 329] [client 192.168.1.107:19278] PHP Warning:  symlink(): No such file or directory in /usr/share/webapps/zoneminder/htdocs/includes/functions.php on line 2056, referer: http://192.168.1.4:8000/index.php
[Tue May 08 22:16:35.059846 2018] [:error] [pid 329] [client 192.168.1.107:19278] PHP Warning:  symlink(): No such file or directory in /usr/share/webapps/zoneminder/htdocs/includes/functions.php on line 2056, referer: http://192.168.1.4:8000/index.php
[Tue May 08 22:16:35.060969 2018] [:error] [pid 329] [client 192.168.1.107:19278] PHP Warning:  symlink(): No such file or directory in /usr/share/webapps/zoneminder/htdocs/includes/functions.php on line 2056, referer: http://192.168.1.4:8000/index.php
im using nfs mount from the host OS to a NAS no symlinks used

first time creating a bug report, if you need more info, please let me know

Thanks, team linuxserver.io

nic0dk commented 6 years ago

could it be that we need path for cakephp correct?

from Dockerfile

 cmake \
        -DCMAKE_INSTALL_PREFIX=/usr \
        -DZM_CGIDIR=/usr/share/webapps/zoneminder/cgi-bin \
        -DZM_CONFIG_DIR=/etc/zm \
        -DZM_CONFIG_SUBDIR=/etc/zm/conf.d \
        -DZM_DIR_EVENTS=/data/zoneminder/events \
        -DZM_DIR_IMAGES=/data/zoneminder/images \
        -DZM_DIR_SOUNDS=/data/zoneminder/sounds \
        -DZM_LOGDIR=/config/log/zoneminder \
        -DZM_PATH_ARP=/usr/sbin/arp \
        -DZM_RUNDIR=/var/run/zoneminder \
        -DZM_SOCKDIR=/var/run/zoneminder \
        -DZM_WEBDIR=/usr/share/webapps/zoneminder/htdocs \
        -DZM_WEB_GROUP=abc \
        -DZM_WEB_USER=abc \

find on config.php

root@a4327eac3d87:/# find / | grep config.php
/usr/share/webapps/zoneminder/htdocs/skins/classic/includes/config.php
/usr/share/webapps/zoneminder/htdocs/includes/config.php
/usr/share/webapps/zoneminder/htdocs/api/lib/Cake/Test/test_app/Plugin/TestPlugin/Config/custom_config.php
/usr/share/webapps/zoneminder/htdocs/api/lib/Cake/Config/config.php

error from the api interface:

Fatal Error
Error: require_once() [<a href='http://php.net/function.require'>function.require</a>]: Failed opening required '../../../includes/config.php' (include_path='.:/usr/share/php')    
File: /usr/share/webapps/zoneminder/htdocs/api/app/Config/bootstrap.php 
Line: 123
nic0dk commented 6 years ago

besides, something goes wrong with permission on mysql after deploy, i need to recreate them after the container is running: mysql -uroot -e "grant all on zm.* to 'zmuser'@localhost identified by 'zmpass';"

tobbenb commented 6 years ago

This container isn't released yet and I'm not sure it will be either.

nic0dk commented 6 years ago

@tobbenb thx for the reply. Hmm I build the currently ZM from this container? What did I wrong ?

tobbenb commented 6 years ago

I don't know. I haven't made this container, so can't help.

thelamer commented 5 years ago

We are planning on changing massive amounts of logic for this to go live, your help with testing would be appreciated:

https://github.com/linuxserver/docker-zoneminder/pull/21