Need help with nodebb-plugin-import
-
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.
-
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.
-
@rogerlevy it looks like the require of your exporter is failing. I suggest checking that your js is valid.
But @akhoury is that expert
-
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.
-
@rogerlevy you should only need sudo if you used it at some other point during installation