Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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.
Comment | File | Size | Author |
---|---|---|---|
#12 | interdiff-3075645-8-12.txt | 779 bytes | chr.fritsch |
#12 | 3075645-12.patch | 1.7 KB | chr.fritsch |
#8 | interdiff-3075645-6-8.txt | 1.61 KB | chr.fritsch |
#8 | 3075645-8.patch | 1.35 KB | chr.fritsch |
#8 | 3075645-8-FAIL.patch | 674 bytes | chr.fritsch |
Comments
Comment #2
super_romeo CreditAttribution: super_romeo commentedComment #4
maacl CreditAttribution: maacl commentedI 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 whenis_dir()
failed. (https://git.drupalcode.org/project/drupal/commit/dd907896b159b8a384847e3...), and only called the `scanDirectory` Service if the direcotry exists. NowscanDirectory
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.
Comment #5
maacl CreditAttribution: maacl commentedMessed up the path in the patch, sorry.
Comment #6
chr.fritschI added a failing test to prove the fix.
Comment #8
chr.fritschThanks to @alexpott. He helped me realize that I am testing way too much things here.
So here is a super simple test.
Comment #10
volkerk CreditAttribution: volkerk at Thunder commentedTested 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.
Comment #11
alexpottI think this test needs more explanation. And potentially a check that the expected directories don't exist before calling the method.
Comment #12
chr.fritschOk, added some explanation and a check for the directories.
Since this is a bug, it should go into 8.8.x.
Comment #13
volkerk CreditAttribution: volkerk at Thunder commented#11 is adressed, looks good to me.
Comment #14
alexpottCommitted 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.
Comment #19
mglamanI 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 👍