Replies: 2 comments
-
Btw this was baseten service which somehow causing timeout. Refer to this if you have an issue similar to this: https://baseten.help.usepylon.com/articles/2415834368-how-do-i-fix-the-proxy-connection-error-when-deploying-a-model-to-upload-images-to-s3-on-baseten |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have this script which will generate an audio file. However when i try to upload this file in baseTen server i get below error. Note: I have tried uploading in docker container in local and that works fine. Im only facing this in server
`Internal Server Error
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 666, in urlopen
httplib_response = self._make_request(
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 388, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/local/lib/python3.8/dist-packages/botocore/awsrequest.py", line 96, in request
rval = super().request(method, url, body, headers, *args, **kwargs)
File "/usr/lib/python3.8/http/client.py", line 1256, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.8/http/client.py", line 1302, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.8/http/client.py", line 1251, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.8/dist-packages/botocore/awsrequest.py", line 130, in _send_output
self._handle_expect_response(message_body)
File "/usr/local/lib/python3.8/dist-packages/botocore/awsrequest.py", line 169, in _handle_expect_response
maybe_status_line = fp.readline()
File "/usr/lib/python3.8/socket.py", line 669, in readinto
return self._sock.recv_into(b)
File "/usr/lib/python3.8/ssl.py", line 1270, in recv_into
return self.read(nbytes, buffer)
File "/usr/lib/python3.8/ssl.py", line 1128, 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 "/usr/local/lib/python3.8/dist-packages/botocore/httpsession.py", line 464, in send
urllib_response = conn.urlopen(
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 720, in urlopen
retries = retries.increment(
File "/usr/lib/python3/dist-packages/urllib3/util/retry.py", line 376, in increment
raise six.reraise(type(error), error, _stacktrace)
File "/usr/lib/python3/dist-packages/six.py", line 702, in reraise
raise value.with_traceback(tb)
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 666, in urlopen
httplib_response = self._make_request(
File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 388, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/usr/local/lib/python3.8/dist-packages/botocore/awsrequest.py", line 96, in request
rval = super().request(method, url, body, headers, *args, **kwargs)
File "/usr/lib/python3.8/http/client.py", line 1256, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/usr/lib/python3.8/http/client.py", line 1302, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/usr/lib/python3.8/http/client.py", line 1251, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/usr/local/lib/python3.8/dist-packages/botocore/awsrequest.py", line 130, in _send_output
self._handle_expect_response(message_body)
File "/usr/local/lib/python3.8/dist-packages/botocore/awsrequest.py", line 169, in _handle_expect_response
maybe_status_line = fp.readline()
File "/usr/lib/python3.8/socket.py", line 669, in readinto
return self._sock.recv_into(b)
File "/usr/lib/python3.8/ssl.py", line 1270, in recv_into
return self.read(nbytes, buffer)
File "/usr/lib/python3.8/ssl.py", line 1128, in read
return self._sslobj.read(len, buffer)
urllib3.exceptions.ProxyError: ('Cannot connect to proxy.', timeout('The read operation timed out'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/app/common/errors.py", line 168, in inner_sync
return func(*args, **kwargs)
File "/app/model/model.py", line 77, in predict
self.s3_client.put_object(Bucket=self.bucket_name, Key=f'{filename}.mp3', Body=wav)
File "/usr/local/lib/python3.8/dist-packages/botocore/client.py", line 569, in _api_call
return self._make_api_call(operation_name, kwargs)
File "/usr/local/lib/python3.8/dist-packages/botocore/client.py", line 1005, in _make_api_call
http, parsed_response = self._make_request(
File "/usr/local/lib/python3.8/dist-packages/botocore/client.py", line 1029, in _make_request
return self._endpoint.make_request(operation_model, request_dict)
File "/usr/local/lib/python3.8/dist-packages/botocore/endpoint.py", line 119, in make_request
return self._send_request(request_dict, operation_model)
File "/usr/local/lib/python3.8/dist-packages/botocore/endpoint.py", line 200, in _send_request
while self._needs_retry(
File "/usr/local/lib/python3.8/dist-packages/botocore/endpoint.py", line 360, in _needs_retry
responses = self._event_emitter.emit(
File "/usr/local/lib/python3.8/dist-packages/botocore/hooks.py", line 412, in emit
return self._emitter.emit(aliased_event_name, **kwargs)
File "/usr/local/lib/python3.8/dist-packages/botocore/hooks.py", line 256, in emit
return self._emit(event_name, kwargs)
File "/usr/local/lib/python3.8/dist-packages/botocore/hooks.py", line 239, in _emit
response = handler(**kwargs)
File "/usr/local/lib/python3.8/dist-packages/botocore/retryhandler.py", line 207, in call
if self._checker(**checker_kwargs):
File "/usr/local/lib/python3.8/dist-packages/botocore/retryhandler.py", line 284, in call
should_retry = self._should_retry(
File "/usr/local/lib/python3.8/dist-packages/botocore/retryhandler.py", line 320, in _should_retry
return self._checker(attempt_number, response, caught_exception)
File "/usr/local/lib/python3.8/dist-packages/botocore/retryhandler.py", line 363, in call
checker_response = checker(
File "/usr/local/lib/python3.8/dist-packages/botocore/retryhandler.py", line 247, in call
return self._check_caught_exception(
File "/usr/local/lib/python3.8/dist-packages/botocore/retryhandler.py", line 416, in _check_caught_exception
raise caught_exception
File "/usr/local/lib/python3.8/dist-packages/botocore/endpoint.py", line 279, in _do_get_response
http_response = self._send(request)
File "/usr/local/lib/python3.8/dist-packages/botocore/endpoint.py", line 383, in _send
return self.http_session.send(request)
File "/usr/local/lib/python3.8/dist-packages/botocore/httpsession.py", line 495, in send
raise ProxyConnectionError(
botocore.exceptions.ProxyConnectionError: Failed to connect to proxy URL: "http://127.0.0.1:3128"`
Below is the code used
`s3_session = Session(aws_access_key_id=self._secrets["AWS_ACCESS_KEY"],aws_secret_access_key=self._secrets["AWS_SECRET_KEY"])
self.s3_client = s3_session.client('s3',region_name='us-east-1')
cors_configuration = {
'CORSRules': [{
'AllowedHeaders': ['Authorization'],
'AllowedMethods': ['GET', 'PUT'],
'AllowedOrigins': ['*'],
'ExposeHeaders': ['ETag', 'x-amz-request-id'],
'MaxAgeSeconds': 3000
}]
}
self.s3_client.put_object(Bucket=self.bucket_name, Key=f'{filename}.mp3', Body=wav)`
Any help is appreciating 🙏
Beta Was this translation helpful? Give feedback.
All reactions