instructure / canvas-lms

The open LMS by Instructure, Inc.
https://github.com/instructure/canvas-lms/wiki
GNU Affero General Public License v3.0
5.57k stars 2.47k forks source link

HTTP 500 Error when Creating Assignment (AWS S3 Deployed) #2267

Closed tonylabs closed 11 months ago

tonylabs commented 11 months ago

Summary:

Folks, I was trying to create an assignment but the Canvas test instance hosted locally always return response_code: 500. Please help.

Steps to reproduce:

  1. AWS S3 storage configured
  2. Attachment uploaded correctly
  3. Create assignment without submission type

Expected behavior:

Assignment created

Actual behavior:

response_code: 500 request_id: 8fb79264-4d81-404e-b1a0-2b5eba809566 session_id: 6adf889a0429577c4f9680b9f51efce0 meta_headers: o=assignments_api;n=create;t=Course;i=7; format: !ruby/object:Mime::Type synonyms:

[CANVAS_ERRORS] EXCEPTION LOG NoMethodError (undefined method `-' for nil:NilClass

  where("number <= ?", maximum(:number) - versions_to_keep).each(&:destroy)

Additional notes:

tonylabs commented 11 months ago

Issue got fixed by downgrade PostgreSQL from 14 to 12.