Invalid Ajax response upon update

I have Grav v0.9.39 with admin panel v0.4.2 installed in a shared hosting environment. When I try to update from within the admin panel, an error message pops up reading ‘Invalid Ajax response’, followed by the message: Error while trying to download ‘https://github.com/getgrav/grav/releases/download/0.9.40/grav-update-v0.9.40.zip’. The same applies if I try to update a single plugin or theme.

I am pretty sure the hosting should meet the requirements (PHP 5.6 etc.) and this is not related to missing permissions. Any hints?

Might be an issue with something else on the server such as Curl. Have you ever been able to do an update on Grav, perhaps via the CLI with bin/gpm ???

I don’t have access to the terminal, but curl is definitely installed.

Might be similar to https://github.com/getgrav/grav-plugin-admin/issues/127? Maybe try inspecting the AJAX request as explained in https://github.com/getgrav/grav-plugin-admin/issues/127#issuecomment-136377183 to see what’s the actual AJAX request response, so maybe it will explain why it’s invalid

Thanks, update triggers two XHR requests.

It seems as if ‘task:updategrav’ doesn’t return anything. The response is ‘{}’.

The second task ‘admin’ appears to compare versions:
{“status”:“success”,“payload”:{“resources”:{“total”:3,“plugins”:{“admi n”:{“available”:“0.4.3”,“version”:“0.4.2”},“login”:{“available”:“0.3.1”,“version”:“0.3.0”}},“themes”:{“antimatter”:{“available”:“1.7.3”,“version”:“1.7.2”}}},“grav”:{“isUpdatable”:true,“assets”:{“grav-update”:{“name”:“grav-update-v0.9.40.zip”,“type”:“application/octet-stream”,“size”:2279518,“download”:“https://github.com/getgrav/grav/releases/download/0.9.40/grav-update-v0.9.40.zip"},“grav”:{“name”:“grav-v0.9.40.zip”,“type”:“application/octet-stream”,“size”:3501676,“download”:“https://github.com/getgrav/grav/releases/download/0.9.40/grav-v0.9.40.zip”}},“version”:“0.9.39”,“available”:“0.9.40”,“date”:“2015-08-31T16:22:57Z”,“isSymlink”:false},“installed”:7,"flushed”:false}}

Just to be sure, is cURL listed in [yoursite]/admin/info ?

Yes, curl is listed.

curl
cURL support enabled
cURL Information 7.36.0

Really would be helpful to have access to the terminal. What hosting provider do you use? I’ve yet to come across one that has no access, sometimes you just need to request it.

It’s a rather small provider from germany called serverprofis.de.
Basically the same error applies if I try to add a plugin or a theme (except for the Ajax error).
I can confirm however, that automatic updates in WordPress or OctoberCMS for instance work perfectly.

It’s kinda of hard to know what the error is… Do you have access to your PHP logs?

PHP error logging is enabled, error_reporting is set to ‘E_ALL’. As the support told me, the logs should be saved in the root folder of the script that produces an error.
Although I am repeatedly not able to update anything from the admin panel, there definitely is no ‘error_log’. Guess I’m out of luck this time…

You can either 1) change hosting to something more “empowering” (see on our Learn site for some references) 2) build (and maintain) the site on localhost and update the remote site via FTP or other sync methods. I personally maintain all my sites locally and update them via Git post-commit hooks: once I push to my Git repository, the server updates automatically the site files for me.

Could it be that the error is somehow related to a missing certificate or something like that? See http://unitstep.net/blog/2009/05/05/using-curl-in-php-to-access-https-ssltls-protected-sites/

I created a very basic script that tries to download from https://github.com on the server.
The output of curl_error is:
error setting certificate verify locations: CAfile: /etc/pki/tls/certs/ca-bundle.crt CApath: none

A normal http url works just fine.

Yah we have to use HTTPS because GitHub requires it for API requests.