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

[4.x]: Dynamic subfolders are said to be missing when updating asset indexes #11949

Closed
jammid opened this issue Sep 15, 2022 · 11 comments · Fixed by #11960
Closed

[4.x]: Dynamic subfolders are said to be missing when updating asset indexes #11949

jammid opened this issue Sep 15, 2022 · 11 comments · Fixed by #11960
Assignees

Comments

@jammid
Copy link

jammid commented Sep 15, 2022

What happened?

Description

We are using dynamic subfolders with our S3 bucket in Craft.
When we update the asset indexes crafts gives a prompt saying those folders are missing when they're not.

Steps to reproduce

  1. Create an asset field that uses an asset volume with a S3 filesystem.
  2. Make the asset location dynamic e.g. {slug}
  3. Upload an asset using the asset field
  4. Update the asset indexes for the asset volume

Expected behavior

Asset indexes are updated successfully and dynamic folders are found.

Actual behavior

Craft gives a prompt saying the dynamic folders are missing

Craft CMS version

4.2.4

PHP version

8.1.9

Operating system and version

Linux 4.19.0-21-cloud-amd64

Database type and version

MySQL 10.4.25

Image driver and version

GD 8.1.9

Installed plugins and versions

  • Amazon S3
  • Control Panel CSS
  • Expanded Singles
  • Feed Me
  • Field Manager
  • Redactor
@brandonkelly
Copy link
Member

You shouldn’t ever have to update asset indexes to pull in folders/files that were created by Assets fields in the same Craft install.

When you upload new files to your Assets field, are they showing up anywhere within the Assets index page – without going through the Asset Indexes utility?

@jammid
Copy link
Author

jammid commented Sep 15, 2022

Yes, when the files are uploaded they show up in the assets page as expected.

Those were just the steps to reproduce the issue.

I thought it was possible to update the data indexes and delete assets from the index, that are actually missing in the bucket - without deleting the dynamic subfolders from the index as well. As it is now I have to manually deselect them, even though they aren't actually missing.

@brandonkelly
Copy link
Member

Can you show a screenshot of the indexer when it says they’re missing?

@jammid
Copy link
Author

jammid commented Sep 16, 2022

Sure. Here is a screenshot where one file is missing from the bucket but the folder is not.

missing-folder

Asset location

field

Slug

slug

Bucket

bucket

@brandonkelly
Copy link
Member

Are there any files within not-missing-folder/ on S3?

@jammid
Copy link
Author

jammid commented Sep 16, 2022

Yes. Here is the folder contents

folder-content

@brandonkelly
Copy link
Member

Can you try reverting to Craft 4.2.3 and see if that fixes this? Change your craftcms/cms constraint in composer.json to 4.2.3 (no ^ or ~) and run composer update.

@jammid
Copy link
Author

jammid commented Sep 16, 2022

This happened in Craft 4.2.3. I updated to 4.2.4 to see if it would fix this

@brandonkelly
Copy link
Member

Thanks! We’ve fixed this for the next release. Should go out tomorrow.

@jammid
Copy link
Author

jammid commented Sep 20, 2022

That's great! Thank you.

@brandonkelly
Copy link
Member

Craft 4.2.5 is out with that fix. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants