Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The connection to the GPM cannot be established. #1355

Closed
JOduMonT opened this issue Feb 26, 2018 · 7 comments
Closed

The connection to the GPM cannot be established. #1355

JOduMonT opened this issue Feb 26, 2018 · 7 comments
Labels

Comments

@JOduMonT
Copy link

I have 2times this issue on alpine and on a centos server both with nginx/php7 and gravcms+admin installed via a routine of wget, unzip, chown, chmod, than cp the nginx config from here
may I mention, in both machine, bin/gpm [index,install,update,...] works well

Now the funniest thing it's if I wget a skeleton into the same directory and apply the same chown, chmod and chcon restart nginx than everything works perfectly

So I believe something missing from your side

What I did before opening this issue :

  1. I clearly clear my cache like it says here
  2. went through, which I confirm :
  • openssl support is enabled
  • curl support is enabled
  • i'm no using a proxy (at least not yet ;))
  • ping getgrav.com respond 121.78.127.249
  • nginx and php running as nginx user and just to be sure I execute these line in my gravcms directory
find . -type f | xargs chmod 664
find ./bin -type f | xargs chmod 775
find . -type d | xargs chmod 775
find . -type d | xargs chmod +s
  • I pass back in forth SELinux in permissive mode and spying my audit.log without any new notice since I made this PR
  • I set Configuration -> System -> Remote Verify Peer (SSL) at NO and I confirm it set at off inside via user/config/system.yaml |grep peer
  • I also forced CURL instead of fopen without success
  1. When I'm executing curl -I https://getgrav.org/downloads/plugins.json, a test I found here your server answer
HTTP/1.1 200 OK
Server: nginx
Date: Mon, 26 Feb 2018 03:39:43 GMT
Content-Type: application/json
Connection: keep-alive
Vary: Accept-Encoding
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate
Pragma: no-cache
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: OPTIONS, GET, HEAD, POST, PUT, DELETE
Vary: Accept-Encoding
Set-Cookie: grav-site-7fe36eb=2a5026e3e3d232ebca7b0a3938942f69; expires=Mon, 26-Feb-2018 04:09:42 GMT; Max-Age=1800; path=/; domain=getgrav.org; HttpOnly
Set-Cookie: grav-site-7fe36eb=2a5026e3e3d232ebca7b0a3938942f69; expires=Mon, 26-Feb-2018 04:09:42 GMT; Max-Age=1800; path=/; domain=getgrav.org; HttpOnly
Last-Modified: Thu, 08 Oct 2015 22:20:13 GMT
ETag: "80fef8abc41eff6c507d08b627a0fbe4"

these all packages installed

nginx
nginx-mod-http-geoip
nginx-mod-http-image-filter
nginx-mod-http-perl
nginx-mod-http-xslt-filter
nginx-mod-mail 
nginx-mod-stream
php7
php-common
php-bz2
php-calendar
php-cgi-fcgi
php-core
php-ctype
php-curl
php-date
php-exif
php-fileinfo
php-filter
php-ftp
php-gettext
php-hash
php-iconv
php-json
php-libxml
php-openssl
php-fpm
php-pcre
php-phar
php-reflection
php-session
php-sockets
php-SPL
php-standard
php-tokenizer
php-zlib
php-dom
php-simplexml
php-wddx
php-xml
php-xmlreader
php-xmlwriter
php-xsl
php-gd
php-mbstring
php-yaml
php-zip
php-apcu
php-opcache
@rhukster rhukster added the bug label Mar 1, 2018
@chrisjenx
Copy link

I have something similar, followed all the steps on the site + additional and still get the error.
And again, gpm works fine from cli.

@rhukster
Copy link
Member

rhukster commented Mar 9, 2018

This is pretty confusing because GPM uses the same base classes for both admin and CLI. I guess the only real differentiator is the user it runs under (nginx vs logged in via CLI). So that definitely makes me think it's a permission issue.

I'm guessing both of you have Grav running under a webserver with a different user from who actually owns the files? Is there anyway you could configure your webserver with the same user to test if that is indeed the issue?

For Nginx, this needs to be set in PHP FPM connection pool: https://learn.getgrav.org/webservers-hosting/vps/linode#configure-nginx-connection-pool

@JOduMonT
Copy link
Author

@rhukster thanks for you digging;
I didn't thought about it, I'll give a try and come up with the result. ;)

@artofthesmart
Copy link

artofthesmart commented Mar 28, 2018

I'm having the same problem on Apache with GPM working fine via CLI. It also stopped working on other sites that haven't undergone any special changes (it used to work). Happy to help however I can!

@JOduMonT
Copy link
Author

Hi again;

@rhukster sorry for the delay but actually I think your right!

In my case

nginx run as abc (yep I'm eating my own food which is a gravcms in a docker/linuxserver)
and my phpinfo.php said php also use the abc user.

via the CLI

when I'm running /bin/gpm I'm root
and when I try to run it as abc via sudo nothing happen.
But at this point I'm pretty sure it's because I strip too much the docker-image and I review my docker-image and include core-utils and sudo just to name a few.

So at least for my self I'll consider we could close this issue
because, obviously @rhukster did a awesome job by digging hard and right at the good spot.

I would like

to invite @chrisjenx and @artofthesmart to share their config
at least discover who run the webengine and the phpprocess.

@JOduMonT
Copy link
Author

PS and ha!ha!
this morning I run grav via docker (as usual) without any error
the only difference it's now Quark is the default themes ;)

@lefloresg
Copy link

I'm getting the same error but it is not working in command line. I get this error when I do bin/gpm index:

Parse error: syntax error, unexpected '.', expecting '&' or variable (T_VARIABLE) in /home3/profesa/public_html/vendor/symfony/var-dumper/Resources/functions/dump.php on line 18

I've already used a fix to update the CLI and for example newuser is working.

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants