I am getting the following message in my log after each cron run :"Could not delete temporary file "" during garbage collection" from various referrers. Is there a way to reset this or to find the particular process that triggers this?

Comments

firfin’s picture

I got this too. Think (in my case) it was caused by file entity and 'private files' setting. Removing the offending content, setting drupal to 'public files' and replacing the content solved the errors for me.

creact’s picture

Hmmm. Not quite sure what you mean.

firfin’s picture

Ok, a more elaborate version of #2 then:

I had the same error, the one from the issue title.
It disappeared after removing all content of a certain type. This contenttype was using file entity fields. And it was set to use the private (as opposed to public) files stream. There are know issues with using private files setting. I thought one of these made these errors appear.
So I removed all content of this type. Although I get the error the content does disappear.
Just the files remain. I removed the files using FTP.
I set all filesystem settings from private to public.
I recreated all content.
No more problem.

There is not much else I can say. But then again you might be experiencing a different issue. Even though it generates the same error.

creact’s picture

Which files did you delete and where?

firfin’s picture

from #3 :

So I removed all content of this type. Although I get the error, the content does disappear.

And with 'this type' I mean the contenttype that had a file field with the files setting set to 'private'. Like I said that did the trick for me. You could be experiencing another problem. I am sorry, but I do not know how to make it clearer. I also do not know why this solved it for me.

-- EDIT: corrected wrong comment number.

creact’s picture

I tried that first but it did not work. Thank you for your input though.

creact’s picture

Issue summary: View changes

Could not delete temporary file "" during garbage collection

deltaag’s picture

Issue summary: View changes

I am getting the same error in a distribution. Updated Drupl via distribution couple of times, and currently running D 7.28, and there is a private files setup in the distribution (OpenAtrium 7.x-2.19).

What I find is in file_managed table there was a record with blank uri (and application/octet-stream filemime, and undefined type). Removing this record fix my issue.

Hope this helps!

onewomanbiz’s picture

I got this error when running CRON temporary;//xxx.png n'a pas pu être effacé. URI est incorrect .
As suggested previously, I deleted the offending line from the file_managed table. I then ran cron again and found the issue resolved.

kamenrs’s picture

I got the error: Could not delete temporary file "uri" during garbage collection
As described in #7 I searched the DB table "file_managed" for "uri" in the "uri" column:
SELECT *
FROM `file_managed`
WHERE `uri` LIKE 'uri'

There was one record. After deleting it the error disappeared.

medienverbinder’s picture

This soulution works for me: Link

Just running cron.php as user1 or with admin rights clears this error.
Aurochs’s picture

@deltaag - many thanks! awesome solved

What I find is in file_managed table there was a record with blank uri (and application/octet-stream filemime, and undefined type). Removing this record fix my issue.

that helped!

wiredescape’s picture

D8.2.5
Was getting temp file not found errors during cron run.

Cause: I suspect caused by not changing temporary folder path when dev site moved from local server to production server. Temp files are recorded in db but after site moved files no longer exist on server or in different location.

Solution: set correct path to tmp folder, delete temp file records in db table "file_managed", and run cron manually. No more errors.

Thanks: https://www.drupal.org/node/2682873

Nonconforme’s picture

StatusFileSize
new466 bytes

Same error for me. The file was uploaded into temporary:// and not into public://. To fix the issue add a propertie (#image_location) to the file object.

Nonconforme’s picture

StatusFileSize
new460 bytes

Version: 7.2 » 7.x-dev

Core issues are now filed against the dev versions where changes will be made. Document the specific release you are using in your issue comment. More information about choosing a version.

Status: Active » Closed (outdated)

Automatically closed because Drupal 7 security and bugfix support has ended as of 5 January 2025. If the issue verifiably applies to later versions, please reopen with details and update the version.