• Hello, now I just updated my forum using git and when I try to make a new post, nodebb crashes, but post is saved to database. Replying works great, happens when making a new topic

    Error
    /home/dovydas/Desktop/~~NodeJS/Forumas/node_modules/mongodb/lib/mongodb/connection/base.js:242
            throw message;      
                  ^
    TypeError: Object 3 has no method 'replace'
        at Object.module.getObjectFields (/home/dovydas/Desktop/~~NodeJS/Forumas/src/database/mongo.js:306:22)
        at Object.module.getObjectField (/home/dovydas/Desktop/~~NodeJS/Forumas/src/database/mongo.js:293:10)
        at /home/dovydas/Desktop/~~NodeJS/Forumas/src/topics.js:156:8
        at /home/dovydas/Desktop/~~NodeJS/Forumas/src/posts.js:81:8
        at Object.<anonymous> (/home/dovydas/Desktop/~~NodeJS/Forumas/src/postTools.js:245:4)
        at /home/dovydas/Desktop/~~NodeJS/Forumas/src/plugins.js:233:16
        at /home/dovydas/Desktop/~~NodeJS/Forumas/node_modules/async/lib/async.js:251:13
        at /home/dovydas/Desktop/~~NodeJS/Forumas/node_modules/async/lib/async.js:139:25
        at /home/dovydas/Desktop/~~NodeJS/Forumas/node_modules/async/lib/async.js:248:17
        at Object.Mentions.addMentions (/home/dovydas/Desktop/~~NodeJS/Forumas/node_modules/nodebb-plugin-mentions/library.js:72:11)
    

    P.S. not sure why code gets strikethrough đŸ˜„

  • GNU/Linux Admin

    Hmm... this is odd, it seems to be treating the topic tid as an Object instead of a String. @baris?

  • Admin NodeBB

    Can you update to https://github.com/designcreateplay/NodeBB/commit/a974c6fa99c0fc396edc73a190ad716b910b773f and see if it fixes your problem. I guess calling .replace on a number crashes.


  • @baris updated to latest and now server crashes imediately with

    /home/Forumas/node_modules/mongodb/lib/mongodb/connection/base.js:242
            throw message;      
                  ^
    ReferenceError: string is not defined
        at Object.module.getObjectFields (/home/Forumas/src/database/mongo.js:321:28)
        at /home/Forumas/src/webserver.js:211:10
        at /home/Forumas/node_modules/async/lib/async.js:508:21
        at /home/Forumas/node_modules/async/lib/async.js:224:13
        at /home/Forumas/node_modules/async/lib/async.js:108:13
        at Array.forEach (native)
        at _each (/home/Forumas/node_modules/async/lib/async.js:32:24)
        at async.each (/home/Forumas/node_modules/async/lib/async.js:107:9)
        at _asyncMap (/home/Forumas/node_modules/async/lib/async.js:223:9)
        at Object.map (/home/Forumas/node_modules/async/lib/async.js:201:23)
    

    Edit:
    simply there should be string with quotes around like "string" and server starts, but making a new topic results in crash

    /home/Forumas/node_modules/mongodb/lib/mongodb/connection/base.js:242
            throw message;      
                  ^
    TypeError: Object 4 has no method 'replace'
        at Object.module.setObjectField (/home/Forumas/src/database/mongo.js:272:17)
        at /home/Forumas/src/topics.js:162:10
        at /home/Forumas/src/database/mongo.js:313:4
        at /home/Forumas/src/database/mongo.js:346:4
        at /home/Forumas/node_modules/mongodb/lib/mongodb/collection/query.js:147:5
        at /home/Forumas/node_modules/mongodb/lib/mongodb/cursor.js:738:35
        at Cursor.close (/home/Forumas/node_modules/mongodb/lib/mongodb/cursor.js:959:5)
        at Cursor.nextObject (/home/Forumas/node_modules/mongodb/lib/mongodb/cursor.js:738:17)
        at commandHandler (/home/Forumas/node_modules/mongodb/lib/mongodb/cursor.js:713:14)
        at /home/Forumas/node_modules/mongodb/lib/mongodb/db.js:1806:9
    

  • By the way, deleting also crashes

    /home/Forumas/node_modules/mongodb/lib/mongodb/connection/base.js:242
            throw message;      
                  ^
    ReferenceError: uid is not defined
        at Object.ThreadTools.delete (/home/Forumas/src/threadTools.js:103:25)
        at /home/Forumas/src/postTools.js:155:25
        at /home/Forumas/src/threadTools.js:313:6
        at /home/Forumas/node_modules/async/lib/async.js:329:13
        at /home/Forumas/node_modules/async/lib/async.js:139:25
        at /home/Forumas/node_modules/async/lib/async.js:325:21
        at /home/Forumas/src/threadTools.js:306:7
        at /home/Forumas/src/posts.js:289:4
        at /home/Forumas/src/posts.js:278:5
        at Object.Plugins.fireHook (/home/Forumas/src/plugins.js:255:5)
    
  • Admin NodeBB


  • @baris yes, everything works. Thanks

  • Admin NodeBB

    Let us know if you have other problems! The mongodb support isn't 100% tested so I am glad you are using it and reporting bugs đŸ™‚

Suggested Topics

| |