Socioboard-5.0 icon indicating copy to clipboard operation
Socioboard-5.0 copied to clipboard

Error While Loading Microservices Update, Feed, Notification & Publish

Open jon4short opened this issue 2 years ago • 7 comments

Below is the error code I get when trying to run the microservice in nodemon.. eg. nodemon update.server.js

`{

error: TypeError: Cannot read properties of undefined (reading 'use_env_variable')

  at file:///var/www/html/socioboard/socioboard-api/Common/Sequelize-cli/models/index.js:21:12

  at ModuleJob.run (node:internal/modules/esm/module_job:198:25)

  at async Promise.all (index 0)

  at async ESMLoader.import (node:internal/modules/esm/loader:409:24)

  at async loadESM (node:internal/process/esm_loader:85:5)

  at async handleMainPromise (node:internal/modules/run_main:61:12),

level: 'error',

message: "uncaughtException: Cannot read properties of undefined (reading 'use_env_variable')\n" +

"TypeError: Cannot read properties of undefined (reading 'use_env_variable')\n" +

'    at file:///var/www/html/socioboard/socioboard-api/Common/Sequelize-cli/models/index.js:21:12\n' +

'    at ModuleJob.run (node:internal/modules/esm/module_job:198:25)\n' +

'    at async Promise.all (index 0)\n' +

'    at async ESMLoader.import (node:internal/modules/esm/loader:409:24)\n' +

'    at async loadESM (node:internal/process/esm_loader:85:5)\n' +

'    at async handleMainPromise (node:internal/modules/run_main:61:12)',

stack: "TypeError: Cannot read properties of undefined (reading 'use_env_variable')\n" +

'    at file:///var/www/html/socioboard/socioboard-api/Common/Sequelize-cli/models/index.js:21:12\n' +

'    at ModuleJob.run (node:internal/modules/esm/module_job:198:25)\n' +

'    at async Promise.all (index 0)\n' +

'    at async ESMLoader.import (node:internal/modules/esm/loader:409:24)\n' +

'    at async loadESM (node:internal/process/esm_loader:85:5)\n' +

'    at async handleMainPromise (node:internal/modules/run_main:61:12)',

exception: true,

date: 'Mon Apr 25 2022 09:42:42 GMT+0400 (Gulf Standard Time)',

process: {

pid: 11055,

uid: 0,

gid: 0,

cwd: '/var/www/html/socioboard/socioboard-api/Update',

execPath: '/usr/local/bin/node',

version: 'v18.0.0',

argv: [

  '/usr/local/bin/node',

  '/var/www/html/socioboard/socioboard-api/Update/update.server.js'

],

memoryUsage: {

  rss: 119390208,

  heapTotal: 72232960,

  heapUsed: 41872016,

  external: 22828907,

  arrayBuffers: 18985669

}

},

os: { loadavg: [ 0.15, 0.2, 0.26 ], uptime: 1450.79 },

trace: [

{

  column: 12,

  file: 'file:///var/www/html/socioboard/socioboard-api/Common/Sequelize-cli/models/index.js',

  function: null,

  line: 21,

  method: null,

  native: false

},

{

  column: 25,

  file: 'node:internal/modules/esm/module_job',

  function: 'ModuleJob.run',

  line: 198,

  method: 'run',

  native: false

},

{

  column: null,

  file: null,

  function: 'async Promise.all',

  line: null,

  method: 'all',

  native: false

},

{

  column: 24,

  file: 'node:internal/modules/esm/loader',

  function: 'async ESMLoader.import',

  line: 409,

  method: 'import',

  native: false

},

{

  column: 5,

  file: 'node:internal/process/esm_loader',

  function: 'async loadESM',

  line: 85,

  method: null,

  native: false

},

{

  column: 12,

  file: 'node:internal/modules/run_main',

  function: 'async handleMainPromise',

  line: 61,

  method: null,

  native: false

}`

jon4short avatar Apr 25 '22 11:04 jon4short

Hi @jon4short , Please check the logs for respective service , for example user service logs will be located at \BackEnd\User\resources\Log\ResponseLog

Look like missing config please update it

Jagadeesha-R avatar May 04 '22 09:05 Jagadeesha-R

I was getting a similar error while starting user service but my issue was caused because I didn't run the following command export NODE_ENV=development Hope it helps someone.

opensourcelib avatar May 06 '22 14:05 opensourcelib

having same issue trying to run sb 5.0 on ubuntu focal. opensourcelib's suggestion doesn't solve it.

0spinboson avatar Jul 09 '22 13:07 0spinboson

I'm getting the same error and looking through the logs it doesn't say any ENV is missing

