SSL: certificate_verify_failed using Google Assistant SDK - ssl

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.

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.

Related

(Scrapy-Redis) Error caught on signal handler: <bound method RedisMixin.spider_idle of spider

I have three machines on Azure. One is for redis server. The others are crawlers. But, they showed this message after few hours. Did anyone encounter this situation before? Thanks.
2023-02-04 10:58:14 [scrapy.utils.signal] ERROR: Error caught on signal handler: <bound method RedisMixin.spider_idle of <Spider at 0x29ca19e9580>>
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\redis\connection.py", line 812, in read_response
response = self._parser.read_response(disable_decoding=disable_decoding)
File "C:\ProgramData\Anaconda3\lib\site-packages\redis\connection.py", line 318, in read_response
raw = self._buffer.readline()
File "C:\ProgramData\Anaconda3\lib\site-packages\redis\connection.py", line 249, in readline
self._read_from_socket()
File "C:\ProgramData\Anaconda3\lib\site-packages\redis\connection.py", line 192, in _read_from_socket
data = self._sock.recv(socket_read_size)
ConnectionResetError: [WinError 10054] An existing connection was forcibly closed by the remote host
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\scrapy\utils\signal.py", line 30, in send_catch_log
response = robustApply(receiver, signal=signal, sender=sender, *arguments, **named)
File "C:\ProgramData\Anaconda3\lib\site-packages\pydispatch\robustapply.py", line 55, in robustApply
return receiver(*arguments, **named)
File "C:\ProgramData\Anaconda3\lib\site-packages\scrapy_redis\spiders.py", line 205, in spider_idle
if self.server is not None and self.count_size(self.redis_key) > 0:
File "C:\ProgramData\Anaconda3\lib\site-packages\redis\commands\core.py", line 2604, in llen
return self.execute_command("LLEN", name)
File "C:\ProgramData\Anaconda3\lib\site-packages\redis\client.py", line 1258, in execute_command
return conn.retry.call_with_retry(
File "C:\ProgramData\Anaconda3\lib\site-packages\redis\retry.py", line 49, in call_with_retry
fail(error)
File "C:\ProgramData\Anaconda3\lib\site-packages\redis\client.py", line 1262, in <lambda>
lambda error: self._disconnect_raise(conn, error),
File "C:\ProgramData\Anaconda3\lib\site-packages\redis\client.py", line 1248, in _disconnect_raise
raise error
File "C:\ProgramData\Anaconda3\lib\site-packages\redis\retry.py", line 46, in call_with_retry
return do()
File "C:\ProgramData\Anaconda3\lib\site-packages\redis\client.py", line 1259, in <lambda>
lambda: self._send_command_parse_response(
File "C:\ProgramData\Anaconda3\lib\site-packages\redis\client.py", line 1235, in _send_command_parse_response
return self.parse_response(conn, command_name, **options)
File "C:\ProgramData\Anaconda3\lib\site-packages\redis\client.py", line 1275, in parse_response
response = connection.read_response()
File "C:\ProgramData\Anaconda3\lib\site-packages\redis\connection.py", line 818, in read_response
raise ConnectionError(f"Error while reading from {hosterr}" f" : {e.args}")
redis.exceptions.ConnectionError: Error while reading from X.X.X.X:X : (10054, 'An existing connection was forcibly closed by the remote host', None, 10054, None)
Expect to get the clue/suggestion/solution.

meson wrap URLError

1、system
win10
2、shell window
mingw msys
3、python version
3.6
4、meson version
0.61.5
After install meson by cmd "pip3 install --user meson", I run cmd "meson wrap list", the wrong occurs. it report the error "SSL: CERTIFICATE_VERIFY_FAILED", more details as following:
$ meson wrap list
Traceback (most recent call last):
File "d:\app\python3\lib\urllib\request.py", line 1318, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
File "d:\app\python3\lib\http\client.py", line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
File "d:\app\python3\lib\http\client.py", line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "d:\app\python3\lib\http\client.py", line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "d:\app\python3\lib\http\client.py", line 1026, in _send_output
self.send(msg)
File "d:\app\python3\lib\http\client.py", line 964, in send
self.connect()
File "d:\app\python3\lib\http\client.py", line 1400, in connect
server_hostname=server_hostname)
File "d:\app\python3\lib\ssl.py", line 407, in wrap_socket
_context=self, _session=session)
File "d:\app\python3\lib\ssl.py", line 817, in __init__
self.do_handshake()
File "d:\app\python3\lib\ssl.py", line 1077, in do_handshake
self._sslobj.do_handshake()
File "d:\app\python3\lib\ssl.py", line 689, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\atc0220\AppData\Roaming\Python\Python36\site-packages\mesonbuild\mesonmain.py", line 148, in run
return options.run_func(options)
File "C:\Users\atc0220\AppData\Roaming\Python\Python36\site-packages\mesonbuild\wrap\wraptool.py", line 223, in run
options.wrap_func(options)
File "C:\Users\atc0220\AppData\Roaming\Python\Python36\site-packages\mesonbuild\wrap\wraptool.py", line 66, in list_projects
releases = get_releases()
File "C:\Users\atc0220\AppData\Roaming\Python\Python36\site-packages\mesonbuild\wrap\wraptool.py", line 62, in get_releases
url = urlopen('https://wrapdb.mesonbuild.com/v2/releases.json')
File "d:\app\python3\lib\urllib\request.py", line 223, in urlopen
return opener.open(url, data, timeout)
File "d:\app\python3\lib\urllib\request.py", line 526, in open
response = self._open(req, data)
File "d:\app\python3\lib\urllib\request.py", line 544, in _open
'_open', req)
File "d:\app\python3\lib\urllib\request.py", line 504, in _call_chain
result = func(*args)
File "d:\app\python3\lib\urllib\request.py", line 1361, in https_open
context=self._context, check_hostname=self._check_hostname)
File "d:\app\python3\lib\urllib\request.py", line 1320, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:852)>
ERROR: Unhandled python exception
This is a Meson bug and should be reported!
my browser can access the https link, I find some similar problems as this, but no the same environment as me, is this a new bug? if so, how to fix it?

