pantheon-systems / localdev-issues

Issue tracking for Pantheon localdev
6 stars 2 forks source link

Can't pull a site for local development. Apparent certs issue. #91

Open josemilioz opened 3 years ago

josemilioz commented 3 years ago

I'm new on Localdev and my new bosses use it from Pantheon.

I set up everything as default: using the latest Localdev from Pantheon.io directly, and didn't even update the docker version that gets installed by Localdev. I'm on an Late 2013 iMac running Catalina. Set up SSH Keys on Pantheon and logged in using Machine Token. When I press the yellow button to pull the whole thing, it starts right but then when trying to access mysql via socket start the problems:

Killing pld-phrredesign_appserver_1 ... done Starting pld-phrredesign_appserver_1 ... done Creating pld-phrredesign_index_1 ... done Creating pld-phrredesign_database_1 ... done Creating pld-phrredesign_appserver_nginx_1 ... done Creating pld-phrredesign_cache_1 ... done ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/bitnami/mariadb/tmp/mysql.sock' (2 "No such file or directory") ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/bitnami/mariadb/tmp/mysql.sock' (2 "No such file or directory") ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/bitnami/mariadb/tmp/mysql.sock' (2 "No such file or directory") ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/opt/bitnami/mariadb/tmp/mysql.sock' (2 "No such file or directory") information_schema mysql performance_schema test

Then, when it tries to log in via terminus, I get the following:

Attempting to login via terminus... [notice] Logging in via machine token. [warning] HTTPS request failed with error cURL error 77: error setting certificate verify locations: CAfile: /etc/ssl/certs/ca-certificates.crt CApath: /etc/ssl/certs (see https://curl.haxx.se/libcurl/c/libcurl-errors.html). Retrying in 166 milliseconds.. [warning] HTTPS request failed with error cURL error 77: error setting certificate verify locations: CAfile: /etc/ssl/certs/ca-certificates.crt CApath: /etc/ssl/certs (see https://curl.haxx.se/libcurl/c/libcurl-errors.html). Retrying in 292 milliseconds.. [warning] HTTPS request failed with error cURL error 77: error setting certificate verify locations: CAfile: /etc/ssl/certs/ca-certificates.crt CApath: /etc/ssl/certs (see https://curl.haxx.se/libcurl/c/libcurl-errors.html). Retrying in 473 milliseconds.. [warning] HTTPS request failed with error cURL error 77: error setting certificate verify locations: CAfile: /etc/ssl/certs/ca-certificates.crt CApath: /etc/ssl/certs (see https://curl.haxx.se/libcurl/c/libcurl-errors.html). Retrying in 819 milliseconds.. [warning] HTTPS request failed with error cURL error 77: error setting certificate verify locations: CAfile: /etc/ssl/certs/ca-certificates.crt CApath: /etc/ssl/certs (see https://curl.haxx.se/libcurl/c/libcurl-errors.html). Retrying in 1699 milliseconds.. [error] HTTPS request failed with error cURL error 77: error setting certificate verify locations: CAfile: /etc/ssl/certs/ca-certificates.crt CApath: /etc/ssl/certs (see https://curl.haxx.se/libcurl/c/libcurl-errors.html). Maximum retry attempts reached. Logged in as Verifying that you have access to [username]... [warning] HTTPS request failed with error cURL error 77: error setting certificate verify locations: CAfile: /etc/ssl/certs/ca-certificates.crt CApath: /etc/ssl/certs (see https://curl.haxx.se/libcurl/c/libcurl-errors.html). Retrying in 178 milliseconds.. [warning] HTTPS request failed with error cURL error 77: error setting certificate verify locations: CAfile: /etc/ssl/certs/ca-certificates.crt CApath: /etc/ssl/certs (see https://curl.haxx.se/libcurl/c/libcurl-errors.html). Retrying in 257 milliseconds.. [warning] HTTPS request failed with error cURL error 77: error setting certificate verify locations: CAfile: /etc/ssl/certs/ca-certificates.crt CApath: /etc/ssl/certs (see https://curl.haxx.se/libcurl/c/libcurl-errors.html). Retrying in 450 milliseconds.. [warning] HTTPS request failed with error cURL error 77: error setting certificate verify locations: CAfile: /etc/ssl/certs/ca-certificates.crt CApath: /etc/ssl/certs (see https://curl.haxx.se/libcurl/c/libcurl-errors.html). Retrying in 878 milliseconds.. [warning] HTTPS request failed with error cURL error 77: error setting certificate verify locations: CAfile: /etc/ssl/certs/ca-certificates.crt CApath: /etc/ssl/certs (see https://curl.haxx.se/libcurl/c/libcurl-errors.html). Retrying in 1683 milliseconds.. [error] Could not locate a site your user may access identified by [username].

Tried to get in touch with the Pantheon people but the only thing they could say was "Try reseting and in case it don't work, reinstall and try again" At least they gave me the link to come and produce this ticket indicating what is going on. Is it any write permission missing on my certs directory? Thanks in advance for the help.

BryanBarrera commented 3 years ago

Did you happen to find a fix for this issue? I am having the same problem.

josemilioz commented 3 years ago

@BryanBarrera not yet. Whenever I find some time I'll give it a try again. Maybe I'll try to give chmod 777 to my certs folder and then revert it again, or uninstall the curl I installed through brew. If you can, try to do it that way. Do you have any other dependency that might conflict with their installer?

ryanlovett commented 3 years ago

I'm having the same issue too. Pantheon support ticket 544880. They've walked me through deleting ~/.pantheonlocaldev and various Docker resets but nothing has worked so far. https://github.com/lando/lando/issues/1585 looks somewhat related.

Regarding the certs error, wouldn't that be related to the cert setup within one of the containers and not on your own system?

josemilioz commented 3 years ago

Mmm, @ryanlovett I don't know about the certs. Because I just happened to re-install Catalina and many stuff changed in the root, and even some of the drives changed 'ways' let's say, so it might be blocking Localdev from accessing or writing stuff regarding the certs. I gave up with this and just adopted Lando and Terminus for good. It requires typing and a little more time, but works like a charm.

schutzsmith commented 3 years ago

Confirming the same folks have said here and other issue threads that are more recent. Trying to pull a local site for development will not work. Fails at cert level. Also on Catalina on Mac. Tried resetting Pantheon, deleting the ~/.pantheonlocaldev, etc but nothing works.

pirog commented 2 years ago

Going to skip the need for replication here because i think this will be hard to replicate. My guess is that this is a race condition that happens probably on slower machines OR machine that are under considerable load.

What is likely happening is Localdev has not completed refreshing certs before the pull operation starts. We probably just want to add a few tries/retries on whether certs are ready before we start any operation that requires them (likely just pull/push).

It might also be wise to bake this change directly into Lando so it can benefit from it as well, even though it seems like this is super rare or a non-problem in lando.