Download & Extend

Suspend/pause or cancel import

Project:Node import
Version:6.x-1.1
Component:User interface
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review

Issue Summary

Please urgently help or else I will be in trouble with my ISP. I started a content import task using Node_import. The cvs files has only 100 records, but now the process is continuing to run and has imported 15320 records and is at 9%. How do I stop this task? I cannot reboot the machine because the website is hosted at ISP. I tried disabling the module and deleting the module folder but it didn't work. The process kept on running and inserting rows in my database. It's till running as I write.

Please help urgently.

Comments

#1

If the node_import folder is no longer present, then I don't see how it could continue ??

Have you deleted the task? (admin/content/node_import/list)

#2

The 'delete' action link did appear when the status was "In progress". Anyway, luckily it was a test site so I had to drop the whole database using my ISP's Control Panel and that's when the import process terminated. Imagine if it was a production site! Interestingly, even suspending the site using the Control Panel didn't help becuase when I re-acivated the site, the process was still running. Perhaps there is a need for a Cancel action to stop an import process before it finishes.

Thanks for reply nevertheless

#3

When I was testing the node import process I was under the impression that it would import the next node by refreshing the browser using the "success action" function of form processing.. When I closed the browser the import would stop, and if I clicked on the import process again it would pick up from where it left off...

Robrecht, just for clarification how does the update loop work..

-John G

#4

Title:How do I terminate Node_Import process/task?» Suspend/pause or cancel import
Component:Miscellaneous» User interface
Category:bug report» feature request
Priority:critical» normal
Assigned to:chalee» Anonymous

Yes John, that's how it works: by Javascript requests (AJAX). Every second a request is made that refreshes the progress bar on browser-side while on server-side a number of nodes are imported.

If Javascript is disabled or the window is closed, then the import task is suspended until you revisit the page or when cron runs for the site.

Let's make this a feature request: ability to suspend/pause a import task. Or to cancel the task (eg if you see too many errors popping up).

Still I don't understand how the task would continue after deactivating/reactivation the site. It only continues on cron which is normally only run every hour. And on cron runs, not all rows are imported anyway.

#5

Assigned to:Anonymous» chalee
Status:active» closed (fixed)

#6

Version:6.x-1.0-rc4» 6.x-1.x-dev
Assigned to:chalee» Anonymous

I just ran into this issue too - large import that I needed to stop. Here's what I did: I went to phpMyAdmin and found the "node_import_tasks" table. I found the current import task (was the last record in the table) and edited it. The last field, status, was 0 and I changed it to 2 and saved the record. The import stopped immediately and I was able then to download the errors.

RJ, did I hurt anything by doing this?

-JCL

#7

Any word on whether this is a safe way to stop an import?

#8

I have figured a way to do this and it works perfectly. Use your ftp and delete the csv file you uploaded. It stops on a dime.

#9

Thanks for the tip Naturalist but I still support this feature request (if anyone cares)

#10

Much needed; subscribing.

#11

Status:closed (fixed)» active

Reopening this - fell from under my radar when you set it as "closed".

@chalee : it is save to set the status column to 2. This will indeed stop the import as node_import will believe it has finished.

#12

I care :-)

#13

Version:6.x-1.x-dev» 6.x-1.0-rc4

+1

Just download 10K rows, error on the first row but can not stop :(

Comment #8 works, thanks Naturalist. But this broken my node table to content_type table, required to clean tables manually: node, node_revisions, and content_type_xyz.

#14

+1
Definitely a high priority feature.

#15

Version:6.x-1.0-rc4» 6.x-1.1

Working from Robrecht's indication that changing the status from 0 to 2 in the node_import_tasks table is a safe way to go, I'm running this SQL command in phpmyadmin to accomplish "stop all imports":

UPDATE node_import_tasks SET status = replace(status, '0', '2');

Is there an easy way to make this into a button on the node import interface page? I'm not familiar with the best way to execute SQL from within the drupal system.

Thanks!

#16

Status:active» needs review

I'm not very good at making .patch files and less good at getting them attached to issues.. but here goes.

While I was watching my errors climb slowly to the 29,900 records that I was importing I frantically tried to figure out a way to stop the import. Clearly is was going to fail all the way. After finding this thread and applying the idea presented in #6, I rolled this quick patch to add Abort functionality right along side the Delete function. Attached is the patch.

AttachmentSize
node_import_abort.patch 3.64 KB