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

ai_dubs: Getting SSL error when uploading to bucket #33

Open
twonius opened this issue Apr 28, 2021 · 3 comments
Open

ai_dubs: Getting SSL error when uploading to bucket #33

twonius opened this issue Apr 28, 2021 · 3 comments

Comments

@twonius
Copy link

twonius commented Apr 28, 2021

I'm getting the following error when trying to upload to the bucket

it seems to be complaining about max retries exceeded. At first i thought this could be an issue with my .json key but the path in the environment variable there looks fine.

do i need to separately install open ssl like I did for ffmpeg?

stack trace below:

`Transcribing audio
Uploading to the cloud...
Traceback (most recent call last):
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 394, in _make_request
conn.request(method, url, **httplib_request_kw)
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connection.py", line 234, in request
super(HTTPConnection, self).request(method, url, body=body, headers=headers)
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\http\client.py", line 1253, in request
self._send_request(method, url, body, headers, encode_chunked)
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\http\client.py", line 1299, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\http\client.py", line 1248, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\http\client.py", line 1047, in _send_output
self.send(chunk)
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\http\client.py", line 969, in send
self.sock.sendall(data)
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\ssl.py", line 1204, in sendall
v = self.send(byte_view[count:])
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\ssl.py", line 1173, in send
return self._sslobj.write(data)
ssl.SSLWantWriteError: The operation did not complete (write) (_ssl.c:2477)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\adapters.py", line 439, in send resp = conn.urlopen(
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\site-packages\urllib3\util\retry.py", line 573, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='storage.googleapis.com', port=443): Max retries exceeded with url: /upload/storage/v1/b/ppc-video/o?uploadType=resumable&upload_id=ABg5-UxHTYHlMAmIxsMZIRV7Lh98eNQRyy3T4GR9ZRPy8xBQ4cKPsPQZyGq-0USNWO8kR-VKjsgEvzrIHsX3Dq5rkjYT_Koihw (Caused by SSLError(SSLWantWriteError(3, 'The operation did not complete (write) (_ssl.c:2477)')))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\anton\Documents\GitHub\making_with_ml\ai_dubs\dubber.py", line 531, in
fire.Fire(dub)
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\site-packages\fire\core.py", line 138, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\site-packages\fire\core.py", line 463, in _Fire
component, remaining_args = _CallAndUpdateTrace(
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\site-packages\fire\core.py", line 672, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "C:\Users\anton\Documents\GitHub\making_with_ml\ai_dubs\dubber.py", line 447, in dub
blob.upload_from_filename(os.path.join(
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\site-packages\google\cloud\storage\blob.py", line 2460, in upload_from_filename
self.upload_from_file(
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\site-packages\google\cloud\storage\blob.py", line 2343, in upload_from_file
created_json = self._do_upload(
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\site-packages\google\cloud\storage\blob.py", line 2180, in _do_upload
response = self._do_resumable_upload(
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\site-packages\google\cloud\storage\blob.py", line 2041, in _do_resumable_upload
response = upload.transmit_next_chunk(transport, timeout=timeout)
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\site-packages\google\resumable_media\requests\upload.py", line 496, in transmit_next_chunk
response = _request_helpers.http_request(
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\site-packages\google\resumable_media\requests_request_helpers.py", line 136, in http_request
return _helpers.wait_and_retry(func, RequestsMixin._get_status_code, retry_strategy)
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\site-packages\google\resumable_media_helpers.py", line 186, in wait_and_retry
raise error
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\site-packages\google\resumable_media_helpers.py", line 175, in wait_and_retry
response = func()
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\site-packages\google\auth\transport\requests.py", line 464, in request
response = super(AuthorizedSession, self).request(
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\sessions.py", line 655, in send r = adapter.send(request, **kwargs)
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\site-packages\requests\adapters.py", line 514, in send raise SSLError(e, request=request)
requests.exceptions.SSLError: HTTPSConnectionPool(host='storage.googleapis.com', port=443): Max retries exceeded with url: /upload/storage/v1/b/ppc-video/o?uploadType=resumable&upload_id=ABg5-UxHTYHlMAmIxsMZIRV7Lh98eNQRyy3T4GR9ZRPy8xBQ4cKPsPQZyGq-0USNWO8kR-VKjsgEvzrIHsX3Dq5rkjYT_Koihw (Caused by SSLError(SSLWantWriteError(3, 'The operation did not complete (write) (_ssl.c:2477)')))`

