Select to view content in your preferred language

Survey123 pdf reports generated with Python API are suddenly being corrupted

112
2
Jump to solution
4 weeks ago
AngusWarfieldMc
Occasional Contributor

Hi,

I have a python script that is run weekly to generate pdf reports from a survey123 form. 

Just in the last 2 weeks the pdf files created from the script are being corrupted. Pdf files are still generated, but they are all 71kb in size and cannot be opened in Adobe or the browser. Normally these would be between 5-10MB. 

I can generate reports using the same filters and templates via the Survey123 website without issue. Each report takes about 2 mins to generate, so not hitting the 10 minute timeout. 

There have been no changes to my source code, GIS infrastructure, survey form or templates. Everything is hosted via our enterprise portal and we did experience some server downtime around the same time the issues began to occur, however this has happened before to no effect. 

Has anyone encountered something similar?

Versions:

Survey123 - 3.19.166

Enterprise - 10.8.1

API Version: 2.1.0.2

Python version: 3.9.16

0 Kudos
1 Solution

Accepted Solutions
abureaux
MVP Frequent Contributor

Have you opened the PDFs in a text editor to see what they actually contain? That can give a clue as to the root cause of the issue. E.g., I had some strange report outputs once that were "corrupted", but when the file was inspected, it was clear there was a token issue, and the HTML response ended up in the report output. Since the files are all the same size, it makes me think this may help.

View solution in original post

0 Kudos
2 Replies
abureaux
MVP Frequent Contributor

Have you opened the PDFs in a text editor to see what they actually contain? That can give a clue as to the root cause of the issue. E.g., I had some strange report outputs once that were "corrupted", but when the file was inspected, it was clear there was a token issue, and the HTML response ended up in the report output. Since the files are all the same size, it makes me think this may help.

0 Kudos
AngusWarfieldMc
Occasional Contributor

Thanks @abureaux , great advice. 

There was a block imposed on the URL endpoint by my organization's IT department. 

This is was clear when viewing in a text editor. 

Appreciate the help!

0 Kudos