If run cron "Update indexes" job I have:

Drupal\Core\File\Exception\NotRegularDirectoryException: temporary://update-cache-60b12ec6 is not a directory. in Drupal\Core\File\FileSystem->scanDirectory() (line 682 of /var/www/drupal_8/web/core/lib/Drupal/Core/File/FileSystem.php).

Temporary dir is set to "/tmp".
In file system /tmp/update-cache-60b12ec6 is not exists.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

super_romeo created an issue. See original summary.

super_romeo’s picture

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

maacl’s picture

Priority: Normal » Major
FileSize
773 bytes

I am seeing the same on 8.8-alpha. As far I can tell, this relates to https://www.drupal.org/node/3035312. In the original file_scan_directory the Method did not throw an exception when is_dir() failed. (https://git.drupalcode.org/project/drupal/commit/dd907896b159b8a384847e3...), and only called the `scanDirectory` Service if the direcotry exists. Now scanDirectory gets called directly, and throws an exception: https://git.drupalcode.org/project/drupal/blob/dd907896b159b8a384847e3c9.... It is stated in the lines above, that the directories should not be created, if they not already exist.

My proposal would be to re-add the missing check on the directory in the update_clear_update_disk_cache() method. See attached patch.

As this breaks the Updater Module getting the data about available updates, I guess this is Major.

maacl’s picture

FileSize
713 bytes

Messed up the path in the patch, sorry.

chr.fritsch’s picture

I added a failing test to prove the fix.

The last submitted patch, 6: 3075645-6-FAIL.patch, failed testing. View results

chr.fritsch’s picture

Thanks to @alexpott. He helped me realize that I am testing way too much things here.

So here is a super simple test.

The last submitted patch, 8: 3075645-8-FAIL.patch, failed testing. View results

volkerk’s picture

Status: Needs review » Reviewed & tested by the community

Tested with fresh drupal install, hit cron, update manager temp directories are not yet and will not be created, therefore deletion attempt fails.
Patch fixes this.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/update/tests/src/Functional/UpdateCoreTest.php
@@ -385,6 +385,13 @@ public function testModulePageRunCron() {
+  /**
+   * Checks that clearing the disk cache works.
+   */
+  public function testClearDiskCache() {
+    update_clear_update_disk_cache();
+  }

I think this test needs more explanation. And potentially a check that the expected directories don't exist before calling the method.

chr.fritsch’s picture

Version: 8.9.x-dev » 8.8.x-dev
Status: Needs work » Needs review
FileSize
1.7 KB
779 bytes

Ok, added some explanation and a check for the directories.

Since this is a bug, it should go into 8.8.x.

volkerk’s picture

Status: Needs review » Reviewed & tested by the community

#11 is adressed, looks good to me.

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed and pushed 44b124ac10 to 9.0.x and 27c4c5ebe1 to 8.9.x and a2bc6f46bf to 8.8.x. Thanks!

Backported to 8.8.x after discussing with @catch.

  • alexpott committed 44b124a on 9.0.x
    Issue #3075645 by chr.fritsch, maacl, super_romeo, volkerk, alexpott:...

  • alexpott committed 27c4c5e on 8.9.x
    Issue #3075645 by chr.fritsch, maacl, super_romeo, volkerk, alexpott:...

  • alexpott committed a2bc6f4 on 8.8.x
    Issue #3075645 by chr.fritsch, maacl, super_romeo, volkerk, alexpott:...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

mglaman’s picture

I just wanted to say thanks for the fix! I thought I had something messed up in my container, and this was breaking sitemap generation. All groovy on beta1 👍