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

Newbie trouble #16

Closed
mjmare opened this issue Oct 3, 2020 · 2 comments
Closed

Newbie trouble #16

mjmare opened this issue Oct 3, 2020 · 2 comments

Comments

@mjmare
Copy link

mjmare commented Oct 3, 2020

Hi
I'm trying out MyPaas, but ran into some issues:

Docs do not detail installation on the work machine. It also does not specify the toml requirement.
It seems to be sufficient to have this in my requirements.txt:

mypaas
toml

I followed the getting started instructions and the tried to run the hello-world example. However, when pushing

mypaas push xxxx.yyyy.nl .

(xxxx.yyyy.nl is not the real server name of course)

I got this error:

Traceback (most recent call last):
  File "/Users/mjm/Dropbox/Devel/_Experiments/MyPaas/venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 670, in urlopen
    httplib_response = self._make_request(
  File "/Users/mjm/Dropbox/Devel/_Experiments/MyPaas/venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 381, in _make_request
    self._validate_conn(conn)
  File "/Users/mjm/Dropbox/Devel/_Experiments/MyPaas/venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 978, in _validate_conn
    conn.connect()
  File "/Users/mjm/Dropbox/Devel/_Experiments/MyPaas/venv/lib/python3.8/site-packages/urllib3/connection.py", line 362, in connect
    self.sock = ssl_wrap_socket(
  File "/Users/mjm/Dropbox/Devel/_Experiments/MyPaas/venv/lib/python3.8/site-packages/urllib3/util/ssl_.py", line 384, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 500, in wrap_socket
    return self.sslsocket_class._create(
  File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 1040, in _create
    self.do_handshake()
  File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 1309, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/mjm/Dropbox/Devel/_Experiments/MyPaas/venv/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/Users/mjm/Dropbox/Devel/_Experiments/MyPaas/venv/lib/python3.8/site-packages/urllib3/connectionpool.py", line 726, in urlopen
    retries = retries.increment(
  File "/Users/mjm/Dropbox/Devel/_Experiments/MyPaas/venv/lib/python3.8/site-packages/urllib3/util/retry.py", line 439, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='xxxx.yyyy.nl', port=443): Max retries exceeded with url: /daemon/time (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/mjm/Dropbox/Devel/_Experiments/MyPaas/venv/bin/mypaas", line 8, in <module>
    sys.exit(main())
  File "/Users/mjm/Dropbox/Devel/_Experiments/MyPaas/venv/lib/python3.8/site-packages/mypaas/__main__.py", line 109, in main
    func(*argv[1:])
  File "/Users/mjm/Dropbox/Devel/_Experiments/MyPaas/venv/lib/python3.8/site-packages/mypaas/client/_push.py", line 41, in push
    r = requests.get(base_url + "/time", verify=True)
  File "/Users/mjm/Dropbox/Devel/_Experiments/MyPaas/venv/lib/python3.8/site-packages/requests/api.py", line 76, in get
    return request('get', url, params=params, **kwargs)
  File "/Users/mjm/Dropbox/Devel/_Experiments/MyPaas/venv/lib/python3.8/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Users/mjm/Dropbox/Devel/_Experiments/MyPaas/venv/lib/python3.8/site-packages/requests/sessions.py", line 530, in request
    resp = self.send(prep, **send_kwargs)
  File "/Users/mjm/Dropbox/Devel/_Experiments/MyPaas/venv/lib/python3.8/site-packages/requests/sessions.py", line 643, in send
    r = adapter.send(request, **kwargs)
  File "/Users/mjm/Dropbox/Devel/_Experiments/MyPaas/venv/lib/python3.8/site-packages/requests/adapters.py", line 514, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='xxxx.yyyy.nl', port=443): Max retries exceeded with url: /daemon/time (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1123)')))

Testing on MacOS with a DigitalOcean docker droplet.

@almarklein
Copy link
Owner

It also does not specify the toml requirement.

I just fixed this. Thanks for the heads-up!

As for that certificate error. I read that "Normally the python installation has access to root certificate authorities. However on some OSes such as OSX, the root CA are empty."

Maybe this helps: https://stackoverflow.com/questions/52805115/certificate-verify-failed-unable-to-get-local-issuer-certificate/56031239#56031239

If there is a solution in the form of something that we can adopt in MyPaas, that would be great!

@mjmare
Copy link
Author

mjmare commented Oct 5, 2020

Thanks. With my limiting understanding of the matter I ran this program: https://github.com/python/cpython/blob/master/Mac/BuildScript/resources/install_certificates.command
in my venv (since I do not use the system python, but rather the Homebrew version).
However I'm still getting the same error.

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

No branches or pull requests

2 participants