Could Not Delete Temporary File Publicfeedsresourcescsv During Garbage Collection
after importing 5000 nodes from a CSV file,
all fields are ok, except an image field which imported and the images are showing correctly, but I found the following message repeating thousands of times in the dblog with each cron.
=====
Did not delete temporary file "public://personals/personpic/110623-9611.jpg" during garbage collection, because it is in use by the following modules: file.
=====
why this is showing? and how to get rid of it in a clean way?
Thanks
jeffersonpesed1983.blogspot.com
Source: https://www.drupal.org/project/feeds/issues/2409075
Comments
I solved the problem by executing this query from phpMyadmin :
====
UPDATE `file_managed` SET status=1
====
where I found that all imported images are set to status=0, and this means it is temporary file, and cron will delete any file with status = 0 , and that what was happening silently in my website,
but in my case the new imported images should be permanent and needs to be modified to status = 1 .
and this what I did.
my problem was solved but the Qs is, why it was set to Zero ? this might help others in the future.
I also see this message tons of time in the log (using Feeds 7.x-2.0-alpha8+41-dev, so I need to recheck with the latest dev). Not yet sure what's causing it, though. Could it had something to do with the File (Field) Paths module? Are you using that module too, @theroyal?
I have this problem, and am using File (field) paths. After importing a few hundred jpegs, they show up on every cron run. This issue and one here https://www.drupal.org/node/1468324 are the only really relevant clues I could find, along with a couple that seemed to have the same cause, i.e. the status is set to 0. I'll try the @theroyal's solution
Thanks a million @theroyal, that worked a treat.
Comment #6
twistor Credit Attribution: twistor as a volunteer commented
Comment #7
amklose
English
Wisconsin
Credit Attribution: amklose commented
What does it mean if the status of the file is 2? I had a bunch of errors deleting files in the log and all of those files had status=2 in the database.
Sorry, after 2 years I just noticed that my issue had some comments.
and, yes, I am using File (field) paths.
@amklose, actually, am sorry, I barely remember this issue, so am not sure, with that you get the answer from others.
Hello,
I'm using File Field paths and I'm getting the same warnings in the logs...
After a little verification, I see in the file_managed table of the db that all the imported images have 0 for the status.
I have this problem on several sites. Can we force the status of the images during the feeds importation? With a hook? With feeds tamper?
Thanks for your help.
Comment #10
MegaChriz Credit Attribution: MegaChriz as a volunteer commented
@kumkum29
I have this issue too on a site, but I still haven't found what is causing it. I wasn't able to reproduce it yet on a minimal install. In #2512824-9: Set file status to permanent. I proposed a strategy for finding the cause of the issue.