You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am currently utilizing AWS S3 storage in combination with the absence of Instructure File System (InstFS) activation. I've encountered an issue when attempting to re-upload student submissions in Assignments. While the file successfully uploads to S3, the final "create_success" API call results in a "400 Bad Request" error.
Steps to reproduce:
Configure storage settings to use AWS S3 instead of local storage. Disable InstFS if it is currently enabled.
On Canvas LMS website, navigate to the "Assignments" section and select an assignment containing student submissions. Follow this link for instructions until Step 4. with images.
Click 'Download Submissions'.
Choose 'Re-Upload Submissions' and select the previously downloaded zip file.
Open the 'Network' tab in the Developer's tools.
Click 'Upload Files'.
Expected Behavior:
Upon clicking 'Upload Files', you should observe three API calls in sequence: 1. POST - pending 2. POST - upload_url 3. GET/POST - create_success.
All API calls should return responses with status codes such as 200 OK, 201 Created, or 302 Found, successfully uploading the zip file.
Actual Behavior:
The final API call, 'create_success,' returns a "400 Bad Request" error.
Examination of the database entries for the file reveals workflow_state='unattached_temporary'.
When I inspect the attachment.state using the Rails console, it also displays unattached_temporary.
Additional Notes:
As per the 'setupSubmitHandler' function in 'app/jsx/shared/helpers/reuploadSubmissionsHelper,' the re-upload submissions process is associated with the intent: 'submissions_zip_upload'.
The 'temporary_file' method in 'files_controller.rb' returns true if the intent does not match ['message', 'attach_discussion_file', 'upload'] or ['comment', 'submit'].
However, when the 'api_attachment_preflight' method is invoked during the first API call, the attachment is assigned the state 'unattached_temporary' if it receives the parameter opts[:temporary] == true.
According to the 'api_create_success' method in 'files_controller.rb,' a "Bad Request" error is triggered if the attachment.state is not 'unattached,' while using S3 storage which is checked during the third API call.
Based on the sequence of events, it appears that using S3 storage while disabling InstFS may lead to a "Bad Request" error when re-uploading submissions.
I'm also curious about why we're filtering attachments with a status other than 'unattached' when using S3 storage.
Understanding the reasoning behind this condition would be really helpful for addressing the issue.
The text was updated successfully, but these errors were encountered:
imsujinpark
changed the title
Re-upload Submission File Error in S3 (files with intent 'submissions_zip_upload')
Error When Re-Uploading Submissions Files to S3 without InstFS Enabled
Nov 3, 2023
Summary:
I am currently utilizing AWS S3 storage in combination with the absence of Instructure File System (InstFS) activation. I've encountered an issue when attempting to re-upload student submissions in Assignments. While the file successfully uploads to S3, the final "create_success" API call results in a "400 Bad Request" error.
Steps to reproduce:
Expected Behavior:
Actual Behavior:
workflow_state='unattached_temporary'
.attachment.state
using the Rails console, it also displaysunattached_temporary
.Additional Notes:
intent: 'submissions_zip_upload'
.['message', 'attach_discussion_file', 'upload']
or['comment', 'submit']
.opts[:temporary] == true
.Based on the sequence of events, it appears that using S3 storage while disabling InstFS may lead to a "Bad Request" error when re-uploading submissions.
I'm also curious about why we're filtering attachments with a status other than 'unattached' when using S3 storage.
Understanding the reasoning behind this condition would be really helpful for addressing the issue.
The text was updated successfully, but these errors were encountered: