1.30.2 upgrade breaks API access

Forum for questions and support relating to the 1.30.x releases only.
McFuzz
Posts: 175
Joined: Tue Aug 28, 2012 7:03 am

Re: 1.30.2 upgrade breaks API access

Post by McFuzz » Mon Apr 10, 2017 5:21 am

Any ideas, anyone? :(

sagitt
Posts: 16
Joined: Mon Apr 30, 2012 1:13 pm

Re: 1.30.2 upgrade breaks API access

Post by sagitt » Mon Apr 10, 2017 11:14 am

same issue!

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

clueo8
Posts: 5
Joined: Tue Mar 10, 2015 10:47 am

Re: 1.30.2 upgrade breaks API access

Post by clueo8 » Mon Apr 10, 2017 5:48 pm

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?

bbunge
Posts: 1991
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: 1.30.2 upgrade breaks API access

Post by bbunge » Tue Apr 11, 2017 10:53 pm

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...

User avatar
knight-of-ni
Posts: 2087
Joined: Thu Oct 18, 2007 1:55 pm
Location: Shiloh, IL

Re: 1.30.2 upgrade breaks API access

Post by knight-of-ni » Wed Apr 12, 2017 12:06 pm

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.
Visit my blog for ZoneMinder related projects using the Raspberry Pi, Orange Pi, Odroid, and the ESP8266
All of these can be found at https://zoneminder.blogspot.com/

McFuzz
Posts: 175
Joined: Tue Aug 28, 2012 7:03 am

Re: 1.30.2 upgrade breaks API access

Post by McFuzz » Thu Apr 13, 2017 8:56 am

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.

bbunge
Posts: 1991
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: 1.30.2 upgrade breaks API access

Post by bbunge » Thu Apr 13, 2017 1:02 pm

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

Andre-nl
Posts: 23
Joined: Tue Sep 06, 2016 12:52 pm

Re: 1.30.2 upgrade breaks API access

Post by Andre-nl » Fri Apr 14, 2017 6:44 pm

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

Andre-nl
Posts: 23
Joined: Tue Sep 06, 2016 12:52 pm

Re: 1.30.2 upgrade breaks API access

Post by Andre-nl » Fri Apr 14, 2017 8:39 pm

@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

bbunge
Posts: 1991
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: 1.30.2 upgrade breaks API access

Post by bbunge » Fri Apr 14, 2017 11:10 pm

[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.

Andre-nl
Posts: 23
Joined: Tue Sep 06, 2016 12:52 pm

Re: 1.30.2 upgrade breaks API access

Post by Andre-nl » Sat Apr 15, 2017 7:54 am

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

rkaule
Posts: 10
Joined: Wed Apr 19, 2017 2:08 pm
Location: Pittsburgh, PA

Re: 1.30.2 upgrade breaks API access

Post by rkaule » Wed Apr 19, 2017 7:04 pm

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

bbunge
Posts: 1991
Joined: Mon Mar 26, 2012 11:40 am
Location: Pennsylvania

Re: 1.30.2 upgrade breaks API access

Post by bbunge » Wed Apr 19, 2017 11:12 pm

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.

rkaule
Posts: 10
Joined: Wed Apr 19, 2017 2:08 pm
Location: Pittsburgh, PA

Re: 1.30.2 upgrade breaks API access

Post by rkaule » Thu Apr 20, 2017 2:30 am

No, I'm running Centos 7.

apbb2
Posts: 26
Joined: Sun Jun 08, 2008 4:02 pm

Re: 1.30.2 upgrade breaks API access

Post by apbb2 » Fri Apr 21, 2017 1:50 pm

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.

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests