atlassian-python-api icon indicating copy to clipboard operation
atlassian-python-api copied to clipboard

export_page is giving 404 error

Open hemaswapnika1 opened this issue 1 year ago • 2 comments

Code :

confluence = Confluence( url= atlassian_url, username=username, password=api_token, api_version="cloud" )

content = confluence.get_page_as_pdf(page_id)

        output_filename = "output.pdf"                                        
        with open(output_filename, "wb") as pdf_file:            
            pdf_file.write(content)            
            pdf_file.close()  

Error:

Traceback (most recent call last): File "/Users/xxxxx/iac/hackathon/confluence-export.py", line 24, in pdf_file.write(confluence.export_page("142186113")) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/atlassian/confluence.py", line 2568, in export_page return self.get_page_as_pdf(page_id) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/atlassian/confluence.py", line 2544, in get_page_as_pdf url = self.get_pdf_download_url_for_confluence_cloud(url) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/atlassian/confluence.py", line 2795, in get_pdf_download_url_for_confluence_cloud progress_response = self.get(poll_url) ^^^^^^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/atlassian/rest_client.py", line 288, in get response = self.request( ^^^^^^^^^^^^^ File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/atlassian/rest_client.py", line 260, in request self.raise_for_status(response) File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/atlassian/confluence.py", line 3243, in raise_for_status response.raise_for_status() File "/Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/requests/models.py", line 1021, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 404 Client Error: Not Found for url: https://xxxx.atlassian.net/wiki/services/api/v1/task/796721271/progress

When trying to access the url - https://xxx.atlassian.net/wiki/spaces/flyingpdf/pdfpageexport.action?pageId=791380304,

facing the following error:

Your request could not be processed because a required security token was not present in the request. You may need to re-submit the form or reload the page.

hemaswapnika1 avatar Jun 12 '24 05:06 hemaswapnika1

@hemaswapnika1 I can't reproduce, could you check again please on other page?

gonchik avatar Sep 15 '24 17:09 gonchik

For what it's worth, this can occur during an incident with the API, such as now.

https://confluence.status.atlassian.com/

Identified - We have identified an issue impacting the PDF Export v2 functionality. As a corrective measure, we have temporarily reverted the PDF export process to the v1 exporter. We are observing signs of recovery and will continue to monitor the situation closely. We will provide more details by early next week. Oct 04, 2024 - 05:00 UTC

catmeme avatar Oct 04 '24 18:10 catmeme

it was issue on cloud platform

gonchik avatar Mar 26 '25 13:03 gonchik