Need help with nodebb-plugin-import



  • I've written and added my exporter plugin (using npm link for testing on my local install) but when I run the import, it says busy by event exporter.require and then dies. No output in the log. What could that indicate?


  • GNU/Linux Admin

    Can you paste the entire stack trace?



  • Not sure what stack trace you mean. I noticed a couple errors in the console... both of them are the same.

    socket.io.js:2 GET http://localhost:4567/socket.io/?EIO=3&transport=polling&t=MEIpBH6 0 ()
    s.create @ socket.io.js:2
    s @ socket.io.js:2
    r.request @ socket.io.js:2
    r.doPoll @ socket.io.js:2
    i.poll @ socket.io.js:2
    i.doOpen @ socket.io.js:2
    i.open @ socket.io.js:2
    i.open @ socket.io.js:1
    i @ socket.io.js:1
    i @ socket.io.js:1
    i.open.i.connect @ socket.io.js:1
    (anonymous) @ socket.io.js:1
    setTimeout (async)
    i.reconnect @ socket.io.js:1
    i.onclose @ socket.io.js:1
    (anonymous) @ socket.io.js:2
    i.emit @ socket.io.js:1
    i.onClose @ socket.io.js:1
    (anonymous) @ socket.io.js:1
    i.emit @ socket.io.js:1
    i.onClose @ socket.io.js:2
    i.onClose @ socket.io.js:2
    ws.onclose @ socket.io.js:2
    

    By the way I am on NodeBB 1.8.2 and trying to import a custom forum's data from a mongo db.



  • Just bumping this in case it got lost in the pile. I'm still stumped, and were hoping to complete this migration sooner rather than later. (If this wasn't necessary let me know and I won't do it in the future.)


  • Global Moderator

    So you're getting that message... Does it show up as an alert, or what?

    What did you paste, some log from your JS console in your browser? It doesn't even have the error message with it.

    Screenshots of what you're saying would probably be helpful if possible.



  • 0_1527692738637_Screenshot from 2018-05-30 11-03-57.png0_1527692778648_Screenshot from 2018-05-30 11-06-10.png


  • Global Moderator

    @rogerlevy it looks like the require of your exporter is failing. I suggest checking that your js is valid.

    But @akhoury is that expert



  • It was my exporter. I'm in the process of debugging it by testing it directly and will report if I succeed in the import or run into any other obstacles.



  • I got my exporter's testrun() function to run without errors, but the importer plugin still gets stuck, just in a different way.

    It hangs with this message displayed:

    State: busy, by event: exporter.require | Phase: Progress: 0%

    With nothing in the log.

    Then if I restart nodebb and RESUME the import, I get this:

    State: idle, by event: | Phase: categoriesImportStart Progress: 0/1, 0.0000000%
    Logs (in reversed order, newest on top)
    [2018-06-04T15:15:15.858Z] current phase: categoriesImportStart
    [2018-06-04T15:15:15.857Z] Phase ::: categoriesImportStart
    [2018-06-04T15:15:15.856Z] Skipping importGroups Phase
    

    My category import function is really simple. The old forum doesn't have categories, so I generate a fake one.

    
        var cid;
    
        Exporter.getPaginatedCategories = function(start, limit, callback) {
            callback = !_.isFunction(callback) ? noop : callback;
    
            var err, map;
    
            cid = new mongoose.Types.ObjectId;
            console.log( cid );
    
            map = {};
            map[ cid ] = {
                "_cid": cid, // REQUIRED
                "_name": "General Discussion 2", // REQUIRED
                "_description": "A place to talk about whatever you want" // OPTIONAL
            };
    
            callback( null, map );
    
        };
    

    Update:
    I just ran the importer with a "null" exporter (one that just outputs empty hashes) and I'm getting the same behavior.



  • I managed to get it all working on my own. Yay for me.

    To others who may be scratching their heads writing an exporter, I highly recommend using Exporter.log and enable Verbose logging or you wont' see anything - but this is for when you're developing an exporting only - with finished ones probably not a good idea with big DB's.

    More info about what happened can be found in output.log

    Also start nodebb with root privileges or the importer won't be able to write the files it needs to.


  • Global Moderator

    @rogerlevy you should only need sudo if you used it at some other point during installation



  • @pitaj Ah. Then I guess that was what happened for me.


Log in to reply
 

Suggested Topics

  • 3
  • 5
  • 2
  • 7
  • 5
| |