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

Images are not found in tmp folder #126

Open
Teifun2 opened this issue Jul 26, 2019 · 12 comments
Open

Images are not found in tmp folder #126

Teifun2 opened this issue Jul 26, 2019 · 12 comments

Comments

@Teifun2
Copy link

Teifun2 commented Jul 26, 2019

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?

@jcoyne
Copy link
Collaborator

jcoyne commented Jul 29, 2019

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

@Teifun2
Copy link
Author

Teifun2 commented Jul 29, 2019

@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.

@elrayle
Copy link

elrayle commented Apr 29, 2020

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

@jcoyne
Copy link
Collaborator

jcoyne commented Apr 29, 2020

@elrayle does the #134 branch fix the problem?

@elrayle
Copy link

elrayle commented Apr 29, 2020

I'll check that out with fingers crossed.

@elrayle
Copy link

elrayle commented Apr 29, 2020

@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. :(

@elrayle
Copy link

elrayle commented Apr 29, 2020

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

@elrayle
Copy link

elrayle commented Apr 29, 2020

@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.

@elrayle
Copy link

elrayle commented Jun 23, 2020

@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?

@elrayle
Copy link

elrayle commented Jun 26, 2020

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.

@elrayle
Copy link

elrayle commented Jun 26, 2020

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

@elrayle
Copy link

elrayle commented Jun 26, 2020

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/

lfarrell added a commit to UNC-Libraries/hy-c that referenced this issue Oct 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants