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

Inconsistent mimetype/extension detection #64

Closed
2 of 3 tasks
jujaga opened this issue Feb 15, 2019 · 0 comments
Closed
2 of 3 tasks

Inconsistent mimetype/extension detection #64

jujaga opened this issue Feb 15, 2019 · 0 comments
Assignees
Labels
bug Something isn't working verification Verify the bug has been fixed
Milestone

Comments

@jujaga
Copy link
Member

jujaga commented Feb 15, 2019

OCWA Issue

User Story

As a researcher,

I want to be able to upload any type of file and have the filetype be parsed and handled correctly

so that the application can properly run validation tests on the files and yield useful output.

Test Case

ENV

  • DEV
  • TEST
  • PROD

TESTCASE

  • Login and create new request
  • Click Add files
  • Drag and drop the LICENSE file from the OCWA repository as a file to submit

EXPECTED

  • The file should successfully submit, with a filetype recognized as text/plain (or similar)
  • Subsequent screens should yield validation rule results that make sense for the uploaded file

ACTUAL

  • The file appears to successfully submit, but no filetype is registered with it.
  • Subsequent validation screens do not yield proper results.

ERROR

From Validation API

2019-02-15 19:04:30,436 - DEBUG - Error 'filetype'
Process Process-54:2:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/multiprocessing/process.py", line 297, in _bootstrap
    self.run()
  File "/usr/local/lib/python3.7/multiprocessing/process.py", line 99, in run
    self._target(*self._args, **self._kwargs)
  File "/app/validator/validator.py", line 37, in validate
    result, message = read_file_and_evaluate(source, resultObj)
  File "/app/validator/validator.py", line 51, in read_file_and_evaluate
    result['file_id'], '${file.content}' in source)
  File "/app/validator/validator.py", line 171, in read_file
    index = file[ftIndex].find('/')
KeyError: 'filetype'

Notes

  • This issue only occurs more frequently on Windows, but can be replicated on macOS as well.
  • Markdown files tend to also exhibit this issue, but not in all cases. Haven't been able to isolate root cause.
  • So far we've discovered that we simply do not have the ${file.filetype} attribute defined, which is causing an error on the validationApi.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working verification Verify the bug has been fixed
Projects
None yet
Development

No branches or pull requests

4 participants