Steps to reproduce:

Clear caches via Drush twice.

Note the following errors in watchdog.

The file assets://css was not deleted because it does not exist.
The file assets://js was not deleted because it does not exist.

This does not happen when caches are cleared via admin interface. I think that's because assets are generated when the performance form is loaded.

Issue fork drupal-3374283

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

Chi created an issue. See original summary.

chi’s picture

chi’s picture

Issue summary: View changes
acbramley’s picture

Version: 10.1.x-dev » 11.x-dev

Confirmed on latest 11.x

Can reproduce off a clean install and then a cache clear as well.

In fact, it shows up during site install

 [notice] Performed install task: install_profile_modules
 [notice] The file assets://css was not deleted because it does not exist.
 [notice] Performed install task: install_profile_themes

acbramley’s picture

Status: Active » Needs review
Issue tags: +Needs tests

Run out of time to write tests but the fix seems pretty simple.

catch’s picture

Closed #3374317: Aggregation sometimes tries to delete non-existing directories as duplicate. Agreed we can just check file_exists() here.

I think we should consider making ::deleteRecursive() stop logging a message though, so opened #3374319: FileSystem::deleteRecursive() shouldn't log a message when it tries to delete a non-existent directory.

acbramley’s picture

Issue tags: -Needs tests

Not the most elegant test but it does what it needs to, couldn't find any existing test coverage of deleteAll().

chi’s picture

chi’s picture

Typically such things are tested through a decorated logger that can stack logs for later. I wonder if Drupal has such a logger. There is TestSystemLoggerChannel but it covers a specific use case.

indrapatil’s picture

@chi This issue from yesterday I was facing in my system
$ vendor/bin/drush cr
[notice] The file assets://css was not deleted because it does not exist.
[notice] The file assets://js was not deleted because it does not exist.
[success] Cache rebuild complete.

The front end totally broke the css after that I tried disabling
Aggregate CSS files
Aggregate JavaScript files

Now the site is working but when I run the vendor/bin/drush cr
still exist errors.
[notice] The file assets://css was not deleted because it does not exist.
[notice] The file assets://js was not deleted because it does not exist.

catch’s picture

Status: Needs review » Postponed

#3374319: FileSystem::deleteRecursive() shouldn't log a message when it tries to delete a non-existent directory is RTBC, I think we might be OK there, so postponing this temporarily pending that one getting committed.

acbramley’s picture

Status: Postponed » Closed (duplicate)

Retested after #3374319: FileSystem::deleteRecursive() shouldn't log a message when it tries to delete a non-existent directory got in and we get the same result (no log) so we can close this now.