Page 2 of 4

Re: 1.30.2 upgrade breaks API access

Posted: Mon Apr 10, 2017 5:21 am
by McFuzz
Any ideas, anyone? :(

Re: 1.30.2 upgrade breaks API access

Posted: Mon Apr 10, 2017 11:14 am
by sagitt
same issue!

i'll wait a solution for ubuntu server 14.04(.5)

Re: 1.30.2 upgrade breaks API access

Posted: Mon Apr 10, 2017 5:48 pm
by clueo8
I too experienced this after upgrading on Ubuntu Server 14.04. I recreated the missing folders based on the apache error log and it worked... Then I decided to search for /tmp/zm on google to see if maybe this was an issue, and I stumbled upon this thread. I'm afraid it will get blown away during the next reboot though; doesn't /tmp get removed regularly?

Re: 1.30.2 upgrade breaks API access

Posted: Tue Apr 11, 2017 10:53 pm
by bbunge
I set up my test server with Ubuntu 14.04-5. Started with ZM 1.26.5 and upgrades to 1.30.2. No API. Started over and installed 1.30.2 on a fresh 14.04-5. Still no API. Tried some tricks I had done earlier with no luck.
Will work on it as time permits but this is a busy week for me. Trout season is in and it is warm enough for bike rides. And the family wants to celebrate an annual event with me.
Stay tuned...

Re: 1.30.2 upgrade breaks API access

Posted: Wed Apr 12, 2017 12:06 pm
by knnniggett
The solution to this is to simply create the folders which cakephp complains are missing. Check your webserver logs.

Turning off cake debug mode (which was done to prevent giving away sensitive information to an attacker) also prevents Cake from creating its own tmp folders. Our friends with the Cake project consider this to be a feature.

To get this fixed permanently, contact your package maintainer. He has to make the necessary changes in the package to create the missing folders during package installation. Older distros that don't use systemd, i.e. Ubuntu 14.04, can't use the instructions I posted earlier.

Re: 1.30.2 upgrade breaks API access

Posted: Thu Apr 13, 2017 8:56 am
by McFuzz
Since the folders do not survive a reboot with 14.04, I created a simple bash script that runs on reboot:

Code: Select all

#!/bin/bash

sleep 20
mkdir /tmp/zm/cache
mkdir /tmp/zm/cache/models
mkdir /tmp/zm/cache/persistent
chown -R www-data:www-data /tmp/zm/cache
Basically the script waits about 20 seconds - enough time for zoneminder to create the zm folder within tmp, then created the missing folders, assigns proper ownership and voila - works like a charm.

Re: 1.30.2 upgrade breaks API access

Posted: Thu Apr 13, 2017 1:02 pm
by bbunge
One better:

In the WIKI instructions for 14.04 I have "sleep 15 added to /etc/init.d/zoneminder

Now add:
mkdir /tmp/zm/cache
mkdir /tmp/zm/cache/models
mkdir /tmp/zm/cache/persistent

after mkdir -p "$TMPDIR" && chown www-data:www-data "$TMPDIR"


nano /etc/init.d/zoneminder

start() {
sleep 15
echo -n "Starting $prog: "
# Wait for mysqld to start. Continue if it takes too long.
count=0
while [ ! -e /var/run/mysqld/mysqld.sock ] && [ $count -lt 60 ]
do
sleep 1
count=$((count+1))
done
export TZ=:/etc/localtime
mkdir -p "$RUNDIR" && chown www-data:www-data "$RUNDIR"
mkdir -p "$TMPDIR" && chown www-data:www-data "$TMPDIR"
mkdir /tmp/zm/cache
mkdir /tmp/zm/cache/models
mkdir /tmp/zm/cache/persistent
chown -R www-data:www-data /tmp/zm/cache
$command start

Ctrl+o Enter to save

CTRL+x to exit

Link to 14.04 WIKI: https://wiki.zoneminder.com/Ubuntu_Serv ... e_easy_way

Re: 1.30.2 upgrade breaks API access

Posted: Fri Apr 14, 2017 6:44 pm
by Andre-nl
Same problem here with API

after upgrade ZM to 1.30.2

ls -lh /usr/lib/tmpfiles.d
total 20K
-rw-r--r-- 1 root root 32 Feb 15 17:29 bind9.conf
-rw-r--r-- 1 root root 30 Mar 28 17:40 samba.conf
-rw-r--r-- 1 root root 31 May 2 2014 sshd.conf
-rw-r--r-- 1 root root 30 Apr 18 2013 xconsole.conf
-rw-r--r-- 1 root root 74 Mar 31 16:41 zoneminder.conf

cat /usr/lib/tmpfiles.d/zoneminder.conf
d /var/run/zm 0755 www-data www-data
d /tmp/zm 0755 www-data www-data

Re: 1.30.2 upgrade breaks API access

Posted: Fri Apr 14, 2017 8:39 pm
by Andre-nl
@bbunge

did you restart the server after the changes ? i did the changes, and stil the same problem with the "ZMninja" app.
i have restarted ZM and Apache services.
bbunge wrote:One better:

In the WIKI instructions for 14.04 I have "sleep 15 added to /etc/init.d/zoneminder

Now add:
mkdir /tmp/zm/cache
mkdir /tmp/zm/cache/models
mkdir /tmp/zm/cache/persistent

after mkdir -p "$TMPDIR" && chown www-data:www-data "$TMPDIR"


nano /etc/init.d/zoneminder

start() {
sleep 15
echo -n "Starting $prog: "
# Wait for mysqld to start. Continue if it takes too long.
count=0
while [ ! -e /var/run/mysqld/mysqld.sock ] && [ $count -lt 60 ]
do
sleep 1
count=$((count+1))
done
export TZ=:/etc/localtime
mkdir -p "$RUNDIR" && chown www-data:www-data "$RUNDIR"
mkdir -p "$TMPDIR" && chown www-data:www-data "$TMPDIR"
mkdir /tmp/zm/cache
mkdir /tmp/zm/cache/models
mkdir /tmp/zm/cache/persistent
chown -R www-data:www-data /tmp/zm/cache
$command start

Ctrl+o Enter to save

CTRL+x to exit

Link to 14.04 WIKI: https://wiki.zoneminder.com/Ubuntu_Serv ... e_easy_way

Re: 1.30.2 upgrade breaks API access

Posted: Fri Apr 14, 2017 11:10 pm
by bbunge
[quote="Andre-nl"]@bbunge

did you restart the server after the changes ? i did the changes, and stil the same problem with the "ZMninja" app.
i have restarted ZM and Apache services.

Did you reboot the server? Or stop then start, not restart, Zoneminder.

I just did a full install of ZM 1.30.2 on a fresh Ubuntu 14.04-5 following the WIKI instructions, added a camera, rebooted and tested with ZMNinja successfully.

Also added the fix to the WIKI upgrade area.

Re: 1.30.2 upgrade breaks API access

Posted: Sat Apr 15, 2017 7:54 am
by Andre-nl
bbunge wrote:
Andre-nl wrote:@bbunge

did you restart the server after the changes ? i did the changes, and stil the same problem with the "ZMninja" app.
i have restarted ZM and Apache services.

Did you reboot the server? Or stop then start, not restart, Zoneminder.

I just did a full install of ZM 1.30.2 on a fresh Ubuntu 14.04-5 following the WIKI instructions, added a camera, rebooted and tested with ZMNinja successfully.

Also added the fix to the WIKI upgrade area.
Hi bbunge,

i have add the extra lines, and restarted the server. it works like a charme ... ZMninja app is running fine now.
Thank you

Re: 1.30.2 upgrade breaks API access

Posted: Wed Apr 19, 2017 7:04 pm
by rkaule
Hi all,

I had the above problem. I would get a blank page back when trying to access the api page. I did the fix above (systemd-tmpfiles --create zoneminder.conf) and now I get a red bar that states :

Error: The requested address '/zm/api/' was not found on this server.

Thanks,
Bob

Re: 1.30.2 upgrade breaks API access

Posted: Wed Apr 19, 2017 11:12 pm
by bbunge
rkaule wrote:Hi all,

I had the above problem. I would get a blank page back when trying to access the api page. I did the fix above (systemd-tmpfiles --create zoneminder.conf) and now I get a red bar that states :

Error: The requested address '/zm/api/' was not found on this server.

Thanks,
Bob
Assume you have Ubuntu but which version.

Re: 1.30.2 upgrade breaks API access

Posted: Thu Apr 20, 2017 2:30 am
by rkaule
No, I'm running Centos 7.

Re: 1.30.2 upgrade breaks API access

Posted: Fri Apr 21, 2017 1:50 pm
by apbb2
bbunge wrote:
rkaule wrote:Hi all,

I had the above problem. I would get a blank page back when trying to access the api page. I did the fix above (systemd-tmpfiles --create zoneminder.conf) and now I get a red bar that states :

Error: The requested address '/zm/api/' was not found on this server.

Thanks,
Bob
Assume you have Ubuntu but which version.
I'm running 14.04.5 & have the same issue.

The fix above fixed my issue but have the /zm/api error. It's working so its fixed but not errorless.