Python 3.8 Downloading Packages/Modules error using PIP

I am trying to install numpy but it is giving this error please help what should I do ?
ERROR: Exception:
Traceback (most recent call last):
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\site-packages\pip\_vendor\urllib3\response.py", line 425, in _error_catcher
yield
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\site-packages\pip\_vendor\urllib3\response.py", line 507, in read
data = self._fp.read(amt) if not fp_closed else b""
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\site-packages\pip\_vendor\cachecontrol\filewrapper.py", line 62, in read
data = self.__fp.read(amt)
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\http\client.py", line 454, in read
n = self.readinto(b)
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\http\client.py", line 498, in readinto
n = self.fp.readinto(b)
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\socket.py", line 669, in readinto
return self._sock.recv_into(b)
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\ssl.py", line 1241, in recv_into
return self.read(nbytes, buffer)
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\ssl.py", line 1099, in read
return self._sslobj.read(len, buffer)
socket.timeout: The read operation timed out
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\site-packages\pip\_internal\cli\base_command.py", line 186, in _main
status = self.run(options, args)
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\site-packages\pip\_internal\commands\install.py", line 331, in run
resolver.resolve(requirement_set)
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\site-packages\pip\_internal\legacy_resolve.py", line 177, in resolve
discovered_reqs.extend(self._resolve_one(requirement_set, req))
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\site-packages\pip\_internal\legacy_resolve.py", line 333, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\site-packages\pip\_internal\legacy_resolve.py", line 282, in _get_abstract_dist_for
abstract_dist = self.preparer.prepare_linked_requirement(req)
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\site-packages\pip\_internal\operations\prepare.py", line 480, in prepare_linked_requirement
local_path = unpack_url(
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\site-packages\pip\_internal\operations\prepare.py", line 282, in unpack_url
return unpack_http_url(
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\site-packages\pip\_internal\operations\prepare.py", line 158, in unpack_http_url
from_path, content_type = _download_http_url(
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\site-packages\pip\_internal\operations\prepare.py", line 303, in _download_http_url
for chunk in download.chunks:
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\site-packages\pip\_internal\utils\ui.py", line 160, in iter
for x in it:
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\site-packages\pip\_internal\network\utils.py", line 15, in response_chunks
for chunk in response.raw.stream(
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\site-packages\pip\_vendor\urllib3\response.py", line 564, in stream
data = self.read(amt=amt, decode_content=decode_content)
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\site-packages\pip\_vendor\urllib3\response.py", line 529, in read
raise IncompleteRead(self._fp_bytes_read, self.length_remaining)
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\contextlib.py", line 131, in __exit__
self.gen.throw(type, value, traceback)
File "c:\users\cutea\appdata\local\programs\python\python38-32\lib\site-packages\pip\_vendor\urllib3\response.py", line 430, in _error_catcher
raise ReadTimeoutError(self._pool, None, "Read timed out.")
pip._vendor.urllib3.exceptions.ReadTimeoutError: HTTPSConnectionPool(host='files.pythonhosted.org', port=443): Read timed out.
Look directly at the last line :
Read timed out
Connect to wifi or faster internet and try again.
my internet connection was poor then i got this error. Then i tried it with faster connection and it worked for me...

fetch chromium - No such file or directory

I've cloned depot tools given instructions from here on ubuntu 17.04.
When I run fetch chromium I get the following error.
./fetch chromium
Running: gclient root
Traceback (most recent call last):
File "./fetch.py", line 299, in <module>
sys.exit(main())
File "./fetch.py", line 294, in main
return run(options, spec, root)
File "./fetch.py", line 280, in run
if not options.force and checkout.exists():
File "./fetch.py", line 82, in exists
gclient_root = self.run_gclient('root').strip()
File "./fetch.py", line 78, in run_gclient
return self.run(cmd_prefix + cmd, **kwargs)
File "./fetch.py", line 68, in run
return subprocess.check_output(cmd, **kwargs)
File "/usr/lib/python2.7/subprocess.py", line 212, in check_output
process = Popen(stdout=PIPE, *popenargs, **kwargs)
File "/usr/lib/python2.7/subprocess.py", line 390, in __init__
errread, errwrite)
File "/usr/lib/python2.7/subprocess.py", line 1024, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
I have come across similar errors in stackoverflow while searching for a resolution however none of them helped resolve the problem.
I'm not clear on if there is any steps required after cloning to install depot tools? The readme
Any thoughts on what is required to solve the problem?
Conteh

Cfy Bootstrap Simple Manager SSL CERTIFICATE FAILED

I have an issue on my Centos7 system behind a corporate proxy
cfy bootstrap --install-plugins -p /opt/cfy/cloudify-manager-blueprints-commercial/simple-manager-blueprint.yaml -i /opt/cfy/cloudify-manager-blueprints-commercial/simple-manager-blueprint-inputs.yaml
returns
SSL: CERTIFICATE_VERIFY_FAILED
env http_proxy and https_proxy is set and I've exported
CLOUDIFY_SSL_TRUST_ALL=true;
Collecting https://github.com/cloudify-cosmo/cloudify-fabric-plugin/archive/1.3.1.zip (from -r /tmp/requirements_oUJf1I.txt (line 1))
Command 'pip install -r /tmp/requirements_oUJf1I.txt' executed with an error.
code: 2
error: Exception:
Traceback (most recent call last):
File "/opt/cfy/env/lib/python2.7/site-packages/pip/basecommand.py", line 209, in main
status = self.run(options, args)
File "/opt/cfy/env/lib/python2.7/site-packages/pip/commands/install.py", line 310, in run
wb.build(autobuilding=True)
File "/opt/cfy/env/lib/python2.7/site-packages/pip/wheel.py", line 748, in build
self.requirement_set.prepare_files(self.finder)
File "/opt/cfy/env/lib/python2.7/site-packages/pip/req/req_set.py", line 360, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/opt/cfy/env/lib/python2.7/site-packages/pip/req/req_set.py", line 577, in _prepare_file
session=self.session, hashes=hashes)
File "/opt/cfy/env/lib/python2.7/site-packages/pip/download.py", line 810, in unpack_url
hashes=hashes
File "/opt/cfy/env/lib/python2.7/site-packages/pip/download.py", line 649, in unpack_http_url
hashes)
File "/opt/cfy/env/lib/python2.7/site-packages/pip/download.py", line 842, in _download_http_url
stream=True,
File "/opt/cfy/env/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 480, in get
return self.request('GET', url, **kwargs)
File "/opt/cfy/env/lib/python2.7/site-packages/pip/download.py", line 378, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/opt/cfy/env/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 468, in request
resp = self.send(prep, **send_kwargs)
File "/opt/cfy/env/lib/python2.7/site-packages/pip/_vendor/requests/sessions.py", line 576, in send
r = adapter.send(request, **kwargs)
File "/opt/cfy/env/lib/python2.7/site-packages/pip/_vendor/cachecontrol/adapter.py", line 46, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "/opt/cfy/env/lib/python2.7/site-packages/pip/_vendor/requests/adapters.py", line 447, in send
raise SSLError(e, request=request)
SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:765)
output: None
It's hard to know what went wrong without looking at the blueprint and the inputs.yaml (after removing all credentials).
Without more data I would simply try to export
CLOUDIFY_SSL_TRUST_ALL=True;
Let me know if it works