node# cat user29-07-2022.log { error: TypeError: Cannot read properties of undefined (reading 'use_env_variable') at file:///home/nodejs/web/socioboard.revrebel.app/public_html/socioboard-api/Common/Sequelize-cli/models/index.js:21:12 at ModuleJob.run (node:internal/modules/esm/module_job:185:25) at async Promise.all (index 0) at async ESMLoader.import (node:internal/modules/esm/loader:281:24) at async loadESM (node:internal/process/esm_loader:88:5) at async handleMainPromise (node:internal/modules/run_main:65:12), level: 'error', message: "uncaughtException: Cannot read properties of undefined (reading 'use_env_variable')\n" + "TypeError: Cannot read properties of undefined (reading 'use_env_variable')\n" + ' at file:///home/nodejs/web/socioboard.revrebel.app/public_html/socioboard-api/Common/Sequelize-cli/models/index.js:21:12\n' + ' at ModuleJob.run (node:internal/modules/esm/module_job:185:25)\n' + ' at async Promise.all (index 0)\n' + ' at async ESMLoader.import (node:internal/modules/esm/loader:281:24)\n' + ' at async loadESM (node:internal/process/esm_loader:88:5)\n' + ' at async handleMainPromise (node:internal/modules/run_main:65:12)', stack: "TypeError: Cannot read properties of undefined (reading 'use_env_variable')\n" + ' at file:///home/nodejs/web/socioboard.revrebel.app/public_html/socioboard-api/Common/Sequelize-cli/models/index.js:21:12\n' + ' at ModuleJob.run (node:internal/modules/esm/module_job:185:25)\n' + ' at async Promise.all (index 0)\n' + ' at async ESMLoader.import (node:internal/modules/esm/loader:281:24)\n' + ' at async loadESM (node:internal/process/esm_loader:88:5)\n' + ' at async handleMainPromise (node:internal/modules/run_main:65:12)', exception: true, date: 'Fri Jul 29 2022 00:25:57 GMT-0700 (Pacific Daylight Time)', process: { pid: 3026791, uid: 0, gid: 0, cwd: '/home/nodejs/web/socioboard.revrebel.app/public_html/socioboard-api/User', execPath: '/root/.nvm/versions/node/v16.13.0/bin/node', version: 'v16.13.0', argv: [ '/root/.nvm/versions/node/v16.13.0/bin/node', '/home/nodejs/web/socioboard.revrebel.app/public_html/socioboard-api/User/user.server.js' ], memoryUsage: { rss: 115466240, heapTotal: 70287360, heapUsed: 51472208, external: 30656786, arrayBuffers: 20344650 } }, os: { loadavg: [ 0.46, 0.45, 0.53 ], uptime: 284823.53 }, trace: [ { column: 12, file: 'file:///home/nodejs/web/socioboard.revrebel.app/public_html/socioboard-api/Common/Sequelize-cli/models/index.js', function: null, line: 21, method: null, native: false }, { column: 25, file: 'node:internal/modules/esm/module_job', function: 'ModuleJob.run', line: 185, method: 'run', native: false }, { column: null, file: null, function: 'async Promise.all', line: null, method: 'all', native: false }, { column: 24, file: 'node:internal/modules/esm/loader', function: 'async ESMLoader.import', line: 281, method: 'import', native: false }, { column: 5, file: 'node:internal/process/esm_loader', function: 'async loadESM', line: 88, method: null, native: false }, { column: 12, file: 'node:internal/modules/run_main', function: 'async handleMainPromise', line: 65, method: null, native: false } ], timestamp: '2022-07-29T07:25:57.303Z' }

RR-Helpdesk avatar Jul 29 '22 07:07 RR-Helpdesk

@RevRebel Have you set MySQL details in socioboard-api/Common/Sequelize-cli/config/config.json?

vaughngx4 avatar Jul 29 '22 07:07 vaughngx4

Yes, all of that checks out. I ended up copying back in the original deployement.json and then changing all the variables again; however, now it won't let me past the Twitter API config. If I take the block or leave it in, or all dummy values I get the same error. Twitter denied my API access request, so I won't actually be able to connect to that channel. Anyway, around moving past the API not being defined?

error: Error: Configuration property "twitter_api" is not defined at Config.get (/home/nodejs/web/socioboard.revrebel.app/public_html/socioboard-api/Common/node_modules/config/lib/config.js> at new TeamLibs (file:///home/nodejs/web/socioboard.revrebel.app/public_html/socioboard-api/Common/Models/team.model.js:46:> at file:///home/nodejs/web/socioboard.revrebel.app/public_html/socioboard-api/Common/Models/invitation.model.js:11:18 at ModuleJob.run (node:internal/modules/esm/module_job:185:25) at async Promise.all (index 0) at async ESMLoader.import (node:internal/modules/esm/loader:281:24) at async loadESM (node:internal/process/esm_loader:88:5) at async handleMainPromise (node:internal/modules/run_main:65:12), level: 'error',

RR-Helpdesk avatar Jul 29 '22 16:07 RR-Helpdesk

@RevRebel I actually haven't gotten any of the apis working properly yet, still testing(don't have a whole lot of time or a pc to run it at a decent speed). Myself and a few others are working on testing and writing docs. If you have any luck with any of the API's let us know please.

vaughngx4 avatar Jul 29 '22 18:07 vaughngx4