I'm facing a strange error and I can't find a solution. I have a report that is generated daily by an application and that is stored on AmazonAWS. The application provides me the URL.
I have a Google App Script piece of code that get the file and stores on a TeamDrive to be read by Google BigQuery.
Facts:
- the request doesn't require any authentication: the URL works well if I execute it on my browser (Chrome) even using the private navigation, therefore it is not an authentication issue.
- the snippet worked well for about 3 months, on a daily basis. It is only in the last 3 days that has stopped working.
Now it seems that I cannot get that piece of code working. This is the snippet:
try { var res = UrlFetchApp.fetch(reportFile); retVal.fileContent = res.getContentText(); retVal.success = true; } catch (ex) { retVal.success = false; retVal.errorMessage = "Can't download report file [" + ex + "]" }
I have already tried to:
- force the "get" method
- force the "User-Agent" header
- checked that all the parameters (X-Amz-Algorithm, X-Amz-Credential, X-Amz-Date, X-Amz-Expires, X-Amz-SignedHeaders, X-Amz-Signature) are correctly encoded
But no matter, I always get the "Unexpected Error" (even working with the the muteHttpExceptions option) and this force me to to do the download manually every time.
Is there any other possible solution I can use?
Thanks in advance.
Regards