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 a Feeds Batch Import is interrupted for any reason (dropped network connection, timeout, server crash, etc), Imports can be left in a 'locked' state, so that the user can not try the import again.
Patch provides a one-button form for resetting the state of all feeds.
Comment | File | Size | Author |
---|---|---|---|
#21 | 1454666-21-feeds-unlocking.patch | 1.02 KB | milesw |
#10 | 2012.03.13.Capacitors.Ceramic.CC0000001.CC0019999 - EuroCom.part_.png | 34.1 KB | Ace Cooper |
#7 | feeds-unlock-1454666-7.patch | 4.49 KB | Jon Pugh |
#4 | 0001-1454666-by-johnv-too-to-reset-stuck-feeds.patch | 1.84 KB | geek-merlin |
#1 | feeds-break-lock.patch | 1.45 KB | matt2000 |
Comments
Comment #1
matt2000 CreditAttribution: matt2000 commentedMinor fix to previous patch. ($form shouldn't be passed by reference. Oops.)
Comment #2
johnvThis issue seems a nice work-around for the following problem: #1018520: Feeds Importer cannot be used anymore after first 'Import', then 'Delete items'. .
Haven't tested it yet.
Comment #3
geek-merlinworks like a charm:
* started import of huge file
* aborted it
* failed to start a new import => "import locked"
* "break lock"
* successfully started new import
so rtbc.
Comment #4
geek-merlincould not apply last patch with ease so rerolled for convenience.
Comment #5
johnv@axel.rutz, I deserve no credit - I merely crossposted the issues...
Comment #6
emackn CreditAttribution: emackn commentedI don't think it's a good idea to update the status of every feed to unlock a single feed.
Comment #7
Jon PughAttached is a patch, totally reprogrammed to add this feature to all importers:
- Adds "Unlock" tab to each importer, right next to "delete items"
- Provides another feeds_acccess() type, "unlock". This gives each feed importer a new permission. To test you must check your user permissions, unless you are UID=1
- It uses db_update() to set state = FALSE. I do not know if this is the best way but there was no obvious way to save a feed source
Comment #8
alexmc CreditAttribution: alexmc commentedI've just tried the patch found in #7 because I have a feed stuck on 22% for the last two days.
Notes:
1) Why not set admin permissions to use this by default. (Ok - I added them manually)
2) I had to clear Drupal caches before the "unlock" tab appeared.
Unfortunately it tells me "This Importer is not locked, therefor it cannot be unlocked."
Well - it is definitely stuck and not doing anything, and I can't restart it.... So if that isn't "locked" what is?
So looking at the patch and the rest of the code for me
$progress = $source->progressImporting();
if ($progress !== FEEDS_BATCH_COMPLETE) {
$form['submit']['#disabled'] = TRUE;
$form['submit']['#value'] =
t('Importing (@progress %)', array('@progress' => number_format(100 * $progress, 0)));
}
is happening AND
$progress = $source->progressClearing();
if ($progress == FEEDS_BATCH_COMPLETE) {
$form['source_locked'] = array(
'#type' => 'markup',
'#title' => t('Not Locked'),
'#tree' => TRUE,
'#markup' => t('This Importer is not locked, therefor it cannot be unlocked.'),
);
for the same importer... what gives? Why does the first say "progressImporting" and the patch say "progressClearing"?
Comment #9
Jason Jaeger Geoprobe CreditAttribution: Jason Jaeger Geoprobe commentedI also get "This Importer is not locked, therefor it cannot be unlocked." when using the patch in #7 when it is most definitely stuck.
Comment #10
Ace Cooper CreditAttribution: Ace Cooper commentedThe patch #7 let's me unlock only those feeds, where I try to delete imported items after a failed session.
So I can only unlock importers when the status of the feed goes as follows:
When I try to unlock the failed session that says "Importing - 85 % complete." the Unlock option is Disabled ("This Importer is not locked, therefor it cannot be unlocked.").
Comment #11
ethnovode CreditAttribution: ethnovode commentedPatch in #7 is working for me. Thanks.
Comment #12
Rob_Feature CreditAttribution: Rob_Feature commentedSuper necessary addition to this module. Tested and had success with #7. With a few of us reporting success, I'm marking this as RTBC
Comment #13
that0n3guy CreditAttribution: that0n3guy commentedI'm with #9 and #10 on this one. I'm switching back to needs work. The title off this issue is "Add tool the reset stuck feeds". Some feeds are stuck, but not locked. This patch doesn't help with that.
Comment #14
Rob_Feature CreditAttribution: Rob_Feature commentedI guess I'm interested to hear the difference between 'locked' and 'stuck' (such technical terms!). It seems to me that when a feed gets 'stuck' the module 'locks' it. I know thats not correct, but can we get some clarity on the difference?
Comment #15
that0n3guy CreditAttribution: that0n3guy commentedWell, I can tell you that my feed is stuck at 2% b/c of this issue: http://drupal.org/node/1029102. If I could re-run it, I could debug it easier.
Comment #16
Rob_Feature CreditAttribution: Rob_Feature commentedI think we're doing something similar here that0n3guy because I was over on that issue with the same problem. I found that as long as the feed wasn't 'locked' (using this patch) then I could continue the import using cron (drush cron). Have you tried running cron to see if things advance at all?
Comment #17
that0n3guy CreditAttribution: that0n3guy commentedYup, thats what that other issue is all about.... errors when running cron. It doesn't really have anything to do with this issue I think.
If a feed is "locked" OR if its having issues and erroring out when cron is ran, either way both cases need to be able to be reset
Comment #18
Rob_Feature CreditAttribution: Rob_Feature commentedI think I'd disagree because this issue has the patch for the locked problem (whcih was the original intent of this post)...I'd suggest that this title changes to reflect the 'locked' fix since that's what everyone here is testing with these patches. I might suggest creating a new issue if your problem is different than this 'locked' stuff that's addressed here.
See the initial post:
Changing the issue title and marking as reviewed by community.
Comment #19
franzThis looks like a formidable feature, and I agree with #18. Let's get this in and one way or the other, this will be useful when dealing with similar "stuck" problems which can go on in other issues.
Comment #20
franzComitted this.
Other "stuck-like" issues can be opened as spin-offs from this.
Comment #21
milesw CreditAttribution: milesw commentedUmm, the patch that went in does not reset stuck imports, it only resets stuck "clears". Comments #8, #9, #10, #13 indicated that it was not working for stuck imports.
With the minor change in this patch it works for imports as well. Patch is against HEAD, of course.
Comment #22
franzThanks for the addition, milesw, from what I read in the latest comments, it was a misunderstanding that lead me to believe those cases were of a different kind. This time the issue for locked is address, I believe.
Comment #23
milesw CreditAttribution: milesw commented@franz: Thanks for taking care of this. :)
Comment #25
Flimmer1970 CreditAttribution: Flimmer1970 commentedno Patch from the patches above is working!
only workaround is directly in SQL:
update feeds_source set state = NULL WHERE id = 'xxx';
update feeds_source set fetcher_result = NULL WHERE id = 'xxx';
Comment #26
GuyPaddock CreditAttribution: GuyPaddock commented@Flimmer1970: We use this feature every day without issue. How can you say it's not working?
Comment #27
densolis CreditAttribution: densolis commentedI had this issue also. But I have to wonder why this patch has not made it way into the module.
Anyhow, I disabled the feed from the Structure -> Importer (/admin/structure/feeds) menu and then re-enabled it. And that "unstuck" the feed.
If I have this issue again, I will download and install the patch.
Comment #28
thomasmurphy CreditAttribution: thomasmurphy commentedDid anyone mention the unlock tab on the importer?
Comment #29
ndf CreditAttribution: ndf at Dx Experts for Media.Monks commenteda-like #25 with drush