Skip to main content
Participant
July 4, 2023
Question

SdkException("Exception in fetching access token", sys.exc_info())

  • July 4, 2023
  • 2 replies
  • 1284 views

Hi everyone,

 

Icannot run example code, getting this error.

Can anyone tell me what an issue is? thanks

 

ERROR:root:Exception encountered while executing operation
Traceback (most recent call last):
File "C:\Users\iaskarov\AppData\Local\Programs\Python\Python38\lib\site-packages\adobe\pdfservices\operation\internal\auth\service_principal_authenticator.py", line 68, in refresh_token
response = http_client.process_request(http_request=http_request, success_status_codes=[HTTPStatus.OK],
File "C:\Users\iaskarov\AppData\Local\Programs\Python\Python38\lib\site-packages\adobe\pdfservices\operation\internal\http\http_client.py", line 38, in process_request
if _handle_response_and_retry(response, success_status_codes,
File "C:\Users\iaskarov\AppData\Local\Programs\Python\Python38\lib\site-packages\adobe\pdfservices\operation\internal\http\http_client.py", line 95, in _handle_response_and_retry
should_retry = ResponseUtil.handle_api_failures(response, request_key, is_ims_api)
File "C:\Users\iaskarov\AppData\Local\Programs\Python\Python38\lib\site-packages\adobe\pdfservices\operation\internal\http\response_util.py", line 76, in handle_api_failures
return ResponseUtil.handle_cpf_error_response(response)
File "C:\Users\iaskarov\AppData\Local\Programs\Python\Python38\lib\site-packages\adobe\pdfservices\operation\internal\http\response_util.py", line 141, in handle_cpf_error_response
raise OperationException(message="Error response received for request",
adobe.pdfservices.operation.internal.exceptions.OperationException

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:/Users/iaskarov/PycharmProjects/pdfservices-python-sdk-samples/src/extractpdf/extract_txt_from_pdf.py", line 49, in <module>
result: FileRef = extract_pdf_operation.execute(execution_context)
File "C:\Users\iaskarov\AppData\Local\Programs\Python\Python38\lib\site-packages\adobe\pdfservices\operation\pdfops\extract_pdf_operation.py", line 153, in execute
raise ex
File "C:\Users\iaskarov\AppData\Local\Programs\Python\Python38\lib\site-packages\adobe\pdfservices\operation\pdfops\extract_pdf_operation.py", line 141, in execute
download_uri = ExtractPDFService.extract_pdf(execution_context, self._source_file_ref, self.get_options(),
File "C:\Users\iaskarov\AppData\Local\Programs\Python\Python38\lib\site-packages\adobe\pdfservices\operation\internal\service\extract_pdf_service.py", line 44, in extract_pdf
raise e
File "C:\Users\iaskarov\AppData\Local\Programs\Python\Python38\lib\site-packages\adobe\pdfservices\operation\internal\service\extract_pdf_service.py", line 29, in extract_pdf
get_upload_uri_response = StorageApi.get_upload_uri(context, source_file_ref.get_media_type(), x_request_id)
File "C:\Users\iaskarov\AppData\Local\Programs\Python\Python38\lib\site-packages\adobe\pdfservices\operation\internal\api\storage_api.py", line 72, in get_upload_uri
response = http_client.process_request(http_request=http_request,
File "C:\Users\iaskarov\AppData\Local\Programs\Python\Python38\lib\site-packages\adobe\pdfservices\operation\internal\http\http_client.py", line 31, in process_request
access_token = http_request.authenticator.session_token().access_token
File "C:\Users\iaskarov\AppData\Local\Programs\Python\Python38\lib\site-packages\adobe\pdfservices\operation\internal\auth\service_principal_authenticator.py", line 49, in session_token
return self.refresh_token()
File "C:\Users\iaskarov\AppData\Local\Programs\Python\Python38\lib\site-packages\adobe\pdfservices\operation\internal\auth\service_principal_authenticator.py", line 74, in refresh_token
raise SdkException("Exception in fetching access token", sys.exc_info())
adobe.pdfservices.operation.exception.exceptions.SdkException: description =Exception in fetching access token, requestTrackingId=(<class 'adobe.pdfservices.operation.internal.exceptions.OperationException'>, OperationException(), <traceback object at 0x00000282009897C0>)

    This topic has been closed for replies.

    2 replies

    Participant
    March 15, 2024

    Same issue too

    Participant
    August 30, 2023

    Same issue. Did you figure out the reason?