Ref: https://forum.aspose.cloud/t/error-from-aspose-api-conversion-to-pdf/2182
Following the issue detailed in the reference ticket, we changed our code to use the latest Cloud SDK.
It was working for a few days.
But starting today, we are again seeing the same error message. Please take a look and help us resolve this issue once and for all. We are nearing a production install date.
Please find the log extract below:
DEBUG:SAM-Quote:eSignature for quote france,Product01,201809000555, converting to PDF /tmp/tmpaMWZ_d/proposal-fca716ea-c8d7-43fc-b81d-04d9c6cbe5e5/Standard_Proposal_201809000555/Standard_Bulletin_de_souscription_201809000555.docx
INFO:SAM-Quote:Aspose: Converting file '/tmp/tmpaMWZ_d/proposal-fca716ea-c8d7-43fc-b81d-04d9c6cbe5e5/Standard_Proposal_201809000555/Standard_Bulletin_de_souscription_201809000555.docx' to PDF
{"timestamp": "2018-09-20T08:45:32.617137Z", "message": "eSignature for quote france,Product01,201809000555, document generated (146460 bytes)", "level": "DEBUG"}
{"timestamp": "2018-09-20T08:45:32.617499Z", "message": "eSignature for quote france,Product01,201809000555, converting to PDF /tmp/tmpaMWZ_d/proposal-fca716ea-c8d7-43fc-b81d-04d9c6cbe5e5/Standard_Proposal_201809000555/Standard_Bulletin_de_souscription_201809000555.docx", "level": "DEBUG"}
proposal: convert_document_to_pdf
proposal: PDF path: /tmp/tmpaMWZ_d/proposal-fca716ea-c8d7-43fc-b81d-04d9c6cbe5e5/Standard_Proposal_201809000555/Standard_Bulletin_de_souscription_201809000555.pdf
aspose: convert_docx_to_pdf
{"timestamp": "2018-09-20T08:45:32.617697Z", "message": "Aspose: Converting file '/tmp/tmpaMWZ_d/proposal-fca716ea-c8d7-43fc-b81d-04d9c6cbe5e5/Standard_Proposal_201809000555/Standard_Bulletin_de_souscription_201809000555.docx' to PDF", "level": "INFO"}
TMPDIR: /tmp/tmpznh0Rx
Ensuring reference index
[2018-09-20 08:45:34,360] ERROR in app: Exception on /sign-documents [GET]
Traceback (most recent call last):
File "/quofeb/venv/local/lib/python2.7/site-packages/flask/app.py", line 1982, in wsgi_app
response = self.full_dispatch_request()
File "/quofeb/venv/local/lib/python2.7/site-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/quofeb/venv/local/lib/python2.7/site-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/quofeb/venv/local/lib/python2.7/site-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/quofeb/venv/local/lib/python2.7/site-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./ui/server.py", line 237, in wrapper
return func(*args, **kwargs)
File "./ui/server.py", line 6400, in get_sign_documents
document_path = proposal.convert_document_to_pdf(document_path)
File "./proposal/proposal.py", line 153, in convert_document_to_pdf
aspose.convert_docx_to_pdf(docx_path, pdf_path)
File "./ui/aspose.py", line 78, in convert_docx_to_pdf
response_path = wordsApi.get_document_with_format(request)
File "/quofeb/venv/local/lib/python2.7/site-packages/asposewordscloud/apis/words_api.py", line 6564, in get_document_with_format
self.__refresh_token()
File "/quofeb/venv/local/lib/python2.7/site-packages/asposewordscloud/apis/words_api.py", line 16830, in __refresh_token
files={}, _return_http_data_only=True)
File "/quofeb/venv/local/lib/python2.7/site-packages/asposewordscloud/api_client.py", line 331, in call_api
_preload_content, _request_timeout)
File "/quofeb/venv/local/lib/python2.7/site-packages/asposewordscloud/api_client.py", line 167, in __call_api
_request_timeout=_request_timeout)
File "/quofeb/venv/local/lib/python2.7/site-packages/asposewordscloud/api_client.py", line 374, in request
body=body)
File "/quofeb/venv/local/lib/python2.7/site-packages/asposewordscloud/rest.py", line 284, in POST
body=body)
File "/quofeb/venv/local/lib/python2.7/site-packages/asposewordscloud/rest.py", line 237, in request
raise ApiException(http_resp=r)
ApiException: (400)
Reason: Bad Request
HTTP response headers: HTTPHeaderDict({'Content-Length': '25', 'X-Powered-By': 'ASP.NET', 'Expires': '-1', 'Server': 'Microsoft-IIS/10.0', 'Connection': 'keep-alive', 'Pragma': 'no-cache', 'Cache-Control': 'no-cache', 'Date': 'Thu, 20 Sep 2018 08:45:34 GMT', 'Content-Type': 'application/json;charset=UTF-8'})
HTTP response body: {"error":"invalid_grant"}
ERROR:SAM-Quote:Internal error: Traceback (most recent call last):
File "/quofeb/venv/local/lib/python2.7/site-packages/flask/app.py", line 1982, in wsgi_app
{"timestamp": "2018-09-20T08:45:34.368728Z", "message": "Internal error: Traceback (most recent call last):\n File \"/quofeb/venv/local/lib/python2.7/site-packages/flask/app.py\", line 1982, in wsgi_app\n response = self.full_dispatch_request()\n File \"/quofeb/venv/local/lib/python2.7/site-packages/flask/app.py\", line 1614, in full_dispatch_request\n rv = self.handle_user_exception(e)\n File \"/quofeb/venv/local/lib/python2.7/site-packages/flask/app.py\", line 1517, in handle_user_exception\n reraise(exc_type, exc_value, tb)\n File \"/quofeb/venv/local/lib/python2.7/site-packages/flask/app.py\", line 1612, in full_dispatch_request\n rv = self.dispatch_request()\n File \"/quofeb/venv/local/lib/python2.7/site-packages/flask/app.py\", line 1598, in dispatch_request\n return self.view_functions[rule.endpoint](**req.view_args)\n File \"./ui/server.py\", line 237, in wrapper\n return func(*args, **kwargs)\n File \"./ui/server.py\", line 6400, in get_sign_documents\n document_path = proposal.convert_document_to_pdf(document_path)\n File \"./proposal/proposal.py\", line 153, in convert_document_to_pdf\n aspose.convert_docx_to_pdf(docx_path, pdf_path)\n File \"./ui/aspose.py\", line 78, in convert_docx_to_pdf\n response_path = wordsApi.get_document_with_format(request)\n File \"/quofeb/venv/local/lib/python2.7/site-packages/asposewordscloud/apis/words_api.py\", line 6564, in get_document_with_format\n self.__refresh_token()\n File \"/quofeb/venv/local/lib/python2.7/site-packages/asposewordscloud/apis/words_api.py\", line 16830, in __refresh_token\n files={}, _return_http_data_only=True)\n File \"/quofeb/venv/local/lib/python2.7/site-packages/asposewordscloud/api_client.py\", line 331, in call_api\n _preload_content, _request_timeout)\n File \"/quofeb/venv/local/lib/python2.7/site-packages/asposewordscloud/api_client.py\", line 167, in __call_api\n _request_timeout=_request_timeout)\n File \"/quofeb/venv/local/lib/python2.7/site-packages/asposewordscloud/api_client.py\
", line 374, in request\n body=body)\n File \"/quofeb/venv/local/lib/python2.7/site-packages/asposewordscloud/rest.py\", line 284, in POST\n body=body)\n File \"/quofeb/venv/local/lib/python2.7/site-packages/asposewordscloud/rest.py\", line 237, in request\n raise ApiException(http_resp=r)\nApiException: (400)\nReason: Bad Request\nHTTP response headers: HTTPHeaderDict({'Content-Length': '25', 'X-Powered-By': 'ASP.NET', 'Expires': '-1', 'Server': 'Microsoft-IIS/10.0', 'Connection': 'keep-alive', 'Pragma': 'no-cache', 'Cache-Control': 'no-cache', 'Date': 'Thu, 20 Sep 2018 08:45:34 GMT', 'Content-Type': 'application/json;charset=UTF-8'})\nHTTP response body: {\"error\":\"invalid_grant\"}\n\n", "level": "ERROR"}
response = self.full_dispatch_request()
File "/quofeb/venv/local/lib/python2.7/site-packages/flask/app.py", line 1614, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/quofeb/venv/local/lib/python2.7/site-packages/flask/app.py", line 1517, in handle_user_exception
reraise(exc_type, exc_value, tb)
File "/quofeb/venv/local/lib/python2.7/site-packages/flask/app.py", line 1612, in full_dispatch_request
rv = self.dispatch_request()
File "/quofeb/venv/local/lib/python2.7/site-packages/flask/app.py", line 1598, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "./ui/server.py", line 237, in wrapper
return func(*args, **kwargs)
File "./ui/server.py", line 6400, in get_sign_documents
document_path = proposal.convert_document_to_pdf(document_path)
File "./proposal/proposal.py", line 153, in convert_document_to_pdf
aspose.convert_docx_to_pdf(docx_path, pdf_path)
File "./ui/aspose.py", line 78, in convert_docx_to_pdf
response_path = wordsApi.get_document_with_format(request)
File "/quofeb/venv/local/lib/python2.7/site-packages/asposewordscloud/apis/words_api.py", line 6564, in get_document_with_format
self.__refresh_token()
File "/quofeb/venv/local/lib/python2.7/site-packages/asposewordscloud/apis/words_api.py", line 16830, in __refresh_token
files={}, _return_http_data_only=True)
File "/quofeb/venv/local/lib/python2.7/site-packages/asposewordscloud/api_client.py", line 331, in call_api
_preload_content, _request_timeout)
File "/quofeb/venv/local/lib/python2.7/site-packages/asposewordscloud/api_client.py", line 167, in __call_api
_request_timeout=_request_timeout)
File "/quofeb/venv/local/lib/python2.7/site-packages/asposewordscloud/api_client.py", line 374, in request
body=body)
File "/quofeb/venv/local/lib/python2.7/site-packages/asposewordscloud/rest.py", line 284, in POST
body=body)
File "/quofeb/venv/local/lib/python2.7/site-packages/asposewordscloud/rest.py", line 237, in request
raise ApiException(http_resp=r)
ApiException: (400)
Reason: Bad Request
HTTP response headers: HTTPHeaderDict({'Content-Length': '25', 'X-Powered-By': 'ASP.NET', 'Expires': '-1', 'Server': 'Microsoft-IIS/10.0', 'Connection': 'keep-alive', 'Pragma': 'no-cache', 'Cache-Control': 'no-cache', 'Date': 'Thu, 20 Sep 2018 08:45:34 GMT', 'Content-Type': 'application/json;charset=UTF-8'})
HTTP response body: {"error":"invalid_grant"}
None