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

/knora.json doesn't work with a CSV file #309

Closed
benjamingeer opened this issue Oct 22, 2019 · 11 comments · Fixed by #324 or #328
Closed

/knora.json doesn't work with a CSV file #309

benjamingeer opened this issue Oct 22, 2019 · 11 comments · Fixed by #324 or #328

Comments

@benjamingeer
Copy link
Contributor

Steps to reproduce:

  1. Put a CSV file test.csv in /sipi/images/tmp.
  2. Make a request to http://localhost:1024/tmp/test.csv/knora.json.

Sipi responds with an internal server error:

Internal Server Error: Sipi image error at [/sipi/src/SipiImage.cpp: 381]: Could not read file /sipi/images/tmp/test.csv

The Sipi log says:

sipi            | Sipi: ERROR IN TIFF! Module: /sipi/images/tmp/test.csv
sipi            | Sipi: Not a TIFF or MDI file, bad magic number 28755 (0x7053)
sipi            | Sipi: GET /tmp/test.csv/knora.json failed (Internal Server Error): Sipi image error at [/sipi/src/SipiImage.cpp: 381]: Could not read file /sipi/images/tmp/test.csv
@benjamingeer
Copy link
Contributor Author

test.csv.zip

@benjamingeer
Copy link
Contributor Author

Ping (this is still blocking dasch-swiss/dsp-api#1532)

@benjamingeer
Copy link
Contributor Author

Still not working.

@benjamingeer benjamingeer reopened this Jun 29, 2020
@lrosenth
Copy link
Collaborator

lrosenth commented Jun 29, 2020

Yeah – I just fixed it. .../knora.json just returns the mimetype:

http://localhost:1024/images/test.csv/knora.json

results in

{
   "internalMimeType": "text/plain"
}

There is no way that the csv mikmtype can be determined by the magic number....

XML works also:

http://localhost:1024/images/hello.gresource.xml/knora.json

results in:

{
   "internalMimeType": "text/xml"
}

@benjamingeer
Copy link
Contributor Author

That's perfect, thanks, can we have a new Sipi release with this fix?

@benjamingeer
Copy link
Contributor Author

It would also be great to have a test for it in https://github.com/dasch-swiss/sipi/blob/develop/test/e2e/test_02_server.py.

@lrosenth
Copy link
Collaborator

lrosenth commented Jul 2, 2020

done!

@benjamingeer
Copy link
Contributor Author

I'm still getting the same error with the current Sipi.

@benjamingeer
Copy link
Contributor Author

Now Sipi's log says:

Sipi: GET /tmp/test.csv/knora.json failed (Internal Server Error): Sipi image error at [/sipi/src/SipiImage.cpp: 383]: Could not read file /sipi/images/tmp/test.csv

But I can see that the file is there in the filesystem.

@benjamingeer
Copy link
Contributor Author

I've just tried this again with the current Sipi, and got the same result.

@benjamingeer
Copy link
Contributor Author

Fixed in 3.0.0-rc.5.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants