moleculer icon indicating copy to clipboard operation
moleculer copied to clipboard

Detected a potential I/O issue on moleculer

Open jellydn opened this issue 4 years ago • 16 comments

Prerequisites

Please answer the following questions for yourself before submitting an issue.

  • [x] I am running the latest version
  • [x] I checked the documentation and found no answer
  • [x] I checked to make sure that this issue has not already been filed
  • [x] I'm reporting the issue to the correct repository

Current Behavior

  • Try to use https://clinicjs.org/ to inspect the moleculer-demo project (bootstrap by moleculer init project moleculer-demo). I have uploaded result to easy investigation if needed. https://upload.clinicjs.org/public/c8e39d5cdecc9e1df54d055dc3768122f384d6351a27cd149fc49e3d712bee26/92878.clinic-doctor.html
Detected a potential I/O issue
 - CPU Usage
 -Memory Usage

Expected Behavior

  • Should have no I/O issue.

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  • Check out the source code at https://codesandbox.io/s/rtxzs
  • Run yarn clinic:doctor or npm run clinic:doctor

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

  • Moleculer version: v0.14.7
  • NodeJS version: v10.20.1
  • Operating System: Mac OSX

jellydn avatar May 27 '20 07:05 jellydn

Hello @icebob I added the reproduce steps yesterday. Am I missing anything? Thanks.

jellydn avatar May 28 '20 03:05 jellydn

No, thanks, I saw, just I should reproduce it in my environment, as well. So this label is for me :)

icebob avatar May 28 '20 06:05 icebob

I can't reproduce because I've got error from clinic:

process exited with exit code 1
- Analysing dataError: No files matching the pattern found
    at notFound (d:\Work\tmp\mol-clinic\node_modules\@nearform\node-trace-log-join\index.js:66:15)
    at combine (d:\Work\tmp\mol-clinic\node_modules\@nearform\node-trace-log-join\index.js:25:34)
    at d:\Work\tmp\mol-clinic\node_modules\@nearform\node-trace-log-join\index.js:21:5
    at FSReqCallback.oncomplete (fs.js:146:23)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] clinic:doctor: `clinic doctor --on-port 'npx autocannon -R 30 localhost:3000/api/greeter/hello' -- node node_modules/moleculer/bin/moleculer-runner.js --repl --hot services/**/*.service.js`
npm ERR! Exit status 1
npm ERR!

icebob avatar May 29 '20 19:05 icebob

Thanks. Could you try to reproduce on again with this repo? https://github.com/jellydn/moleculer-demo I just tried and reproduced the issue.

jellydn avatar May 30 '20 02:05 jellydn

@jellydn

D:\Projects\moleculer-demo>npm run clinic:doctor

[email protected] clinic:doctor D:\Projects\moleculer-demo
npx clinic doctor --on-port 'npx autocannon -R 30 localhost:3000/api/greeter/hello' --  moleculer-runner --repl --hot services/*.service.js

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] clinic:doctor: `npx clinic doctor --on-port 'npx autocannon -R 30 localhost:3000/api/greeter/hello' --  moleculer-runner --repl --hot services/*.service.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] clinic:doctor script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\..\AppData\Roaming\npm-cache\_logs\2020-06-04T08_49_58_539Z-debug.log

debug.log:

13 verbose stack Error: [email protected] clinic:doctor: `npx clinic doctor --on-port 'npx autocannon -R 30 localhost:3000/api/greeter/hello' --  moleculer-runner --repl --hot services/*.service.js`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:310:20)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:310:20)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)

0xD8C4A475 avatar Jun 04 '20 08:06 0xD8C4A475

Thanks @IstenesImre @icebob I found the root cause. I have updated my reproduce repo https://github.com/jellydn/moleculer-demo Could you try again? Thanks.

jellydn avatar Jun 08 '20 00:06 jellydn

@jellydn

git clone https://github.com/jellydn/moleculer-demo && cd moleculer-demo && npm i && npm run clinic:doctor

Output:

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] clinic:doctor: `npx clinic doctor --on-port 'npx autocannon -R 30 localhost:3000/api/greeter/hello' --  moleculer-runner --repl --hot services/**/*.service.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] clinic:doctor script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\....\AppData\Roaming\npm-cache\_logs\2020-06-08T07_06_17_966Z-debug.log