@dalequark
Copy link
Contributor

I don't know the answer to this, but if you do install SSL separately and it works, could you let me know? :)

@twonius
Copy link
Author

twonius commented Apr 28, 2021

installing ssl throws an error because it looks like that module was made for python2 but it's now included in 3
https://stackoverflow.com/questions/56135959/having-trouble-installing-ssl-on-pc-using-pip-install
I can import ssl without errors though so it seems to be ok in my installation

@twonius
Copy link
Author

twonius commented Apr 28, 2021

I tried with a much smaller video file (about 1Mb) and was able to get it to upload without failing but now I'm just a bit further. It now complains about the wav file's path. I'm not sure if this is a windows issue here since the / \ is inconsistent.

The file itself is in my bucket though

google.api_core.exceptions.InvalidArgument: 400 Audio URI gs://ppc-video\tmp\a2743896-6b2c-4d1c-b286-cd658ca09c7e.wav is an invalid GCS path.

Console Output:
Transcribing...
Diarizing: False
Traceback (most recent call last):
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\site-packages\google\api_core\grpc_helpers.py", line 57, in error_remapped_callable
return callable_(*args, **kwargs)
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\site-packages\grpc_channel.py", line 923, in call
return _end_unary_response_blocking(state, call, False, None)
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\site-packages\grpc_channel.py", line 826, in _end_unary_response_blocking
raise _InactiveRpcError(state)
grpc._channel._InactiveRpcError: <_InactiveRpcError of RPC that terminated with:
status = StatusCode.INVALID_ARGUMENT
details = "Audio URI gs://ppc-video\tmp\a2743896-6b2c-4d1c-b286-cd658ca09c7e.wav is an invalid GCS path."
debug_error_string = "{"created":"@1619637684.712000000","description":"Error received from peer ipv6:[2607:f8b0:4007:80f::200a]:443","file":"src/core/lib/surface/call.cc","file_line":1063,"grpc_message":"Audio URI gs://ppc-video\tmp\a2743896-6b2c-4d1c-b286-cd658ca09c7e.wav is an invalid GCS path.","grpc_status":3}"

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\anton\Documents\GitHub\making_with_ml\ai_dubs\dubber.py", line 531, in
fire.Fire(dub)
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\site-packages\fire\core.py", line 138, in Fire
component_trace = _Fire(component, args, parsed_flag_args, context, name)
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\site-packages\fire\core.py", line 463, in _Fire
component, remaining_args = _CallAndUpdateTrace(
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\site-packages\fire\core.py", line 672, in _CallAndUpdateTrace
component = fn(*varargs, **kwargs)
File "C:\Users\anton\Documents\GitHub\making_with_ml\ai_dubs\dubber.py", line 451, in dub
transcripts = get_transcripts_json(os.path.join(
File "C:\Users\anton\Documents\GitHub\making_with_ml\ai_dubs\dubber.py", line 113, in get_transcripts_json
res = client.long_running_recognize(config=config, audio=audio).result()
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\site-packages\google\cloud\speech_v1p1beta1\services\speech\client.py", line 457, in long_running_recognize
response = rpc(request, retry=retry, timeout=timeout, metadata=metadata,)
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\site-packages\google\api_core\gapic_v1\method.py", line 145, in call
return wrapped_func(*args, **kwargs)
File "C:\Users\anton\AppData\Local\Programs\Python\Python39\lib\site-packages\google\api_core\grpc_helpers.py", line 59, in error_remapped_callable
six.raise_from(exceptions.from_grpc_error(exc), exc)
File "", line 3, in raise_from
google.api_core.exceptions.InvalidArgument: 400 Audio URI gs://ppc-video\tmp\a2743896-6b2c-4d1c-b286-cd658ca09c7e.wav is an invalid GCS path.

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