Re: rasterio opens file from AWS S3 bucket on local machine, but can't find file when deployed to Google App Engine
toggle quoted messageShow quoted text
Apologies for the late reply. There may be a bug, yes, but there are more likely sources of trouble. Can you explain more about how you are installing the rasterio package on GCP and how you are configuring your AWS credentials?
I'm trying to run a python flask app, that opens a file hosted on an S3 bucket and analyzes the data. When I deploy the flask app on my local host, it runs like expected. Once I deploy the app to the cloud, it suddenly cannot find the file. I feel like this might be a bug, but i'm too afraid to post in the github. I'll attach the relevant snippet of code, and the error I'm receiving in the GCP Logs. I apologize for terrible formatting as I'm unaware of how to do it properly in this forum.
Here's the code:
and here's the error:
session = boto3.Session(aws_access_key_id=access_key, aws_secret_access_key=secret_access_key)
def start_process(map, lon, lat):
return getCoordinatePixel(map,lon,lat) url = 's3://metcon-test-bucket/high_plus.tif'
app = Flask(__name__) @app.route('/api')
lat = int(request.args['lat'])
lon = int(request.args['lon'])
return jsonify(start_process(url, lon, lat))
if __name__ == '__main__':
Join email@example.com to automatically receive all group messages.