Closed bphippen closed 6 years ago
Have you set custom values on either of your resourceBaseUrl
or resourceBasePath
config settings?
All I'm using is an asset volume called Images:
OK, but have you set those config settings in config/general.php
?
Also if "Update Asset Indexes" is clicked, it will remove all assets from the site.
That seems to indicate that as far as Craft can tell, the asset files don’t exist. Have you made any other changes recently?
Oh sorry no, I had to check what resourceBasePath and resourceBaseUrl settings were, and no I am not settings those in the my config file.
I am not setting asset paths in the config.
Yes, here is what happens when I click that:
All of my images are in that folder locally though...
Edit* I've made no other changes recently either.
Let’s look at the first file as an example (ltw-hero-girl.jpg
). Which of these paths are the correct location for the file on your server?
/assets/images/Images/landing-pages/ltw-hero-girl.jpg
/assets/images/landing-pages/ltw-hero-girl.jpg
Craft is saying that the file is indexed at the former location (volume base path + Images/…
), but I’m guessing that in reality the file lives at the 2nd location (no double images/Images/
).
So it looks like maybe the volume started out with a File System Path of @webroot/assets
(no /images
subfolder), and so it’s treating Images/
as a subfolder of the volume. Whereas now your volume’s File System Path is set to that images/
subfolder, messing up all of the existing indexes.
Is that right?
Yes that is right, the actual location is:
/assets/images/landing-pages/ltw-hero-girl.jpg
Ok, I think I can debug at this point, thanks for all your help!
There were a couple others that had the same issue, so I'm guessing with this 3.0.3 update that "bug" that was working before is now not and so the indexes are broken like you said. Since this is the first update where this issue started.
Thanks again Brandon, for your time!
If you could, please point others you’ve run into with the same issue over to here. There very well could be a bug introduced by 3.0.3, and getting others onto the same thread could help us identify it.
I’ve run into the same issue with a similar asset volume setup:
Craft uploads images to the right directory and inserts the correct link into templates: {{ entry.myAssetsField.one.url }}
. Previewing and editing files works fine, too.
However, Craft can’t generate thumbnails (CP and frontend). If I click on “Update Asset Indexes”, I get the same error message like above:
Missing files
The following files could not be found. Should they be deleted from the index?
- Bilder/Test.jpg
- ...
I don’t overwrite any volume settings with configuration files. The error also occurs, if I use @web
in the “Base URL” setting and an absolute path as the “File System Path”.
What is the correct way to set up asset volumes in Craft 3? I will be happy to provide you with more information, if needed.
Having a similar issue with a similar setup. FYI
@bphippen @tpmatthes @eheiser If any of you can send admin & FTP credentials over to support@craftcms.com, that would be helpful.
Can't help you there Brandon, this is on a local install on Mamp/OSX.
Actually, we just realized we may have fixed this unintentionally by fixing another seemingly-unrelated bug.
@bphippen @tpmatthes @eheiser to test the fix, open composer.json
and change the craftcms/cms
version requirement to "dev-develop as 3.0.99"
, and then run composer update
from your terminal. Once it’s done, check if asset indexing works for you again.
We aren’t able to reproduce thumbnail issues, but maybe that will sort itself out too – let us know!
Andris came through with a fix for me so all set to continue here. Cheers!
We just released 3.0.3.1 with the indexing fix. Let me know if anyone is still having issues after that!
As always, thanks for the fast response, @brandonkelly
Unfortunately, it seems like the problems isn’t fully solved yet. I’ve updated Craft to 3.0.3.1, cleared the cache, updated the asset indexes and restarted MAMP. Now, I can still upload, edit and preview files, but Craft does not generate any thumbnails in the CP.
I can reproduce this bug with a new Craft installation on my local server. Please let me know, if you need additional information.
Test
test
sure
@web/uploads/
uploads/
Side note: If I use @webroot/uploads/
as “File System Path”, I get this error:
HTTP 400 – Bad Request – yii\web\BadRequestHttpException
Unable to verify your data submission.
@tpmatthes Check your browser’s Network panel. What is the requested URL for a thumbnail? What is its response code?
I get a 404 and a url like this: http://localhost:8888/craft3-test/web/cpresources/e97cc25a/thumb-30x30.jpg?v=1524064577
This folder doesn’t exist.
@tpmatthes @brandonkelly I've updated to 3.0.3.1 and confirm that indexing is fixed, however I still can't see asset thumbs either.
/cpresources/397ff07d/thumb-60x60.jpg?v=1524011395
@bphippen @tpmatthes Can we get admin/FTP access, or if this is local, can we set up an ip call so we can screen share and try to see what’s going on? If yes to either, please email us at support@craftcms.com
@brandonkelly @tpmatthes so I just figured it out...
I am using Local by Flywheel as my local hosting environment, which works great for Craft projects...until for whatever reason 3.0.3
My craft projects were running fine there with Nginx as the server until 3.0.3
So I created a new craft install with nginx as the server, and the same error occurred (no thumbs). Then I switched to Apache and it works fine...
So I'll still do some testing to see why Nginx isn't working as my local server anymore.
I seem to still be having the issue as well. Fresh install of Craft 3.0.3.1 with no plugins running Apache on MAMP. Like above I can upload, edit, and preview the files they just aren't showing as thumbnails in the CP.
@bphippen Check the Nginx config. Is it not forwarding requests with an extension (e.g. .jpg
) to index.php
? If so that is likely the problem – Craft 3.0.3 introduced on-demand resource generation, which assumes that 404-ing resource requests will get passed to index.php
. Maybe that’s not always the case.
@brandonkelly yes that was absolutely the issue. Local by Flywheel adds this to the nginx config:
location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ { access_log off; log_not_found off; expires max; }
That line was the culprit, commented that out and thumbs are now loading.
Thanks again for all your help!
@bphippen Cool, we’ll go back to eager-publishing CP resource files to work around that in 3.0.4.
@brandonkelly At the moment, I can’t share my screen with this setup. However, if this can’t be fixed until next week, I’ll do some additional testing and try to create a demo server. In the meantime, I am happy to provide you with some screenshots or log files. Would this be helpful?
Some additional information:
index.php
. If I enter one of the thumbnail urls into the browser, I get this error message:
HTTP 404 – Not Found – yii\web\NotFoundHttpException
Template not found: cpresources/61eddae0/thumb-30x30.jpg
@tpmatthes Can you post a screen shot of that error?
@brandonkelly Here is a screenshot of the error I'm getting. I would imagine it's the same as @tpmatthes.
@jeffaglenn Yes, that’s exactly the same error, thanks
@jeffaglenn Just tested with MAMP, with a Local volume with Base URL and File System Path settings using the @web
and @webroot
aliases, and thumbs continue to work, even after clearing my Asset Caches and Control Panel Resources.
Anyway, it shouldn’t be an issue anymore with the next release, as we’ve gone back to eager-publishing these resources like we did before 3.0.3.
I have same problem and we solved it by deleting the folders and generating them directly from craft. This way craft automatically puts the permissions of 755. If you want to solve it you can just change the permits to 755 of the folder permissions.
try like this
<img src="https://dev-craft3-384fa3039dfb.hyperlane.co/uploads/scren1.png" referrerpolicy="no-referrer" alt="ALI TEST LIVE LINK" />
Description
Upgraded to Craft 3.0.3 and all thumbs in all asset/image fields give a 404 error. The image still exists locally and clicking through to edit the image will load the original image.
Also if "Update Asset Indexes" is clicked, it will remove all assets from the site.
I've tried this with two different locally hosted websites and both gave the same error.
Steps to reproduce
Additional info