Debug.log:

13 verbose stack Error: [email protected] clinic:doctor: `npx clinic doctor --on-port 'npx autocannon -R 30 localhost:3000/api/greeter/hello' --  moleculer-runner --repl --hot services/**/*.service.js`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:310:20)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:310:20)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)

Scripts:

"scripts": {
    "dev": "moleculer-runner --repl --hot services/**/*.service.js",
    "clinic:doctor": "npx clinic doctor --on-port 'npx autocannon -R 30 localhost:3000/api/greeter/hello' --  moleculer-runner --repl --hot services/**/*.service.js",
...
npm run dev           = starts normally
npm run clinic:doctor =  exit 1

0xD8C4A475 avatar Jun 08 '20 07:06 0xD8C4A475

@IstenesImre Sorry, could you try again? I just removed npx from the script command. Thanks.

git clone https://github.com/jellydn/moleculer-demo && cd moleculer-demo && npm i && npm run clinic:doctor

jellydn avatar Jun 09 '20 00:06 jellydn

@jellydn Same:

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] clinic:doctor: `clinic doctor --on-port 'npx autocannon -R 30 localhost:3000/api/greeter/hello' --  moleculer-runner --repl --hot services/**/*.service.js`
npm ERR! Exit status 1
1 silly lifecycle [email protected]~clinic:doctor: Returned: code: 1  signal: null
12 info lifecycle [email protected]~clinic:doctor: Failed to exec clinic:doctor script
13 verbose stack Error: [email protected] clinic:doctor: `clinic doctor --on-port 'npx autocannon -R 30 localhost:3000/api/greeter/hello' --  moleculer-runner --repl --hot services/**/*.service.js`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:310:20)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:310:20)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid [email protected]

0xD8C4A475 avatar Jun 09 '20 10:06 0xD8C4A475

Sorry, I missed removing npx on the command. Could you try again? 🙏 Thanks. @IstenesImre

git clone https://github.com/jellydn/moleculer-demo && cd moleculer-demo && npm i && npm run clinic:doctor

jellydn avatar Jun 09 '20 10:06 jellydn

@jellydn

> clinic doctor --on-port 'autocannon -R 30 localhost:3000/api/greeter/hello' --  moleculer-runner --repl --hot services/**/*.service.js

events.js:287
      throw er; // Unhandled 'error' event
      ^

Error: spawn moleculer-runner ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
Emitted 'error' event on ChildProcess instance at:
    at Process.ChildProcess._handle.onexit (internal/child_process.js:273:12)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21) {
  errno: 'ENOENT',
  code: 'ENOENT',
  syscall: 'spawn moleculer-runner',
  path: 'moleculer-runner',
  spawnargs: [ '--repl', '--hot', 'services/**/*.service.js' ]
}
3 verbose stack Error: [email protected] clinic:doctor: `clinic doctor --on-port 'autocannon -R 30 localhost:3000/api/greeter/hello' --  moleculer-runner --repl --hot services/**/*.service.js`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:310:20)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:310:20)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)

0xD8C4A475 avatar Jun 09 '20 10:06 0xD8C4A475

I guess you ran into this error because you're working on Windows. Here is my record. https://asciinema.org/a/W3OeM0S8yXWBojF0r2Hqb3yXu

Let me find a Windows PC and to reproduce the error. Thanks.

jellydn avatar Jun 09 '20 10:06 jellydn

On CentOS works fine! results (doctor+bubbleproof): clinic.zip

0xD8C4A475 avatar Jun 09 '20 11:06 0xD8C4A475

Yes, from your zip file @IstenesImre You will see the issue which I am talking about

image

jellydn avatar Jun 09 '20 11:06 jellydn

Could you tell me, in this moleculer-demo example what we see? Thanks :)

image

0xD8C4A475 avatar Jun 09 '20 11:06 0xD8C4A475

No problem. Pretty much is on the their document https://clinicjs.org/documentation/doctor/06-fixing-io-problem/ if you want to investigate.

jellydn avatar Jun 09 '20 11:06 jellydn