Page 3 of 4

Re: 1.30.2 upgrade breaks API access

Posted: Fri Apr 21, 2017 9:02 pm
by rkaule
apbb2 wrote:
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.

I can get to the site with zmNinja now (which it wasn't doing yesterday). Everything seems to be working in ZM and zmNinja, but when I try to access the api page I still get the error.

Re: 1.30.2 upgrade breaks API access

Posted: Thu Apr 27, 2017 3:37 pm
by rockedge
are the URL rewrites working correctly? I have found that a lot of these problems in this thread can be caused by mis-functioning url rewrites from ]/usr/share/zoneminder/www/api/.htaccess and /usr/share/zoneminder/www/api/app/.htaccess

Re: 1.30.2 upgrade breaks API access

Posted: Fri Apr 28, 2017 1:19 am
by knight-of-ni
rkaule wrote: Fri Apr 21, 2017 9:02 pm
apbb2 wrote:
bbunge wrote: 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.

I can get to the site with zmNinja now (which it wasn't doing yesterday). Everything seems to be working in ZM and zmNinja, but when I try to access the api page I still get the error.
Working as intended. Cake debug mode was turned off by default in 1.30.2 because it was discovered an attacker could easily get it to reveal sensitive information when debug is turned on. When debug is turned off, the /zm/api url will not work. This is by design of the cakephp project. The actual meat of the API will continue to function normally.

Re: 1.30.2 upgrade breaks API access

Posted: Wed May 03, 2017 12:27 pm
by gdl
I'm also facing API issues with 1.30.3, I'm on Ubuntu 16.04.2 LTS. When accessing https://<server>/zm/api/host/getVersion.json I get an empty page, and the Apache error log shows:

Code: Select all

[Wed May 03 13:12:46.485093 2017] [:error] [pid 4496] [client **.**.**.**:63354] PHP Warning:  include(Cake/bootstrap.php): failed to open stream: No such file or directory in /usr/share/zoneminder/www/api/app/webroot/index.php on line 90
[Wed May 03 13:12:46.485136 2017] [:error] [pid 4496] [client **.**.**.**:63354] PHP Warning:  include(): Failed opening 'Cake/bootstrap.php' for inclusion (include_path='/usr/share/zoneminder/www/api/lib:.:/usr/share/php') in /usr/share/zoneminder/www/api/app/webroot/index.php on line 90
[Wed May 03 13:12:46.485161 2017] [:error] [pid 4496] [client **.**.**.**:63354] PHP Fatal error:  CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to the directory containing your /cake core directory and your /vendors root directory. in /usr/share/zoneminder/www/api/app/webroot/index.php on line 99
Any clues?

Re: 1.30.2 upgrade breaks API access

Posted: Wed May 03, 2017 2:25 pm
by bbunge
gdl wrote: Wed May 03, 2017 12:27 pm I'm also facing API issues with 1.30.3, I'm on Ubuntu 16.04.2 LTS. When accessing https://<server>/zm/api/host/getVersion.json I get an empty page, and the Apache error log shows:

Code: Select all

[Wed May 03 13:12:46.485093 2017] [:error] [pid 4496] [client **.**.**.**:63354] PHP Warning:  include(Cake/bootstrap.php): failed to open stream: No such file or directory in /usr/share/zoneminder/www/api/app/webroot/index.php on line 90
[Wed May 03 13:12:46.485136 2017] [:error] [pid 4496] [client **.**.**.**:63354] PHP Warning:  include(): Failed opening 'Cake/bootstrap.php' for inclusion (include_path='/usr/share/zoneminder/www/api/lib:.:/usr/share/php') in /usr/share/zoneminder/www/api/app/webroot/index.php on line 90
[Wed May 03 13:12:46.485161 2017] [:error] [pid 4496] [client **.**.**.**:63354] PHP Fatal error:  CakePHP core could not be found. Check the value of CAKE_CORE_INCLUDE_PATH in APP/webroot/index.php. It should point to the directory containing your /cake core directory and your /vendors root directory. in /usr/share/zoneminder/www/api/app/webroot/index.php on line 99
Any clues?
working on it. Likely a dependency is missing. Possibly php7-apcu

Re: 1.30.2 upgrade breaks API access

Posted: Wed May 03, 2017 2:27 pm
by ios77
Same error here after upgrading to 1.30.3:

Code: Select all

[Wed May 03 16:20:58.124863 2017] [:error] [pid 1038] [client:62030] PHP Warning:  include(Cake/bootstrap.php): failed to open stream: No such file or directory in /usr/sh
are/zoneminder/www/api/app/webroot/index.php on line 90
[Wed May 03 16:20:58.124905 2017] [:error] [pid 1038] [client :62030] PHP Warning:  include(): Failed opening 'Cake/bootstrap.php' for inclusion (include_path='/usr/share/z
oneminder/www/api/lib:.:/usr/share/php') in /usr/share/zoneminder/www/api/app/webroot/index.php on line 90

any help?
thanks

Re: 1.30.2 upgrade breaks API access

Posted: Wed May 03, 2017 2:54 pm
by bbunge
There was an updated version of the 1.30.3 package released this morning about 1000 EDT. Testing it now.

For 16.04 you should be able to install php-apcu and restart Apache to get the API to work.

Re: 1.30.2 upgrade breaks API access

Posted: Wed May 03, 2017 5:11 pm
by Mozart
bbunge wrote: Wed May 03, 2017 2:54 pm There was an updated version of the 1.30.3 package released this morning about 1000 EDT. Testing it now.

For 16.04 you should be able to install php-apcu and restart Apache to get the API to work.
I am on 16.04 and did install php-apcu but still get the errors about Cake/bootstrap.php like the user ios77 reports above.
And I did a reinstall of zoneminder but it does not help. Zoneminder works fine with the exception of the API.
When accessing https://<server>/zm/api/host/getVersion.json I get an error 500.

Re: 1.30.2 upgrade breaks API access

Posted: Wed May 03, 2017 5:21 pm
by gdl
I can confirm that the latest update package did not resolve the issue. It looks to me like the file bootstrap.php is missing in the Cake folder.

Re: 1.30.2 upgrade breaks API access

Posted: Thu May 04, 2017 8:24 am
by gdl
Good news: With the update of this morning the API is working again on my Ubuntu 16.04 with Zoneminder 1.30.3. Thanks for the support!

Re: 1.30.2 upgrade breaks API access

Posted: Thu May 04, 2017 8:31 am
by ios77
Update:
apt update
apt install php-apcu-bc
restart apache and zoneminder
fix the probem after upgrade to 1.30.3 on 16.04.....

Re: 1.30.2 upgrade breaks API access

Posted: Thu May 04, 2017 8:40 am
by Mozart
Yes, it's working again!
I did:
apt update
apt upgrade
Restant apache2 and Zoneminder

Re: 1.30.2 upgrade breaks API access

Posted: Thu May 04, 2017 4:50 pm
by rockedge
even with the fix in place, the API on 1.30.3 remains broken running on Puppy Linux Tahr 6.0.6 (Ubuntu 14.04 binaries) with a Hiawatha server. Just a blank white page

Code: Select all

127.0.0.1|Thu 04 May 2017 12:48:16 -0400|/usr/share/zoneminder/www/api/app/webroot/index.php|PHP Fatal error:  Call to undefined function apc_fetch() in /usr/share/zoneminder/www/api/lib/Cake/Cache/Engine/ApcEngine.php on line 78
127.0.0.1|Thu 04 May 2017 12:48:16 -0400|/usr/share/zoneminder/www/api/app/webroot/index.php|CGI returned 500 Internal Error
is this problem related to php-apcu missing? any ideas will be appreciated!

Re: 1.30.2 upgrade breaks API access

Posted: Thu May 04, 2017 6:45 pm
by bbunge
rockedge wrote: Thu May 04, 2017 4:50 pm even with the fix in place, the API on 1.30.3 remains broken running on Puppy Linux Tahr 6.0.6 (Ubuntu 14.04 binaries) with a Hiawatha server. Just a blank white page

Code: Select all

127.0.0.1|Thu 04 May 2017 12:48:16 -0400|/usr/share/zoneminder/www/api/app/webroot/index.php|PHP Fatal error:  Call to undefined function apc_fetch() in /usr/share/zoneminder/www/api/lib/Cake/Cache/Engine/ApcEngine.php on line 78
127.0.0.1|Thu 04 May 2017 12:48:16 -0400|/usr/share/zoneminder/www/api/app/webroot/index.php|CGI returned 500 Internal Error
is this problem related to php-apcu missing? any ideas will be appreciated!
manually install php5-apc. It is in the WIKI...

Re: 1.30.2 upgrade breaks API access

Posted: Thu May 04, 2017 6:48 pm
by rockedge
I did install php5-apc and activated the module and the API works again!! Thanks....

Turns out all that is needed for a clean upgrade to zm 1.30.3 in Tahrpup 6.0.6 is to install zoneminder_1.30.3-trusty8_i386.deb and php5-apcu_4.0.2-2build1_i386.deb.
make sure the php module is activated fixed a couple permissions and ran zmupdate.pl....now the API works.