Open mutambaraf opened 1 month ago
Possibly a resurgence of #934?
Sprint planning notes:
@mutambaraf For the first proposal, is it plausible that the user just uploaded different versions? What was the problem with this one?
For the second proposal we could just block files of 0 bytes.
What is the problem and why is it a problem
We had an issue with clam-antivirus generating an error of
Unable to virus scan file
because of the file size this was narrowed down to two proposals 2510141 and 2510040. Proposal 2510141 has lots of file entries in the database as shown below Proposal 2510040 made a zero byte file upload in to the database.Error logs.
`Log message: [2024-10-14T00:37:28.502Z] ERROR - Unable to virus scan file {"reason":{"errno":-3001,"code":"EAI_AGAIN","syscall":"getaddrinfo","hostname":"clam-antivirus"},"errorContext":{"question":{"question":{"categoryId":1,"id":"file_upload_1634228670670","naturalKey":"Science_Case_File_Upload","dataType":"FILE_UPLOAD","question":"Upload document","config":{"small_label":"Only PDFs up to 2MB are accepted.","required":true,"tooltip":"","file_type":[".pdf"],"pdf_page_limit":0,"max_files":1,"omitFromPdf":false}},"topicId":126,"sortOrder":0,"config":{"small_label":"Only PDFs up to 2MB are accepted.","required":true,"tooltip":"","file_type":[".pdf"],"pdf_page_limit":2,"max_files":1,"omitFromPdf":false},"dependencies":[],"dependenciesOperator":"AND"},"answer":[{"id":"d9f5c80b-147e-4597-bdce-1ad72b162da8"}],"fileId":"d9f5c80b-147e-4597-bdce-1ad72b162da8"}}
Log message: [2024-10-09T12:04:58.199Z] ERROR - Clamscan was unable to virus scan file {"response":{"file":null,"isInfected":null,"viruses":[],"resultString":"UNKNOWN COMMAND","timeout":false},"errorContext":{"question":{"question":{"categoryId":1,"id":"file_upload_1634228670670","naturalKey":"Science_Case_File_Upload","dataType":"FILE_UPLOAD","question":"Upload document","config":{"small_label":"Only PDFs up to 2MB are accepted.","required":true,"tooltip":"","file_type":[".pdf"],"pdf_page_limit":0,"max_files":1,"omitFromPdf":false}},"topicId":126,"sortOrder":0,"config":{"small_label":"Only PDFs up to 2MB are accepted.","required":true,"tooltip":"","file_type":[".pdf"],"pdf_page_limit":2,"max_files":1,"omitFromPdf":false},"dependencies":[],"dependenciesOperator":"AND"},"answer":[{"id":"99c81017-46a0-4f4b-96b0-bab21d9ac1eb"}],"fileId":"99c81017-46a0-4f4b-96b0-bab21d9ac1eb"}}
Log message: [2024-10-16T09:48:42.851Z] ERROR - Unable to virus scan file {"reason":{"data":{"err":{"errno":-2,"code":"ENOENT","syscall":"access","path":"downloads/63391f8b-bc35-4fc9-8e21-6cc649313575"},"file":"downloads/63391f8b-bc35-4fc9-8e21-6cc649313575"},"date":"2024-10-16T09:48:42.851Z"},"errorContext":{"question":{"question":{"categoryId":1,"id":"file_upload_1634228670670","naturalKey":"Science_Case_File_Upload","dataType":"FILE_UPLOAD","question":"Upload document","config":{"small_label":"Only PDFs up to 2MB are accepted.","required":true,"tooltip":"","file_type":[".pdf"],"pdf_page_limit":0,"max_files":1,"omitFromPdf":false}},"topicId":126,"sortOrder":0,"config":{"small_label":"Only PDFs up to 2MB are accepted.","required":true,"tooltip":"","file_type":[".pdf"],"pdf_page_limit":2,"max_files":1,"omitFromPdf":false},"dependencies":[],"dependenciesOperator":"AND"},"answer":[{"id":"63391f8b-bc35-4fc9-8e21-6cc649313575"}],"fileId":"63391f8b-bc35-4fc9-8e21-6cc649313575"}} `