informatics-lab / moc-vr

met office college vr observation platform
GNU General Public License v3.0
0 stars 1 forks source link

Upload failed #113

Closed anthony-duke closed 7 years ago

anthony-duke commented 7 years ago

Having multiple reports in the last 2 days of failure to upload. Simple error message of 'upload failed' and blank webpage following press of 'upload' button. image

tam203 commented 7 years ago

Issue was caused by EC2 instance running the server not having permissions to write to the S3 bucket. When this permission was lost isn't clear. Permission now granted to the user moc-vr-upload assumed by the EC2 instance.

This fix allows uploads but the thumbnails aren't produced, again due to permissions.

tam203 commented 7 years ago

Thumbnails fail. Logs from lambda:

Failed to upload /tmp/6f923c62-cd05-4b97-9e69-de4a8d01b7f0-photosphere-large.JPEG to moc-vr/obs/6f923c62-cd05-4b97-9e69-de4a8d01b7f0/photosphere-large: An error occurred (AccessDenied) when calling the PutObject operation: Access Denied: S3UploadFailedError
Traceback (most recent call last):
File "/var/task/CreateThumbnail.py", line 44, in handler
s3_client.upload_file(l, bucket, large_upload_key)
File "/var/task/boto3/s3/inject.py", line 106, in upload_file
extra_args=ExtraArgs, callback=Callback)
File "/var/task/boto3/s3/transfer.py", line 283, in upload_file
filename, '/'.join([bucket, key]), e))
S3UploadFailedError: Failed to upload /tmp/6f923c62-cd05-4b97-9e69-de4a8d01b7f0-photosphere-large.JPEG to moc-vr/obs/6f923c62-cd05-4b97-9e69-de4a8d01b7f0/photosphere-large: An error occurred (AccessDenied) when calling the PutObject operation: Access Denied
tam203 commented 7 years ago

mocvr-full-access-to-moc-vr-bucket permission created and granted to moc-vr-upload user and moc-vr-thumbnail-role role.