dbmdz / iiif-server-hymir

Hymir is a Java based IIIF Server. It is based on "IIIF Image API Java Libraries" and "IIIF Presentation API Java Libraries" projects (see https://github.com/dbmdz)
MIT License
27 stars 7 forks source link

Freshly added new manifests not found by Hymir #8

Closed VonUniGE closed 6 years ago

VonUniGE commented 6 years ago

I've a running instance of Hymir 3.5.0, with a custom rules.yml. Everything works fine.

I've generated new manifests, and put them with the same format in the same directory as the already existing ones. Old and new manifests have the same owner and permissions. But when I try to get a new one with /iiif/presentation/v2/1234567890/manifest I obtain a 404. The old ones are working fine. I've restarted Hymir but I have the same result.

Is it possible to add new manifests to a running instance?

Is there some cache somewhere?

Actual behavior : Manifest added at runtime are not found Desired behavior: Manifest added at runtime are found

morpheus-87 commented 6 years ago

Is there any exception message in the logfile? Could you please provide your rules.yml and an identifier of one of your new manifests?

VonUniGE commented 6 years ago

I test this directly on the server with httpie. For an old manifest, I use:

http :9000/iiif/presentation/v2/1072055903/manifest

I obtain a correct answer and in the log I have:

Serving manifest for 1072055903

For a new manifest, I use:

http :9000/iiif/presentation/v2/1072068135/manifest

I obtain a 404 and nothing in the log.

Both manifest files are present on the files system

ls -l /mnt/data/IIIFManifest/IIIFManifest_1072055903.json /mnt/data/IIIFManifest/IIIFManifest_1072068135.json 

gives

-rw-r--r-- 1 debian debian 34055 Nov 22 16:33 /mnt/data/IIIFManifest/IIIFManifest_1072055903.json
-rw-r--r-- 1 debian debian 93616 Mar 14 17:16 /mnt/data/IIIFManifest/IIIFManifest_1072068135.json

Here is my rules.yml:

- pattern: ^(\d{10})_(\d{3})$
  substitutions:
  - 'file:/mnt/data/books/$1/$1_$2.jpg'
- pattern: ^(\d{10})$
  substitutions:
  - 'file:/mnt/data/IIIFManifest/IIIFManifest_$1.json'

P.S.: Note that I've upgraded Hymir from 3.3.0 to 3.5.0

jbaiter commented 6 years ago

I think I've run into this this morning as well, will investigate. Could you upload the manifest that fails somewhere?

VonUniGE commented 6 years ago

I think I'm not allowed to publish the manifest now. But if it were a problem in the manifest itself why do I get a 404?

And do you know if there is some cache mechanism in the manifest resolution?

Thanks for your help.

VonUniGE commented 6 years ago

I've changed the log level from error to info for de.digitalcollections packages in src/main/resources/logback-spring.xml. Now I can see the problem:

All annotations must **only** have ImageContent resources. Use otherContent for other types of content.

So there is effectively a problem in my manifest files, but there is also a problem in Hymir because an invalid manifest should not return a 404.

VonUniGE commented 6 years ago

The @type was set to dctypes:Illustration instead of dctypes:Image. It takes me some time to discover this because there were nothing in the log and the answer was a 404. I will open a new issue for this.