Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Uploading an exam-references zip file from Mac causes Err500 #422

Open
blerner opened this issue Oct 10, 2022 · 0 comments
Open

Uploading an exam-references zip file from Mac causes Err500 #422

blerner opened this issue Oct 10, 2022 · 0 comments
Labels
bug Something isn't working exam-authoring The whole process of creating and modifying exams good first issue Good for newcomers

Comments

@blerner
Copy link
Contributor

blerner commented Oct 10, 2022

If the zip contains a __MACOSX folder, the files may "contain invalid Unicode", when treated as text, which causes an uncaught exception at https://github.com/CodeGrade/hourglass/blob/master/app/graphql/mutations/change_exam_version_details.rb#L55:

log/production.log:289:I, [2022-10-10T06:57:58.889629 #97816]  INFO -- : [1bd34938-7d6a-4c02-b09b-7a33a3748cb8] Completed 500 Internal Server Error in 17ms (ActiveRecord: 2.9ms | Allocations: 7130)
log/production.log:290:F, [2022-10-10T06:57:58.890805 #97816] FATAL -- : [1bd34938-7d6a-4c02-b09b-7a33a3748cb8]
log/production.log:291:[1bd34938-7d6a-4c02-b09b-7a33a3748cb8] ActiveRecord::StatementInvalid (PG::UntranslatableCharacter: ERROR:  unsupported Unicode escape sequence
log/production.log:295:[1bd34938-7d6a-4c02-b09b-7a33a3748cb8]
log/production.log:296:[1bd34938-7d6a-4c02-b09b-7a33a3748cb8] app/graphql/mutations/change_exam_version_details.rb:55:in `block in resolve'
log/production.log:297:[1bd34938-7d6a-4c02-b09b-7a33a3748cb8] app/graphql/mutations/change_exam_version_details.rb:29:in `resolve'
log/production.log:298:[1bd34938-7d6a-4c02-b09b-7a33a3748cb8] app/graphql/hourglass_schema.rb:56:in `execute'

We need to protect that call more carefully, and probably also reject the __MACOSX folder more aggressively.

@blerner blerner added bug Something isn't working good first issue Good for newcomers exam-authoring The whole process of creating and modifying exams labels Oct 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working exam-authoring The whole process of creating and modifying exams good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant