Need help with nodebb-plugin-import

Technical Support
  • 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. GET http://localhost:4567/ 0 ()
    s.create @
    s @
    r.request @
    r.doPoll @
    i.poll @
    i.doOpen @ @ @
    i @
    i @ @
    (anonymous) @
    setTimeout (async)
    i.reconnect @
    i.onclose @
    (anonymous) @
    i.emit @
    i.onClose @
    (anonymous) @
    i.emit @
    i.onClose @
    i.onClose @
    ws.onclose @

    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.)

  • 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

  • @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 );

    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.

  • @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.

Suggested Topics