PrairieLearn icon indicating copy to clipboard operation
PrairieLearn copied to clipboard

Corrupt base64 representation of submitted file

Open rikblok opened this issue 3 years ago • 1 comments

I have a file-upload question that asks for a JPG file with this code: <pl-file-upload file-names="loop.jpg"></pl-file-upload>

One submission is automatically reporting the following issue:

Issue User: *** (***) Student message: Error rendering question Instructor message: CourseIssueError: /srv/sysconf/ca/main/revisions/5b9cfd541d12866228f52f20ab1bdcfc93a76ef7/elements/pl-file-preview/pl-file-preview.py: Error calling render(): Error: CodeCallerNative child process exited unexpectedly, code = 1, signal = null ID: 46044 Date: 2022-09-21 16:56:32-07 (PDT)

I've managed to download the submitted "loop.jpg" and it turns out to be a zero-byte file. Should the renderer catch this special case? Or have I missed something obvious?

Thanks, Rik

rikblok avatar Sep 30 '22 06:09 rikblok

pl-file-upload typically rejects 0-byte files, so this is not actually the problem. I checked the question (since I'm still tagged as staff for the course 😄 ) and it seems there was some sort of corruption in the submission data, with the file data having an invalid base64 representation of the data. @nwalters512 @mwest1066 this probably needs to be reviewed in the database itself (question instance 30677765, variant ID 6624592).

jonatanschroeder avatar Sep 30 '22 13:09 jonatanschroeder

I haven't heard any repeat of this problem, so I'll close it as resolved, but if it's found again please feel free to reopen with more details.

jonatanschroeder avatar Sep 28 '23 19:09 jonatanschroeder