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

Unable to read file from location #195

Closed
stuartcusackie opened this issue Jan 13, 2023 · 3 comments
Closed

Unable to read file from location #195

stuartcusackie opened this issue Jan 13, 2023 · 3 comments

Comments

@stuartcusackie
Copy link
Contributor

stuartcusackie commented Jan 13, 2023

Bug description

Just had a random crash as a client was editing content.

Unable to read file from location: containers/images/clubs/aston-quay-44.jpg/35460d82eb5142426fb66450f2dc015c.jpg.

I FTPd to the server to check the cache folders at storage/statamic/glide/containers/etc and the file was missing. I guess there was a reference to this file somewhere in storage/framework/cache/glide but for some reason the file did not exist.

My image manipulation cache is set to false and the website has been running fine for a month. Seems totally random.

It seems similar to this issue: #171.
I opened a core issue here: statamic/cms#7350

How to reproduce

No idea.

Logs

{
    "class": "Spatie\\LaravelIgnition\\Exceptions\\ViewException",
    "message": "Unable to read file from location: containers/images/clubs/aston-quay-44.jpg/35460d82eb5142426fb66450f2dc015c.jpg.",
    "code": 0,
    "file": "/home/forge/mysite.ie/vendor/league/flysystem/src/UnableToReadFile.php:24",
    "trace": [
        "/home/forge/mysite.ie/vendor/league/flysystem/src/Local/LocalFilesystemAdapter.php:265",
        "/home/forge/mysite.ie/vendor/league/flysystem/src/Filesystem.php:75",
        "/home/forge/mysite.ie/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php:951",
        "/home/forge/mysite.ie/vendor/spatie/statamic-responsive-images/src/Breakpoint.php:269",
        "/home/forge/mysite.ie/vendor/spatie/blink/src/Blink.php:279",
        "/home/forge/mysite.ie/vendor/statamic/cms/src/Support/Blink.php:18",
        "/home/forge/mysite.ie/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:338",
        "/home/forge/mysite.ie/vendor/spatie/statamic-responsive-images/src/Breakpoint.php:278",
        "/home/forge/mysite.ie/vendor/spatie/statamic-responsive-images/src/Breakpoint.php:215",
        "/home/forge/mysite.ie/vendor/spatie/statamic-responsive-images/src/Breakpoint.php:246",
        "/home/forge/mysite.ie/vendor/spatie/statamic-responsive-images/src/Breakpoint.php:62",
        "/home/forge/mysite.ie/vendor/laravel/framework/src/Illuminate/Conditionable/Traits/Conditionable.php:34",
        "/home/forge/mysite.ie/vendor/spatie/statamic-responsive-images/src/Breakpoint.php:63",
        "/home/forge/mysite.ie/vendor/spatie/statamic-responsive-images/src/Tags/ResponsiveTag.php:75",
        "/home/forge/mysite.ie/vendor/laravel/framework/src/Illuminate/Collections/Arr.php:560",
        "/home/forge/mysite.ie/vendor/laravel/framework/src/Illuminate/Collections/Collection.php:739",

Environment

Environment
Laravel Version: 9.43.0
PHP Version: 8.1.12

Statamic
Version: 3.3.60 PRO

Statamic Addons
jonassiewertsen/statamic-live-search: 1.5.1
jonassiewertsen/statamic-livewire: 2.9.0
justbetter/statamic-image-optimize: 1.1.4
rias/statamic-redirect: 2.5.0
spatie/statamic-responsive-images: 2.14.4
statamic/seo-pro: 3.1.3
stuartcusackie/statamic-cache-requester: 1.0.2

Installation

Fresh statamic/statamic site via CLI

Antlers Parser

regex (default)

Additional details

No response

@ncla
Copy link
Collaborator

ncla commented Jan 13, 2023

Yeah, it's same issue. Update to latest version and that error will be silenced for production. 🤷‍♂️ This is same behavior as glide:data_uri tag, the core just silences any errors coming when reading from image manipulation directory cache. https://github.com/statamic/cms/blob/3.3/src/Tags/Glide.php#L212-L227

If you want you can update the issue on core saying it can happen with glide:data_url too. I am not sure I agree on them silencing errors on the tag though, but it might be I don't know something, or it's too annoying to fix.

Sorry for the trouble!

@ncla ncla closed this as completed Jan 13, 2023
@stuartcusackie
Copy link
Contributor Author

stuartcusackie commented Jan 14, 2023

Ah I see. I opened this because I thought it was addressed in v2.14.2, and I was running v2.14.4. Looks like 2.14.5 handled it. I will update. Thank you!

I will update my core issue.

@ncla
Copy link
Collaborator

ncla commented Jan 14, 2023

v2.14.2 only fixed issue if you changed the cache settings for image_manipulations. In this I version removed try.. catch from placeholder generation unaware that it is there for a reason. Then it was readded back v2.14.5.

There is a bigger underlying issue that just needs to be fixed in the core. The "fix" I reapplied in 2.14.5 is simply hiding it under the rug. It has to be resolved in core.

(I started writing this reply to your first unedited message FYI 😅 )

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

2 participants