• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Timeout error in python read pdf

New Here ,
Oct 17, 2022 Oct 17, 2022

Copy link to clipboard

Copied

I am using standard python code (with AWS adobe API) to extract text and tables. My pdf is about 19MB (much lessr than the limit specified. I am getting timeout. Can you please help? 

 

INFO:adobe.pdfservices.operation.pdfops.extract_pdf_operation:All validations successfully done. Beginning ExtractPDF operation execution
ERROR:root:Exception encountered while executing operation
Traceback (most recent call last):
File "C:\Users\milin\Anaconda3\envs\nlp_dev38\lib\site-packages\urllib3\connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "C:\Users\milin\Anaconda3\envs\nlp_dev38\lib\site-packages\urllib3\connectionpool.py", line 394, in _make_request
conn.request(method, url, **httplib_request_kw)
File "C:\Users\milin\Anaconda3\envs\nlp_dev38\lib\site-packages\urllib3\connection.py", line 234, in request
super(HTTPConnection, self).request(method, url, body=body, headers=headers)
File "C:\Users\milin\Anaconda3\envs\nlp_dev38\lib\http\client.py", line 1256, in request
self._send_request(method, url, body, headers, encode_chunked)
File "C:\Users\milin\Anaconda3\envs\nlp_dev38\lib\http\client.py", line 1302, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "C:\Users\milin\Anaconda3\envs\nlp_dev38\lib\http\client.py", line 1251, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "C:\Users\milin\Anaconda3\envs\nlp_dev38\lib\http\client.py", line 1050, in _send_output
self.send(chunk)
File "C:\Users\milin\Anaconda3\envs\nlp_dev38\lib\http\client.py", line 972, in send
self.sock.sendall(data)
File "C:\Users\milin\Anaconda3\envs\nlp_dev38\lib\ssl.py", line 1204, in sendall
v = self.send(byte_view[count:])
File "C:\Users\milin\Anaconda3\envs\nlp_dev38\lib\ssl.py", line 1173, in send
return self._sslobj.write(data)
socket.timeout: The write operation timed out

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\milin\Anaconda3\envs\nlp_dev38\lib\site-packages\requests\adapters.py", line 439, in send
resp = conn.urlopen(
File "C:\Users\milin\Anaconda3\envs\nlp_dev38\lib\site-packages\urllib3\connectionpool.py", line 755, in urlopen
retries = retries.increment(
File "C:\Users\milin\Anaconda3\envs\nlp_dev38\lib\site-packages\urllib3\util\retry.py", line 531, in increment
raise six.reraise(type(error), error, _stacktrace)
File "C:\Users\milin\Anaconda3\envs\nlp_dev38\lib\site-packages\urllib3\packages\six.py", line 734, in reraise
raise value.with_traceback(tb)
File "C:\Users\milin\Anaconda3\envs\nlp_dev38\lib\site-packages\urllib3\connectionpool.py", line 699, in urlopen
httplib_response = self._make_request(
File "C:\Users\milin\Anaconda3\envs\nlp_dev38\lib\site-packages\urllib3\connectionpool.py", line 394, in _make_request
conn.request(method, url, **httplib_request_kw)
File "C:\Users\milin\Anaconda3\envs\nlp_dev38\lib\site-packages\urllib3\connection.py", line 234, in request
super(HTTPConnection, self).request(method, url, body=body, headers=headers)
File "C:\Users\milin\Anaconda3\envs\nlp_dev38\lib\http\client.py", line 1256, in request
self._send_request(method, url, body, headers, encode_chunked)
File "C:\Users\milin\Anaconda3\envs\nlp_dev38\lib\http\client.py", line 1302, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "C:\Users\milin\Anaconda3\envs\nlp_dev38\lib\http\client.py", line 1251, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "C:\Users\milin\Anaconda3\envs\nlp_dev38\lib\http\client.py", line 1050, in _send_output
self.send(chunk)
File "C:\Users\milin\Anaconda3\envs\nlp_dev38\lib\http\client.py", line 972, in send
self.sock.sendall(data)
File "C:\Users\milin\Anaconda3\envs\nlp_dev38\lib\ssl.py", line 1204, in sendall
v = self.send(byte_view[count:])
File "C:\Users\milin\Anaconda3\envs\nlp_dev38\lib\ssl.py", line 1173, in send
return self._sslobj.write(data)
urllib3.exceptions.ProtocolError: ('Connection aborted.', timeout('The write operation timed out'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\milin\Anaconda3\envs\nlp_dev38\lib\site-packages\adobe\pdfservices\operation\internal\http\http_client.py", line 70, in _execute_request
response = requests.post(url=http_request.url,
File "C:\Users\milin\Anaconda3\envs\nlp_dev38\lib\site-packages\requests\api.py", line 119, in post
return request('post', url, data=data, json=json, **kwargs)
File "C:\Users\milin\Anaconda3\envs\nlp_dev38\lib\site-packages\requests\api.py", line 61, in request
return session.request(method=method, url=url, **kwargs)
File "C:\Users\milin\Anaconda3\envs\nlp_dev38\lib\site-packages\requests\sessions.py", line 542, in request
resp = self.send(prep, **send_kwargs)
File "C:\Users\milin\Anaconda3\envs\nlp_dev38\lib\site-packages\requests\sessions.py", line 655, in send
r = adapter.send(request, **kwargs)
File "C:\Users\milin\Anaconda3\envs\nlp_dev38\lib\site-packages\requests\adapters.py", line 498, in send
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', timeout('The write operation timed out'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "c:\users\milin\nlp\read pdf\adobe-dc-pdf-services-sdk-extract-python-samples\src\extractpdf\milind_extract_info_from_pdf.py", line 61, in <module>
result: FileRef = extract_pdf_operation.execute(execution_context)
File "C:\Users\milin\Anaconda3\envs\nlp_dev38\lib\site-packages\adobe\pdfservices\operation\pdfops\extract_pdf_operation.py", line 131, in execute
location = ExtractPDFAPI.extract_pdf(execution_context, self._source_file_ref, self._extract_pdf_options)
File "C:\Users\milin\Anaconda3\envs\nlp_dev38\lib\site-packages\adobe\pdfservices\operation\internal\service\extract_pdf_api.py", line 42, in extract_pdf
location = CPFApi.cpf_create_ops_api(context, cpf_content_analyzer_req, [file_ref],
File "C:\Users\milin\Anaconda3\envs\nlp_dev38\lib\site-packages\adobe\pdfservices\operation\internal\api\cpf_api.py", line 63, in cpf_create_ops_api
response = http_client.process_request(http_request=http_request,
File "C:\Users\milin\Anaconda3\envs\nlp_dev38\lib\site-packages\adobe\pdfservices\operation\internal\http\http_client.py", line 41, in process_request
response = _execute_request(http_request)
File "C:\Users\milin\Anaconda3\envs\nlp_dev38\lib\site-packages\adobe\pdfservices\operation\internal\http\http_client.py", line 81, in _execute_request
raise SdkException("Request could not be completed. Possible cause attached!", sys.exc_info())
adobe.pdfservices.operation.exception.exceptions.SdkException: description =Request could not be completed. Possible cause attached!, requestTrackingId=(<class 'requests.exceptions.ConnectionError'>, ConnectionError(ProtocolError('Connection aborted.', timeout('The write operation timed out'))), <traceback object at 0x0000024BEEE09EC0>)

TOPICS
Bug

Views

801

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Oct 17, 2022 Oct 17, 2022

Copy link to clipboard

Copied

Moderator: product is Document Services APIs

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Oct 17, 2022 Oct 17, 2022

Copy link to clipboard

Copied

LATEST

@Milind26409349akw5 

 

I've moved your post from Using the Community (for questions about the forums) to Document Services APIs, as per @Test Screen Name 's post.

 

Jane

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources