sul-dlss / riiif

IIIF image server in ruby

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Images are not found in tmp folder

Teifun2 opened this issue · comments

Im unsure who is responsible (riiif or puma) but after some time in the developement environement riiif starts searching for the images in the tmp folder instead of the actual location. This always results in a ImageNotFoundError.

Is there a way to avoid Riiif to search in the tmp folder?

@Teifun2 what file resolver have you configured RIIIF to use?

@jcoyne I did not configure Riiif::Image.file_resolver in my initialization file.
If this does not answer your question i need help to find out what resolver i'm using.

Was there any resolution on this? I have tried multiple things and continue to get errors like:

While trying to view items in the Dashboard under Items...

Riiif::ImageNotFoundError - /Users/***/exhibits/tmp/2976.{png,jpg,tif,tiff,jp2}:

Trying to reindex, sometimes it shows as processed and other times, I get

Riiif::ImageNotFoundError: Riiif::ImageNotFoundError

Background - the database and data files were copied from production to my laptop. Then I try to reindex each exhibit. This process has worked in the past, but with the latest update, I am no longer able to get this to work. None of the exhibits' items have thumbnails. I can't view images from any exhibit. And I can't reindex any exhibit.

The riiif resolver is...

  Riiif::Image.file_resolver = Spotlight::CarrierwaveFileResolver.new

@elrayle does the #134 branch fix the problem?

I'll check that out with fingers crossed.

@jcoyne Unfortunately that didn't work. I dropped the whole file into my app for testing, confirmed the app was using it, and still get the error. :(

I tried reverting to riiif 1.7.1, but with the move to the level of spotlight we are using requires riiif ~> 2.0.

This does not appear to be a problem when I access items and reindex on our staging AWS server which uses riiif resolver...

  Riiif::Image.file_resolver = Riiif::HTTPFileResolver.new

@jcoyne We are in the process of moving to the latest 2.x version of spotlight. Do you think it is likely that this problem will go away by the time I get to 2.13? If that is the case, I can do most of my testing on for the upgrade on the AWS server. If not, then spending time debugging the development environment might be worth it so things don't degrade even more.

@jcoyne I am back around debugging this issue. It was not magically fixed with the upgrade to the latest spotlight on the 2.x track. We are now on 2.13 and I get the same error with RIIIF Image not found and nothing being written to the tmp directory. Any thoughts on what I can check?

I'm getting the following error.

Invalid characters in id `51`
Error performing Spotlight::ReindexJob (Job ID: ...) from Inline(default) in 37629.02ms: Riiif::ImageNotFoundError (Riiif::ImageNotFoundError):
riiif-2.3.0/app/resolvers/riiif/abstract_file_system_resolver.rb:17:in `path'

When I break in abstract_file_system_resolver.rb:17:in `path'...

> id
51
> id.class
Integer
> pattern(id)
Invalid characters in id `51`
> pattern(51)
Invalid characters in id `51`
> pattern('51')
"/Users/.../exhibits/tmp/51.{png,jpg,tif,tiff,jp2}"

If I break at the start of #path and set id = "51" and continue, it still ultimately gets Riiif::ImageNotFoundError, but includes the path to the file it expects.

Error when id is integer: Riiif::ImageNotFoundError - Riiif::ImageNotFoundError:
Error when id is string: Riiif::ImageNotFoundError - /Users/.../exhibits/tmp/53.{png,jpg,tif,tiff,jp2}

The cause of the error when the path is generated is in the next line at abstract_file_system_resolver.rb:18

> Dir.glob(search)
[]
> Dir.glob(search).first
nil

which fails the logical test and cause ImageNotFoundError to be raised.

FYI... I went back to our last commit before the update of RIIIF and the uploads work.

It looks like the resolver gets created and the base_path set to the tmp directory in Riiif::Image model.

My read of this is that the resolver is looking for a file in the tmp directory. I have not yet found the code that should be creating the file in the tmp directory.

The full size file exists in /public/uploads/spotlight/featured_image/image/51/