2

https://cloud.google.com/sdk/docs/quickstart-debian-ubuntu에 따라 Google Cloud SDK를 다운로드했습니다. 그리고 Google 음성 API는 https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/speech/cloud-client에 따라 다운로드했습니다. python transcribe.py resources/audio.raw를 실행하면 오류가 발생합니다. TransportError : HTTPSConnectionPool (host = 'accounts.google.com', port = 443) : url :/o/oauth2/token으로 최대 재시도 횟수를 초과했습니다 (SSLError (SSLError (1, u '[SSL :TransportError : HTTPSConnectionPool

트레이스 백 내가 우분투 모듈에 사용될 수있는 HTTPS 설치

E1019 18:46:20.868555489 3813 plugin_credentials.c:74] Getting metadata from plugin failed with error: Traceback (most recent call last): 
 
    File "src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi", line 154, in grpc._cython.cygrpc.plugin_get_metadata (src/python/grpcio/grpc/_cython/cygrpc.c:7054) 
 
    File "/home/pi/py2env/local/lib/python2.7/site-packages/grpc/_plugin_wrapping.py", line 106, in __call__ 
 
    AuthMetadataPluginCallback(wrapped_cygrpc_callback)) 
 
    File "/home/pi/py2env/local/lib/python2.7/site-packages/google/auth/transport/grpc.py", line 73, in __call__ 
 
    callback(self._get_authorization_headers(context), None) 
 
    File "/home/pi/py2env/local/lib/python2.7/site-packages/google/auth/transport/grpc.py", line 61, in _get_authorization_headers 
 
    headers) 
 
    File "/home/pi/py2env/local/lib/python2.7/site-packages/google/auth/credentials.py", line 121, in before_request 
 
    self.refresh(request) 
 
    File "/home/pi/py2env/local/lib/python2.7/site-packages/google/oauth2/credentials.py", line 117, in refresh 
 
    self._client_secret)) 
 
    File "/home/pi/py2env/local/lib/python2.7/site-packages/google/oauth2/_client.py", line 189, in refresh_grant 
 
    response_data = _token_endpoint_request(request, token_uri, body) 
 
    File "/home/pi/py2env/local/lib/python2.7/site-packages/google/oauth2/_client.py", line 104, in _token_endpoint_request 
 
    method='POST', url=token_uri, headers=headers, body=body) 
 
    File "/home/pi/py2env/local/lib/python2.7/site-packages/google/auth/transport/requests.py", line 115, in __call__ 
 
    raise exceptions.TransportError(exc) 
 
TransportError: HTTPSConnectionPool(host='accounts.google.com', port=443): Max retries exceeded with url: /o/oauth2/token (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)'),)) 
 

 
Traceback (most recent call last): 
 
    File "transcribe.py", line 94, in <module> 
 
    transcribe_file(args.path) 
 
    File "transcribe.py", line 52, in transcribe_file 
 
    response = client.recognize(config, audio) 
 
    File "/home/pi/py2env/local/lib/python2.7/site-packages/google/cloud/gapic/speech/v1/speech_client.py", line 201, in recognize 
 
    return self._recognize(request, options) 
 
    File "/home/pi/py2env/local/lib/python2.7/site-packages/google/gax/api_callable.py", line 452, in inner 
 
    return api_caller(api_call, this_settings, request) 
 
    File "/home/pi/py2env/local/lib/python2.7/site-packages/google/gax/api_callable.py", line 438, in base_caller 
 
    return api_call(*args) 
 
    File "/home/pi/py2env/local/lib/python2.7/site-packages/google/gax/api_callable.py", line 376, in inner 
 
    return a_func(*args, **kwargs) 
 
    File "/home/pi/py2env/local/lib/python2.7/site-packages/google/gax/retry.py", line 127, in inner 
 
    ' classified as transient', exception) 
 
google.gax.errors.RetryError: RetryError(Exception occurred in retry method that was not classified as transient, caused by <_Rendezvous of RPC that terminated with (StatusCode.UNAUTHENTICATED, Traceback (most recent call last): 
 
    File "src/python/grpcio/grpc/_cython/_cygrpc/credentials.pyx.pxi", line 154, in grpc._cython.cygrpc.plugin_get_metadata (src/python/grpcio/grpc/_cython/cygrpc.c:7054) 
 
    File "/home/pi/py2env/local/lib/python2.7/site-packages/grpc/_plugin_wrapping.py", line 106, in __call__ 
 
    AuthMetadataPluginCallback(wrapped_cygrpc_callback)) 
 
    File "/home/pi/py2env/local/lib/python2.7/site-packages/google/auth/transport/grpc.py", line 73, in __call__ 
 
    callback(self._get_authorization_headers(context), None) 
 
    File "/home/pi/py2env/local/lib/python2.7/site-packages/google/auth/transport/grpc.py", line 61, in _get_authorization_headers 
 
    headers) 
 
    File "/home/pi/py2env/local/lib/python2.7/site-packages/google/auth/credentials.py", line 121, in before_request 
 
    self.refresh(request) 
 
    File "/home/pi/py2env/local/lib/python2.7/site-packages/google/oauth2/credentials.py", line 117, in refresh 
 
    self._client_secret)) 
 
    File "/home/pi/py2env/local/lib/python2.7/site-packages/google/oauth2/_client.py", line 189, in refresh_grant 
 
    response_data = _token_endpoint_request(request, token_uri, body) 
 
    File "/home/pi/py2env/local/lib/python2.7/site-packages/google/oauth2/_client.py", line 104, in _token_endpoint_request 
 
    method='POST', url=token_uri, headers=headers, body=body) 
 
    File "/home/pi/py2env/local/lib/python2.7/site-packages/google/auth/transport/requests.py", line 115, in __call__ 
 
    raise exceptions.TransportError(exc) 
 
TransportError: HTTPSConnectionPool(host='accounts.google.com', port=443): Max retries exceeded with url: /o/oauth2/token (Caused by SSLError(SSLError(1, u'[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:581)'),)) 
 
)>)

이다)>)))) ' 을 : CERTIFICATE_VERIFY_FAILED] 인증 실패 (581 _ssl.c)를 확인 그래서이 오류가 발생하는 이유를 실제로 이해할 수 없습니다. Google Cloud API의 인증은 괜찮습니다. 어떤 종류의 오류인지 모릅니다. 어떻게 해결해야합니까?

+0

우분투의 어떤 버전에있는로 certifi 다운 그레이드했다? – snakecharmerb

+0

@snakecharmerb 우분투 16.04 (제니 알) LTS – user8504021

+0

시력 관련 https://stackoverflow.com/a/41221454/5320906 – snakecharmerb

답변

0

오래 된 버전의 openssl을 사용하는 것처럼 보이는 것 같습니다. CentOS 7에서 yum update openssl을 실행하고 here의 지침에 따라 버전 1.0.2로 업데이트하여이 문제를 해결했습니다.

또한, 젠투 리눅스 머신에서뿐만 아니라 나는 pip uninstall -y certifi && pip install certifi==2015.04.28

관련 문제