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

Error in Redetect File Type API #40

Open
helkv opened this issue Jul 8, 2022 · 0 comments
Open

Error in Redetect File Type API #40

helkv opened this issue Jul 8, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@helkv
Copy link

helkv commented Jul 8, 2022

Executing the Redetect File Type API-Call (https://guides.dataverse.org/en/latest/api/native-api.html#redetect-file-type) results in multiple Exceptions, if the original filetype is text/plain and S3 is used as File-Storage.
The result is an incorrect filetype detection and the file being removed from the index.

Equivalent Issue from IQSS/Dataverse: IQSS#7527 & IQSS#7631

Server: All instances
Date of Test: 06.07.2022
Browser: -
Version: i.a. Dataverse v. 5.10.1 / v. 5.11
User: -

Preconditions:

  • S3 as File-Storage
  • Plain Text as original File Type of the File

Actions:

  1. Call the Redetect File Type API: {{base_url}}/api/files/64/redetect?dryRun=false
  2. Result:
    • Incorrect result of the API-Call
    • The file is missing in the Solr index

Root of the Error:

  1. The File Type is checked on a temporary File (.tmp) when using S3
  2. Method FileUtil.determineFileTypeByExtension() returns null for .tmp-File with text/plain as File Type
  3. JPA/EJB Exceptions because Type of a File must not be null
  4. Indexing of the File fails because of the preceding errors (NPE while indexing the Dataset)

Server.log with the related Errors:
Server_Log_with_Redetect_File_Type_Errors.log

@helkv helkv added the bug Something isn't working label Jul 8, 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
Projects
None yet
Development

No branches or pull requests

1 participant