craftcms / craftcms/cms

Removing files from the index after updating asset indexes may fail silently

Open
#7,269 2 comments 0 reactions 1 assignee View on GitHub

@andris-sevcenko is already working on this.

Since Dec 15, 2020.

bug severity:minor
Dominant language
PHP
Stars
3.6k
Forks
705
Avg merge
1d 5h
Merged PRs (30d)
134

Description

Description

If you have a large number of removed assets and go to update the asset indexes, attempting to remove missing folders and files from the index can fail however the UI shows it as being successful.

From the error log on request to admin/actions/utilities/asset-index-perform-action:

yii\base\ErrorException: Unknown: Input variables exceeded 1000. To increase the limit change max_input_vars in php.ini.
#2 /app/vendor/yiisoft/yii2/base/ErrorException.php(43): require
#1 /app/vendor/craftcms/cms/bootstrap/web.php(51): require
#0 index.php(20): null
Steps to reproduce

Something like this I imagine:

  1. Create an S3 volume where the bucket has 1000 assets and sync it up. (When we ran into this we had 799 files to be deleted)
  2. Change the S3 bucket to one that doesn't have any files.
  3. Go to Utilities -> Asset Indexes, click Update Asset Indexes then choose to remove all. A tick will be shown but the above error appears in the log.
Additional info
  • Craft version: 3.5.15.1
  • PHP version: 7.4
  • Database driver & version: MySQL
  • Plugins & versions: AWS S3 1.2.11

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.