0

I'm trying to get the google assistant sdk sample running on a pi but after receiving the authorization URL by using

google-oauthlib-tool --client-secrets /home/pi/client_secret_<my-id>.json --scope https://www.googleapis.com/auth/assistant-sdk-prototype --save --headless

I enter the code from the provided url and get this dump:

Traceback (most recent call last):
  File "/home/pi/env/lib/python3.4/site-packages/urllib3/connectionpool.py", line 600, in urlopen
    chunked=chunked)
  File "/home/pi/env/lib/python3.4/site-packages/urllib3/connectionpool.py", line 345, in _make_request
    self._validate_conn(conn)
  File "/home/pi/env/lib/python3.4/site-packages/urllib3/connectionpool.py", line 844, in _validate_conn
    conn.connect()
  File "/home/pi/env/lib/python3.4/site-packages/urllib3/connection.py", line 326, in connect
    ssl_context=context)
  File "/home/pi/env/lib/python3.4/site-packages/urllib3/util/ssl_.py", line 325, in ssl_wrap_socket
    return context.wrap_socket(sock, server_hostname=server_hostname)
  File "/usr/lib/python3.4/ssl.py", line 364, in wrap_socket
    _context=self)
  File "/usr/lib/python3.4/ssl.py", line 577, in __init__
    self.do_handshake()
  File "/usr/lib/python3.4/ssl.py", line 804, in do_handshake
    self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/env/lib/python3.4/site-packages/requests/adapters.py", line 440, in send
    timeout=timeout
  File "/home/pi/env/lib/python3.4/site-packages/urllib3/connectionpool.py", line 630, in urlopen
    raise SSLError(e)
urllib3.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/pi/env/bin/google-oauthlib-tool", line 11, in <module>
    sys.exit(main())
  File "/home/pi/env/lib/python3.4/site-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/home/pi/env/lib/python3.4/site-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/home/pi/env/lib/python3.4/site-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/pi/env/lib/python3.4/site-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/home/pi/env/lib/python3.4/site-packages/google_auth_oauthlib/tool/__main__.py", line 106, in main
    creds = flow.run_console()
  File "/home/pi/env/lib/python3.4/site-packages/google_auth_oauthlib/flow.py", line 358, in run_console
    self.fetch_token(code=code)
  File "/home/pi/env/lib/python3.4/site-packages/google_auth_oauthlib/flow.py", line 235, in fetch_token
    **kwargs)
  File "/home/pi/env/lib/python3.4/site-packages/requests_oauthlib/oauth2_session.py", line 221, in fetch_token
    verify=verify, proxies=proxies)
  File "/home/pi/env/lib/python3.4/site-packages/requests/sessions.py", line 560, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "/home/pi/env/lib/python3.4/site-packages/requests_oauthlib/oauth2_session.py", line 360, in request
    headers=headers, data=data, **kwargs)
  File "/home/pi/env/lib/python3.4/site-packages/requests/sessions.py", line 513, in request
    resp = self.send(prep, **send_kwargs)
  File "/home/pi/env/lib/python3.4/site-packages/requests/sessions.py", line 623, in send
    r = adapter.send(request, **kwargs)
  File "/home/pi/env/lib/python3.4/site-packages/requests/adapters.py", line 514, in send
    raise SSLError(e, request=request)
requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:600)

I checked this post which had a similar issue and updated my clock accordingly but that didn't seem to be the problem. I have redownloaded all the libraries and tools and ensured python is up to date but I can't get this to work. Is there any solution to this issue?

It is also worth noting that this same trace occurs regardless of what i put in as the authorization code, even just putting in "x" produces the same output.

nlin
  • 1
  • 3
  • can you double check your current time? – proppy Jun 02 '17 at 17:55
  • `pi@raspberrypi:~ $ date Fri 2 Jun 14:05:13 EDT 2017` Seems to be working fine – nlin Jun 02 '17 at 18:06
  • can you double check that you have `ca-certificates` package installed? – proppy Jun 07 '17 at 18:19
  • Can you also try: `env/bin/python -c "import requests; print(requests.get('https://www.google.com').status_code)"` – proppy Jun 07 '17 at 18:22
  • I was actually able to fix this by switching from raspbian to ubuntu server w/ xubuntu desktop (although now sound doesn't work). My suspicion is that it was a bad .json – nlin Jun 09 '17 at 17:49
  • I met same issue, the time is correct and ca-certificates package is installed. after I try: env/bin/python -c "import requests; print(requests.get('https://www.google.com').status_code)", got the same error. – Teresa Jun 28 '17 at 07:03

1 Answers1

2

I was following the instructions at https://developers.google.com/assistant/sdk/develop/python/run-sample but I think those instructions forgot the step:

sudo apt-get install portaudio19-dev libffi-dev libssl-dev

Doing that then re-running google-oauthlib-tool worked.

Graham Toal
  • 324
  • 1
  • 7