I have had a new problem come up with previously working code. The background is that we have a cronjob running on an ec2 to upload 4 tifs twice daily. Below is how I call copy_raster to upload the tifs.
upload_layer = copy_raster(input_raster=tif,
output_name=upload_name,
folder=agol_folder,
gis=gis)For the last two days, this has been giving a 504 Gateway Time-out error (below) after working previously for weeks. A few other notes: the 4 tifs are around 6Mb each and when I turn the displayProgress flag to true it shows that each uploads in around 3 seconds but then the timeout seems to happen on the processing step since the next upload progress bar does not appear. I have checked the tifs - they are not corrupt and visualize properly in a local GIS platform. I am experiencing this same error both on the remote ec2 machine and my local one. Any help is appreciated, thank you.
Traceback (most recent call last):
File "/python3.9/site-packages/requests/models.py", line 971, in json
return complexjson.loads(self.text, **kwargs)
File "/python3.9/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/python3.9/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/python3.9/site-packages/arcgis/gis/_impl/_con/_connection.py", line 993, in _handle_response
data = resp.json()
File "/python3.9/site-packages/requests/models.py", line 975, in json
raise RequestsJSONDecodeError(e.msg, e.doc, e.pos)
requests.exceptions.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "file.py", line 471, in <module>
updateAGOL(
File "file.py", line 410, in updateAGOL
upload_tifs(gis, tif_dir, agol_folder, date_str_id)
File "file.py", line 74, in upload_tifs
upload_layer = copy_raster(input_raster=tif,
File "/python3.9/site-packages/arcgis/raster/analytics.py", line 1651, in copy_raster
return gis._tools.rasteranalysis.copy_raster(
File "/python3.9/site-packages/arcgis/_impl/tools.py", line 13022, in copy_raster
gpjob = self._tbx.copy_raster(
File "<string>", line 1245, in copy_raster
File "/python3.9/site-packages/arcgis/geoprocessing/_support.py", line 468, in _execute_gp_tool
job_info = gptool._con.post(submit_url, gp_params)
File "/python3.9/site-packages/arcgis/gis/_impl/_con/_connection.py", line 1528, in post
return self._handle_response(
File "/python3.9/site-packages/arcgis/gis/_impl/_con/_connection.py", line 996, in _handle_response
raise Exception(resp.text)
Exception: <html>
<head><title>504 Gateway Time-out</title></head>
<body>
<center><h1>504 Gateway Time-out</h1></center>
<hr><center>Microsoft-Azure-Application-Gateway/v2</center>
</body>
</html>