You are my hero!
esfandiar
Posts
-
TypeError: date.format is not a function -
Debugging in V2Hello Nodebb community,
I am upgrading to V2 and one of the very first issues I am facing now is debugging of webpacked project. Is there an instruction for noob like me on how to set up my dev environment in more organized manner either in VS Code or Chrome devTools?
I used to add my plugin folders as a workspace in Chrome devTools and automatic binding would allow me to debug the source files:
Sadly I am unable to do the same in V2 due to webpack source mapping not playing nice with Chrome. All I have came up with so far is enabling source-mapping by adding the following to webpack.xxx.js:
devtool: 'source-map'
This allows me to open inspection view of the source-mapped Nodebb project in Chrome devTools and view the scripts-client.js for debugging.
It is not as intuitive and simple as before so I am seeking you assistance.
Thank you all in advance for your guidance.
-
Upgrade to 1.17.2 and cluster configurtaionThank you so much for confirming this. Since my config was working before, I changed my focus only to network and found the issue.
In my nginx config I had:
listen 80 listen 443 default ssl
Miraculously this had worked for last four years without issue. My server has 4 nic cards and nginx was listening to the wrong interface.
Modified nginx config to bound it to the right ip:port to solve the issue.Happy to be back on-line and thanks for your support.
-
Upgrade to 1.17.2 and cluster configurtaionHi,
Do we need to make any changes to nginx configuration? I am having problem to connect to production server using my previously working nginx/network settings. Newly installed Nginx version is 1.18.0 and loads without error. Could you please advise if any additional Redis related changes is required.
Thank you in advance.
-
Upgrade to 1.17.2 and cluster configurtaion@esfandiar
I ended up installing the latest OS and all required tool chain since support for ubuntu 19.10 has ended and repos are archived. Nodebb had no issues with Redis once the redis-server was started.
I still have unrelated issue with NPM not creating global links of my plugin folders and linking to the nodebb instance like it did before. My script creates links for each plugin project but only the last link is accessible and the rest disappearing. Possibly NPM and dependency issues but I am still investigating.Thank you very much for your support.
-
Upgrade to 1.17.2 and cluster configurtaion@baris said in Upgrade to 1.17.2 and cluster configurtaion:
"redis": {
"host": "127.0.0.1",
"port": "6379",
"password": "xxx",
"database": "0"
},Thank you, will do as you instructed and report back.
-
Upgrade to 1.17.2 and cluster configurtaionHello Everyone,
I finally migrated my code from 1.14.x baseline to work on 1.17.x on my windows development environment and trying to push changes to ubuntu-based production. After several failed attempt to upgrade from 1.14.x to 1.17.x on my ubuntu staging box, I started off fresh from 1.17.x and was able to build and run without my code. After linking my code and config, it stops loading with this error ONLY in clustered config:
./nodebb dev NodeBB v1.17.2 Copyright (C) 2013-2014 NodeBB Inc. This program comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to redistribute it under certain conditions. For the full license, please visit: http://www.gnu.org/copyleft/gpl.html Clustering enabled: Spinning up 8 process(es). 2021-09-19T19:30:26.667Z [4561/13673] - verbose: * using configuration stored in: /home/project/dt5.1/config.json 2021-09-19T19:30:26.671Z [4561/13673] - info: Initializing NodeBB v1.17.2 https://esfandiar.com 2021-09-19T19:30:26.672Z [4561/13673] - verbose: * using mongo store at xxx.xxx.xxx.xxx:pppppp 2021-09-19T19:30:26.672Z [4561/13673] - verbose: * using themes stored in: /home/project/dt5.1/node_modules 2021-09-19T19:30:26.679Z [4562/13674] - verbose: * using configuration stored in: /home/project/dt5.1/config.json 2021-09-19T19:30:26.691Z [4569/13714] - verbose: * using configuration stored in: /home/project/dt5.1/config.json 2021-09-19T19:30:26.710Z [4568/13707] - verbose: * using configuration stored in: /home/project/dt5.1/config.json 2021-09-19T19:30:26.730Z [4561/13673] - error: Error: [[error:redis-required-for-pubsub]] at get (/home/project/dt5.1/src/pubsub.js:51:9) at Object.on (/home/project/dt5.1/src/pubsub.js:63:3) at module.exports (/home/project/dt5.1/src/cacheCreate.js:58:9) at Object.module.exports.create (/home/project/dt5.1/src/database/cache.js:5:9) at module.exports (/home/project/dt5.1/src/database/mongo/hash.js:6:36) at Object.<anonymous> (/home/project/dt5.1/src/database/mongo.js:182:24) at Module._compile (internal/modules/cjs/loader.js:999:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) [cluster] Child Process (13673) has exited (code: 0, signal: null) 2021-09-19T19:30:26.742Z [4562/13674] - error: Error: [[error:redis-required-for-pubsub]] at get (/home/project/dt5.1/src/pubsub.js:51:9) at Object.on (/home/project/dt5.1/src/pubsub.js:63:3) at module.exports (/home/project/dt5.1/src/cacheCreate.js:58:9) at Object.module.exports.create (/home/project/dt5.1/src/database/cache.js:5:9) at module.exports (/home/project/dt5.1/src/database/mongo/hash.js:6:36) at Object.<anonymous> (/home/project/dt5.1/src/database/mongo.js:182:24) at Module._compile (internal/modules/cjs/loader.js:999:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) [cluster] Child Process (13674) has exited (code: 0, signal: null) 2021-09-19T19:30:26.753Z [4569/13714] - error: Error: [[error:redis-required-for-pubsub]] at get (/home/project/dt5.1/src/pubsub.js:51:9) at Object.on (/home/project/dt5.1/src/pubsub.js:63:3) at module.exports (/home/project/dt5.1/src/cacheCreate.js:58:9) at Object.module.exports.create (/home/project/dt5.1/src/database/cache.js:5:9) at module.exports (/home/project/dt5.1/src/database/mongo/hash.js:6:36) at Object.<anonymous> (/home/project/dt5.1/src/database/mongo.js:182:24) at Module._compile (internal/modules/cjs/loader.js:999:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) [cluster] Child Process (13714) has exited (code: 0, signal: null) 2021-09-19T19:30:26.758Z [4566/13700] - verbose: * using configuration stored in: /home/project/dt5.1/config.json 2021-09-19T19:30:26.765Z [4563/13678] - verbose: * using configuration stored in: /home/project/dt5.1/config.json 2021-09-19T19:30:26.780Z [4564/13686] - verbose: * using configuration stored in: /home/project/dt5.1/config.json 2021-09-19T19:30:26.781Z [4565/13694] - verbose: * using configuration stored in: /home/project/dt5.1/config.json 2021-09-19T19:30:26.802Z [4568/13707] - error: Error: [[error:redis-required-for-pubsub]] at get (/home/project/dt5.1/src/pubsub.js:51:9) at Object.on (/home/project/dt5.1/src/pubsub.js:63:3) at module.exports (/home/project/dt5.1/src/cacheCreate.js:58:9) at Object.module.exports.create (/home/project/dt5.1/src/database/cache.js:5:9) at module.exports (/home/project/dt5.1/src/database/mongo/hash.js:6:36) at Object.<anonymous> (/home/project/dt5.1/src/database/mongo.js:182:24) at Module._compile (internal/modules/cjs/loader.js:999:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) [cluster] Child Process (13707) has exited (code: 0, signal: null) 2021-09-19T19:30:26.829Z [4566/13700] - error: Error: [[error:redis-required-for-pubsub]] at get (/home/project/dt5.1/src/pubsub.js:51:9) at Object.on (/home/project/dt5.1/src/pubsub.js:63:3) at module.exports (/home/project/dt5.1/src/cacheCreate.js:58:9) at Object.module.exports.create (/home/project/dt5.1/src/database/cache.js:5:9) at module.exports (/home/project/dt5.1/src/database/mongo/hash.js:6:36) at Object.<anonymous> (/home/project/dt5.1/src/database/mongo.js:182:24) at Module._compile (internal/modules/cjs/loader.js:999:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) [cluster] Child Process (13700) has exited (code: 0, signal: null) [... repeats once for each port]
Do I need to install Redis manually? My server is ubuntu 19.10 and running node v16.
Thanks for your support.
-
After Upgrade to 1.17.1 debugging is not working.Hello,
I am upgraded from 1.14.3 to 1.16.1 and 1.17.1.
I have a heavily customized theme based on the old Material theme and a dozen of various plugins that I have developed.
After making changes to categories, filters, etc., I have the site up and running. However my debug console is filled with service worker and require.js mismatch errors.
Debugging is extremely slow down to crawl and most importantly no longer opens up the source maps and goes to Nodebb minified package, why? I am unable to debug and this release still requires more work to become production ready so I am staying at release 1.14.3 for now until I can figure this out and test everything else.
Below is my log and thanks in advance for your guidance and help as always.
Uncaught (in promise) TypeError: Failed to fetch service-worker.js:1 Uncaught (in promise) TypeError: Failed to fetch adservice.google.com/tt/r:1 Failed to load resource: net::ERR_FAILED require.js:143 Uncaught Error: Mismatched anonymous define() module: function(){return function(e){var t={};function n(i){if(t[i]){return t[i].exports}var r=t[i]={i:i,l:false,exports:{}};e[i].call(r.exports,r,r.exports,n);r.l=true;return r.exports}n.m=e;n.c=t;n.d=function(e,t,i){if(!n.o(e,t)){Object.defineProperty(e,t,{enumerable:true,get:i})}};n.r=function(e){if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(e,"__esModule",{value:true})};n.t=function(e,t){if(t&1)e=n(e);if(t&8)return e;if(t&4&&typeof e==="object"&&e&&e.__esModule)return e;var i=Object.create(null);n.r(i);Object.defineProperty(i,"default",{enumerable:true,value:e});if(t&2&&typeof e!="string")for(var r in e)n.d(i,r,function(t){return e[t]}.bind(null,r));return i};n.n=function(e){var t=e&&e.__esModule?function t(){return e["default"]}:function t(){return e};n.d(t,"a",t);return t};n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};n.p="";return n(n.s="./build/index.js")}({"./build/index.js":function(e,t,n){"use strict";function i(e){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){i=function e(t){return typeof t}}else{i=function e(t){return t&&typeof Symbol==="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t}}return i(e)}Object.defineProperty(t,"__esModule",{value:true});t.io=t.Socket=t.Manager=t.protocol=void 0;var r=n("./build/url.js");var o=n("./build/manager.js");var a=n("./node_modules/debug/src/browser.js")("socket.io-client");e.exports=t=l;var s=t.managers={};function l(e,t){if(i(e)==="object"){t=e;e=undefined}t=t||{};var n=r.url(e,t.path||"/socket.io");var l=n.source;var c=n.id;var u=n.path;var f=s[c]&&u in s[c]["nsps"];var d=t.forceNew||t["force new connection"]||false===t.multiplex||f;var p;if(d){a("ignoring socket cache for %s",l);p=new o.Manager(l,t)}else{if(!s[c]){a("new io instance for %s",l);s[c]=new o.Manager(l,t)}p=s[c]}if(n.query&&!t.query){t.query=n.queryKey}return p.socket(n.path,t)}t.io=l;var c=n("./node_modules/socket.io-parser/dist/index.js");Object.defineProperty(t,"protocol",{enumerable:true,get:function e(){return c.protocol}});t.connect=l;var u=n("./build/manager.js");Object.defineProperty(t,"Manager",{enumerable:true,get:function e(){return u.Manager}});var f=n("./build/socket.js");Object.defineProperty(t,"Socket",{enumerable:true,get:function e(){return f.Socket}});t["default"]=l},"./build/manager.js":function(e,t,n){"use strict";function i(e){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){i=function e(t){return typeof t}}else{i=function e(t){return t&&typeof Symbol==="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t}}return i(e)}function r(e,t){if(!(e instanceof t)){throw new TypeError("Cannot call a class as a function")}}function o(e,t){for(var n=0;n<t.length;n++){var i=t[n];i.enumerable=i.enumerable||false;i.configurable=true;if("value"in i)i.writable=true;Object.defineProperty(e,i.key,i)}}function a(e,t,n){if(t)o(e.prototype,t);if(n)o(e,n);return e}function s(e,t){if(typeof t!=="function"&&t!==null){throw new TypeError("Super expression must either be null or a function")}e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:true,configurable:true}});if(t)l(e,t)}function l(e,t){l=Object.setPrototypeOf||function e(t,n){t.__proto__=n;return t};return l(e,t)}function c(e){var t=d();return function n(){var i=p(e),r;if(t){var o=p(this).constructor;r=Reflect.construct(i,arguments,o)}else{r=i.apply(this,arguments)}return u(this,r)}}function u(e,t){if(t&&(i(t)==="object"||typeof t==="function")){return t}return f(e)}function f(e){if(e===void 0){throw new ReferenceError("this hasn't been initialised - super() hasn't been called")}return e}function d(){if(typeof Reflect==="undefined"||!Reflect.construct)return false;if(Reflect.construct.sham)return false;if(typeof Proxy==="function")return true;try{Date.prototype.toString.call(Reflect.construct(Date,[],function(){}));return true}catch(e){return false}}function p(e){p=Object.setPrototypeOf?Object.getPrototypeOf:function e(t){return t.__proto__||Object.getPrototypeOf(t)};return p(e)}Object.defineProperty(t,"__esModule",{value:true});t.Manager=void 0;var h=n("./node_modules/engine.io-client/lib/index.js");var m=n("./build/socket.js");var g=n("./node_modules/socket.io-parser/dist/index.js");var v=n("./build/on.js");var y=n("./node_modules/backo2/index.js");var b=n("./build/typed-events.js");var w=n("./node_modules/debug/src/browser.js")("socket.io-client:manager");var x=function(e){s(n,e);var t=c(n);function n(e,o){var a;r(this,n);a=t.call(this);a.nsps={};a.subs=[];if(e&&"object"===i(e)){o=e;e=undefined}o=o||{};o.path=o.path||"/socket.io";a.opts=o;a.reconnection(o.reconnection!==false);a.reconnectionAttempts(o.reconnectionAttempts||Infinity);a.reconnectionDelay(o.reconnectionDelay||1e3);a.reconnectionDelayMax(o.reconnectionDelayMax||5e3);a.randohttps://requirejs.org/docs/errors.html#mismatch at makeError (require.js:168) at D (require.js:1254) at Object.o [as require] (require.js:1446) at requirejs (require.js:1797) at Function.req.config (require.js:1805) at require-config.js:3 chartist.js:330 Uncaught TypeError: Cannot read property 'querySelectorAll' of null at Object.c.createSvg (chartist.js:330) at f.d [as createChart] (chartist.js:3778) at f.h (chartist.js:1925) jquery.js:10109 Failed to load resource: the server responded with a status of 404 (Not Found) send @ jquery.js:10109 autofill.js:105 Uncaught TypeError: Cannot read property 'tid' of undefined at autofill.js:105 at Object.execCb (require.js:1696) at n.check (require.js:883) at n.enable (require.js:1176) at n.init (require.js:788) at require.js:1460 require.js:772 Uncaught TypeError: e.slice is not a function at n.init (require.js:772) at require.js:1460 :4567/assets/src/modules/jqueryui.js?v=o91jt8lcv8k:1 Failed to load resource: the server responded with a status of 404 (Not Found) require.js:143 Uncaught Error: Script error for "jqueryui" service-worker.js:1 Uncaught (in promise) TypeError: Failed to fetch socket.io.js:3956 GET http://localhost:4567/socket.io/?EIO=4&transport=polling&t=NgHu2XK net::ERR_FAILED e @ socket.io.js:3956 n @ socket.io.js:3875 e @ socket.io.js:3804 e @ socket.io.js:3840 e @ socket.io.js:4230 e @ socket.io.js:4173 e @ socket.io.js:3288 e @ socket.io.js:2687 n @ socket.io.js:2615 e.exports @ socket.io.js:2453 e @ socket.io.js:409 (anonymous) @ socket.io.js:700 setTimeout (async) e @ socket.io.js:692 e @ socket.io.js:666 i.emit @ socket.io.js:1915 e @ socket.io.js:3143 (anonymous) @ socket.io.js:2712 i.emit @ socket.io.js:1915 e @ socket.io.js:3371 e @ socket.io.js:4612 service-worker.js:1 Uncaught (in promise) TypeError: Failed to fetch socket.io.js:3956 GET http://localhost:4567/socket.io/?EIO=4&transport=polling&t=NgHu3cg net::ERR_FAILED
-
AjaxSubmit not uploading formData using my Custom Route@esfandiar Downgraded the node version and it seems that the issue is now resolved. Thanks.
-
AjaxSubmit not uploading formData using my Custom RouteHello:
This module worked flawlessly for nearly three years but since a few days ago, I noticed again it wasn't transferring the file names to the route destination. It works intermittently but mostly it bombs out and returns error: onUploadError:Something went wrong while parsing server response.
To my knowledge, nothing has changed in that code listed above and I didn't see anything in the breaking changes related to this issue. It has been a couple of days of tracing and debugging so I am out of ideas.
I was running Nodebb 1.14.2 for a while when all this started to happen and then I upgraded to latest 1.14.3 Beta hoping that rebuilding the package from source in the process may help. It sure helped with some tools finding their missing components (like Huskey) but wasn't the cure.
At this juncture, I am not sure which is the best way to go: Either use a 3rd party tool like Multer or there is an easier fix.
Edit: This issue currently appears only on the windows development environment and production seems to be working (Nodebb 1.14.2/Ubuntu 18) normally. There are no server-side error logs related to this operation. My Node.js is v14.12.0, Mongo 4.2.2 and Chrome Version 86.0.4240.111 64. I have same issue with IE.
Any advice would be greatly appreciated.
Thank you.
-
invalid-score Error occurred during upgrade from 1.13.2 to 1.14.2@baris I applied and It also worked on the production server. Thanks again.
-
invalid-score Error occurred during upgrade from 1.13.2 to 1.14.2@baris Out of 8 child processes that I start, only the first one shows this error:
2020-08-01T12:55:32.629Z [4567/12206] - verbose: [plugins] Loaded plugin: ratings [ ] (2700/153439) 1% Error occurred 2020-08-01T12:55:32.676Z [4567/12206] - verbose: [plugins] Loaded plugin: nodebb-plugin-spam-be-gone 2020-08-01T12:55:32.676Z [4562/12179] - error: Error: [[error:invalid-score, null]] at sortedSetAddBulk (/home/nodebb/dt1140/src/database/mongo/sorted/add.js:38:11) at module.sortedSetAdd (/home/nodebb/dt1140/src/database/mongo/sorted/add.js:12:17) at Object.wrapperCallback [as sortedSetAdd] (/home/nodebb/dt1140/src/promisify.js:50:18) at batch.processSortedSet.progress (/home/nodebb/dt1140/src/upgrades/1.14.1/readd_deleted_recent_topics.js:25:13) at process._tickCallback (internal/process/next_tick.js:68:7) 2020-08-01T12:55:32.678Z [4567/12206] - verbose: [plugins] Loaded plugin: ezbase 2020-08-01T12:55:32.688Z [4567/12206] - verbose: [plugins] Loaded plugin: cash 2020-08-01T12:55:32.691Z [4567/12206] - verbose: [plugins] Loaded plugin: ezcomposer [cluster] Child Process (12179) has exited (code: 0, signal: null)
That server was upgraded from 1.14.1 to 1.14.2 and it comes up and it appears that operates normal.
Thanks again for your time.
-
invalid-score Error occurred during upgrade from 1.13.2 to 1.14.2@baris , it worked. Much appreciated and thanks for helping out. How about the other server that 1.14.2 is installed but the message appears at start up? Should I reinstall?
Thanks again.
-
invalid-score Error occurred during upgrade from 1.13.2 to 1.14.2Hello,
I am upgrading my nodebb from 1.13.1 to 1.14.2 on a windows PC with the following tools installed:
- Node: v10.15.3
- NPM: 6.9.0
- Mongo: 4.2
The following is the procedure I am following to upgrade:
>git fetch >git checkout v1.14.x >git merge origin/v1.14.x rem delete my custom plugin links before upgrade >rmdir /S /Q ./node_modules/charter >rmdir /S /Q ./node_modules/customFields ... >nodebb upgrade rem link back the custom plugins >linker.bat >nodebb build >nodebb dev
Unfortunately nodebb upgrade fails after hitting the following error during the upgrade:
>nodebb upgrade Updating NodeBB... 1. Updating package.json file with defaults... OK 2. Bringing base dependencies up to date... started npm WARN [email protected] requires a peer of nodebb-plugin-emoji@^2.0.0 but none is installed. You must install peer dependencies yourself. npm WARN [email protected] requires a peer of textcomplete@^0.14.2 but none is installed. You must install peer dependencies yourself. npm WARN [email protected] requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself. npm WARN [email protected] requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself. audited 1341 packages in 8.521s found 34 vulnerabilities (32 low, 2 high) run `npm audit fix` to fix them, or `npm audit` for details 3. Checking installed plugins for updates... OK 4. Updating NodeBB data store schema... Parsing upgrade scripts... 2020-07-31T21:26:46.543Z [4567/25544] - warn: [upgrade/appendPluginScripts] Unable to read plugin.json for plugin `semantix`. Skipping. 2020-07-31T21:26:46.551Z [4567/25544] - warn: [upgrade/appendPluginScripts] Unable to read plugin.json for plugin `charter`. Skipping. 2020-07-31T21:26:46.552Z [4567/25544] - warn: [upgrade/appendPluginScripts] Unable to read plugin.json for plugin `customFields`. Skipping. 2020-07-31T21:26:46.554Z [4567/25544] - warn: [upgrade/appendPluginScripts] Unable to read plugin.json for plugin `people`. Skipping. 2020-07-31T21:26:46.557Z [4567/25544] - warn: [upgrade/appendPluginScripts] Unable to read plugin.json for plugin `ratings`. Skipping. 2020-07-31T21:26:46.558Z [4567/25544] - warn: [upgrade/appendPluginScripts] Unable to read plugin.json for plugin `nodebb-plugin-desktop-notifications`. Skipping. 2020-07-31T21:26:46.559Z [4567/25544] - warn: [upgrade/appendPluginScripts] Unable to read plugin.json for plugin `stores`. Skipping. 2020-07-31T21:26:46.561Z [4567/25544] - warn: [upgrade/appendPluginScripts] Unable to read plugin.json for plugin `topics`. Skipping. 2020-07-31T21:26:46.562Z [4567/25544] - warn: [upgrade/appendPluginScripts] Unable to read plugin.json for plugin `cash`. Skipping. 2020-07-31T21:26:46.563Z [4567/25544] - warn: [upgrade/appendPluginScripts] Unable to read plugin.json for plugin `composter`. Skipping. 2020-07-31T21:26:46.564Z [4567/25544] - warn: [upgrade/appendPluginScripts] Unable to read plugin.json for plugin `nodebb-widget-search-bar`. Skipping. OK | 1 script(s) found, 88 skipped [ ] (2700/134100) 2% Error occurredent... Error occurred during upgrade: Error: [[error:invalid-score, null]] at sortedSetAddBulk (d:\nb114\src\database\mongo\sorted\add.js:38:11) at module.sortedSetAdd (d:\nb114\src\database\mongo\sorted\add.js:12:17) at Object.wrapperCallback [as sortedSetAdd] (d:\nb114\src\promisify.js:50:18) at batch.processSortedSet.progress (d:\nb114\src\upgrades\1.14.1\readd_deleted_recent_topics.js:25:13) at process._tickCallback (internal/process/next_tick.js:68:7) 2020-07-31T21:26:48.818Z [4567/25544] - error: uncaughtException: [[error:invalid-score, null]] Error: [[error:invalid-score, null]] at sortedSetAddBulk (d:\nb114\src\database\mongo\sorted\add.js:38:11) at module.sortedSetAdd (d:\nb114\src\database\mongo\sorted\add.js:12:17) at Object.wrapperCallback [as sortedSetAdd] (d:\nb114\src\promisify.js:50:18) at batch.processSortedSet.progress (d:\nb114\src\upgrades\1.14.1\readd_deleted_recent_topics.js:25:13) at process._tickCallback (internal/process/next_tick.js:68:7) {"error":{},"stack":"Error: [[error:invalid-score, null]]\n at sortedSetAddBulk (d:\\nb114\\src\\database\\mongo\\sorted\\add.js:38:11)\n at module.sortedSetAdd (d:\\nb114\\src\\database\\mongo\\sorted\\add.js:12:17)\n at Object.wrapperCallback [as sortedSetAdd] (d:\\nb114\\src\\promisify.js:50:18)\n at batch.processSortedSet.progress (d:\\nb114\\src\\upgrades\\1.14.1\\readd_deleted_recent_topics.js:25:13)\n at process._tickCallback (internal/process/next_tick.js:68:7)","exception":true,"date":"Fri Jul 31 2020 17:26:48 GMT-0400 (Eastern Daylight Time)","process":{"pid":25544,"uid":null,"gid":null,"cwd":"d:\\nb114","execPath":"C:\\Program Files\\nodejs\\node.exe","version":"v10.15.3","argv":["C:\\Program Files\\nodejs\\node.exe","d:\\nb114\\nodebb","upgrade"],"memoryUsage":{"rss":140382208,"heapTotal":117174272,"heapUsed":88787944,"external":19743471}},"os":{"loadavg":[0,0,0],"uptime":2309923},"trace":[{"column":11,"file":"d:\\nb114\\src\\database\\mongo\\sorted\\add.js","function":"sortedSetAddBulk","line":38,"method":null,"native":false},{"column":17,"file":"d:\\nb114\\src\\database\\mongo\\sorted\\add.js","function":"module.sortedSetAdd","line":12,"method":"sortedSetAdd","native":false},{"column":18,"file":"d:\\nb114\\src\\promisify.js","function":"Object.wrapperCallback [as sortedSetAdd]","line":50,"method":"wrapperCallback [as sortedSetAdd]","native":false},{"column":13,"file":"d:\\nb114\\src\\upgrades\\1.14.1\\readd_deleted_recent_topics.js","function":"batch.processSortedSet.progress","line":25,"method":"progress","native":false},{"column":7,"file":"internal/process/next_tick.js","function":"process._tickCallback","line":68,"method":"_tickCallback","native":false}]}
Let me add that I have successfully upgraded my Ubuntu production server to the latest nodebb running 1.14.2. I still get the same invalid-score message during the startup but is not fatal.
Please let me know if any other information is needed and as always thank you all for your great work and support. .
-
async/await migration issue: Data doesn't reach the plugin after a socket emit@baris Your solution was confirmed working for my plugin. Thank you Sir.
-
async/await migration issue: Data doesn't reach the plugin after a socket emit@oplik0 I believe you are right. I am going wait longer and hope the support to be added later in the future. Thank you,
-
async/await migration issue: Data doesn't reach the plugin after a socket emit@julian sorry if I confused you.
getEmployeeDetail is Client-side function that emits the socket call to invoke server-side function SocketPlugins.employees.getDetail.
I verified that the call flow is being performed correctly and data from client is sent to server as those logs indicates.
The only issue is the client-side expects to get the 'person' data from server but somehow employees is populated with some weird callback object instead of the person. Is this correct assumption that returned value is assigned to employees in the following statement:
var employees = await socket.emit('plugins.employees.getDetail', {empId: empId,});
Thanks.
//Server-side var SocketPlugins = require.main.require('./src/socket.io/plugins'); SocketPlugins.employees.getDetail = async function (socket, data) { if (!data || !data.empId) { return null; } console.log('Got these parameters:', data); // params gets here as it should ... do something ... var person = { name: 'jimmy johnes', id: '007', address: '123 happy street', phone: '800-324-2344' }; return person; **// Data is not going back to client** } // client-side async function getEmployeeDetail(empId) { var employees = await socket.emit('plugins.employees.getDetail', { empId: empId, }); console.log('Received callback from employees.getDetail:', employees); *// returned data is not correct and appears to be the callback object instead?!?!!?* }
-
async/await migration issue: Data doesn't reach the plugin after a socket emitRe: Problem with socket in plugin after 1.12.2 -> 1.13.0 upgrade
Hello,
In a related scenario to the referenced topic, I have a problem migrating my plugins to conform with async/await calls. Looks like the returned data doesn't get to the calling client-side function.
Here is my test code in async/await form. Please note these functions work in old callback form:var SocketPlugins = require.main.require('./src/socket.io/plugins'); SocketPlugins.employees.getDetail = async function (socket, data) { if (!data || !data.empId) { return null; } console.log('Got these parameters:', data); // params gets here as it should ... do something ... var person = { name: 'jimmy johnes', id: '007', address: '123 happy street', phone: '800-324-2344' }; return person; **// Data is not going back to client** } async function getEmployeeDetail(empId) { var employees = await socket.emit('plugins.employees.getDetail', { empId: empId, }); console.log('Received callback from employees.getDetail:', employees); *// returned data is not correct and appears to be the callback object ?!?!!?* }
Client-side console:
Received callback from employees.getDetail: Tue Jan 28 2020 09:24:29 GMT-0500 (Eastern Standard Time)
i {io: i, nsp: "/", json: i, ids: 11, acks: {…}, …}*Thank you for your guidance.
-
Killed... Killed and Killed@Dan-Reyes I am not expert in Nodebb but getting stuck means number of things to me. I usually take some basic steps to get passed build/upgrade issues. You said you reset the plugin already. I would also clean the existing assets in \build\public and rebuild again. (Make sure back up your existing folder before experimenting)
Do you have any custom plugins? If you do, you may have an error that cases uglifier to silently crash. Temporarily modify uglify-es in node-module and change the following in parse.js and run to see if you get any parsing error:
function JS_Parse_Error(message, filename, line, col, pos) { this.message = message; this.filename = filename; this.line = line; this.col = col; this.pos = pos; // add following if not there console.log('*** Error: File:%s, Line:%d, Col:%d, Pos:%d, message:%s', filename, line, col, pos, message) }; If you do have error clear it up and try again. Next, you may want to try the upgrade with different options to get to the bottom of this:
nodebb upgrade --help
Some tools like Atom have odd behavior and I recommend to quit them when upgrading. If nothing works, then you may want to install a fresh copy somewhere else and copy the content and overwrite your working instance. Again make sure to backup your data and custom work whatever you do.