frocher / botnbot

Main repository for the Botnbot application.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

botnbot_probe container fails

fenidik opened this issue · comments

Sometimes botnbot_probe container fails.

npm debug log

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ]
2 info using npm@6.14.8
3 info using node@v14.15.1
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle bnb_probe@1.0.0~prestart: bnb_probe@1.0.0
6 info lifecycle bnb_probe@1.0.0~start: bnb_probe@1.0.0
7 verbose lifecycle bnb_probe@1.0.0~start: unsafe-perm in lifecycle true
8 verbose lifecycle bnb_probe@1.0.0~start: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/chrome/bnb_probe/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
9 verbose lifecycle bnb_probe@1.0.0~start: CWD: /home/chrome/bnb_probe
10 silly lifecycle bnb_probe@1.0.0~start: Args: [ '-c', 'node ./bin/www' ]
11 silly lifecycle bnb_probe@1.0.0~start: Returned: code: 1  signal: null
12 info lifecycle bnb_probe@1.0.0~start: Failed to exec start script
13 verbose stack Error: bnb_probe@1.0.0 start: `node ./bin/www`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:315:20)
13 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:315:20)
13 verbose stack     at maybeClose (internal/child_process.js:1048:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:288:5)
14 verbose pkgid bnb_probe@1.0.0
15 verbose cwd /home/chrome/bnb_probe
16 verbose Linux 5.4.0-1035-aws
17 verbose argv "/usr/bin/node" "/usr/bin/npm" "start"
18 verbose node v14.15.1
19 verbose npm  v6.14.8
20 error code ELIFECYCLE
21 error errno 1
22 error bnb_probe@1.0.0 start: `node ./bin/www`
22 error Exit status 1
23 error Failed at the bnb_probe@1.0.0 start script.
23 error This is probably not a problem with npm. There is likely additional logging output above.
24 verbose exit [ 1, true ]

container output

GET /uptime?url=https://site1&token=no%20token 200 46.508 ms - 20
GET /uptime?url=https://site2&token=no%20token 200 19.074 ms - 20
GET /har?url=https://site1&emulation=desktop&token=no%20token - - ms - -
ErrorEvent {
  target: WebSocket {
    _events: [Object: null prototype] { open: [Function], error: [Function] },
    _eventsCount: 2,
    _maxListeners: undefined,
    _binaryType: 'nodebuffer',
    _closeCode: 1006,
    _closeFrameReceived: false,
    _closeFrameSent: false,
    _closeMessage: '',
    _closeTimer: null,
    _extensions: {},
    _protocol: '',
    _readyState: 3,
    _receiver: null,
    _sender: null,
    _socket: null,
    _bufferedAmount: 0,
    _isServer: false,
    _redirects: 0,
    _url: 'ws://127.0.0.1:37501/devtools/browser/7328c61a-ac51-450d-b809-1fb9b614c36c',
    _req: null,
    [Symbol(kCapture)]: false
  },
  type: 'error',
  message: 'socket hang up',
  error: Error: socket hang up
      at connResetException (internal/errors.js:617:14)
      at Socket.socketOnEnd (_http_client.js:493:23)
      at Socket.emit (events.js:327:22)
      at endReadableNT (_stream_readable.js:1327:12)
      at processTicksAndRejections (internal/process/task_queues.js:80:21) {
    code: 'ECONNRESET'
  }
}
GET /har?url=https://site1&emulation=desktop&token=no%20token 500 97.672 ms - 34
Error: Failed to launch the browser process!
[0203/172016.214957:ERROR:platform_thread_posix.cc(135)] pthread_create: Resource temporarily unavailable (11)


TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

    at onClose (/home/chrome/bnb_probe/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:193:20)
    at ChildProcess.<anonymous> (/home/chrome/bnb_probe/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:184:79)
    at ChildProcess.emit (events.js:327:22)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
GET /har?url=https://site2&emulation=desktop&token=no%20token 500 76.906 ms - 34
Error: Failed to launch the browser process!


TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

    at onClose (/home/chrome/bnb_probe/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:193:20)
    at ChildProcess.<anonymous> (/home/chrome/bnb_probe/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:184:79)
    at ChildProcess.emit (events.js:327:22)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
GET /har?url=https://site1/blog/&emulation=mobile&token=no%20token 500 46.294 ms - 34
Error: Failed to launch the browser process!
/usr/bin/google-chrome: fork: retry: Resource temporarily unavailable
/usr/bin/google-chrome: fork: retry: Resource temporarily unavailable
/usr/bin/google-chrome: fork: retry: Resource temporarily unavailable
/usr/bin/google-chrome: fork: retry: Resource temporarily unavailable
/usr/bin/google-chrome: fork: retry: Resource temporarily unavailable
/usr/bin/google-chrome: fork: retry: Resource temporarily unavailable
/usr/bin/google-chrome: fork: Resource temporarily unavailable


TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

    at onClose (/home/chrome/bnb_probe/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:193:20)
    at ChildProcess.<anonymous> (/home/chrome/bnb_probe/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:184:79)
    at ChildProcess.emit (events.js:327:22)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
GET /har?url=https://site1/id/sign-up&emulation=desktop&token=no%20token 500 18019.254 ms - 34
GET /uptime?url=https://site1/id/sign-up&token=no%20token 200 62.143 ms - 20
GET /uptime?url=https://site2&token=no%20token 200 16.107 ms - 20
Error: Failed to launch the browser process!
/usr/bin/google-chrome: fork: retry: Resource temporarily unavailable
/usr/bin/google-chrome: fork: retry: Resource temporarily unavailable
/usr/bin/google-chrome: fork: retry: Resource temporarily unavailable
/usr/bin/google-chrome: fork: retry: Resource temporarily unavailable
/usr/bin/google-chrome: fork: retry: Resource temporarily unavailable
/usr/bin/google-chrome: fork: retry: Resource temporarily unavailable
/usr/bin/google-chrome: fork: retry: Resource temporarily unavailable
/usr/bin/google-chrome: fork: Resource temporarily unavailable


TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

    at onClose (/home/chrome/bnb_probe/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:193:20)
    at ChildProcess.<anonymous> (/home/chrome/bnb_probe/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:184:79)
    at ChildProcess.emit (events.js:327:22)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
GET /lighthouse?url=https://site2&type=html&emulation=mobile&token=no%20token 500 22021.883 ms - 40
GET /uptime?url=https://site1/blog/&token=no%20token 200 465.915 ms - 20
GET /uptime?url=https://site1/blog/&token=no%20token 200 402.914 ms - 20
GET /uptime?url=https://site1&token=no%20token 200 54.925 ms - 20
Error: Failed to launch the browser process!
/usr/bin/google-chrome: fork: retry: Resource temporarily unavailable
/usr/bin/google-chrome: fork: retry: Resource temporarily unavailable
/usr/bin/google-chrome: fork: retry: Resource temporarily unavailable
[0203/172349.353544:ERROR:platform_thread_posix.cc(135)] pthread_create: Resource temporarily unavailable (11)


TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

    at onClose (/home/chrome/bnb_probe/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:193:20)
    at Interface.<anonymous> (/home/chrome/bnb_probe/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:183:68)
    at Interface.emit (events.js:327:22)
    at Interface.close (readline.js:424:8)
    at Socket.onend (readline.js:202:10)
    at Socket.emit (events.js:327:22)
    at endReadableNT (_stream_readable.js:1327:12)
    at processTicksAndRejections (internal/process/task_queues.js:80:21)
GET /lighthouse?url=https://site2&type=html&emulation=desktop&token=no%20token 500 4046.587 ms - 40
GET /uptime?url=https://site1/id/sign-up&token=no%20token 200 58.802 ms - 20
Error: Failed to launch the browser process!
[0203/172625.401205:FATAL:credentials.cc(107)] Check failed: . : Resource temporarily unavailable (11)


TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md

    at onClose (/home/chrome/bnb_probe/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:193:20)
    at ChildProcess.<anonymous> (/home/chrome/bnb_probe/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:184:79)
    at ChildProcess.emit (events.js:327:22)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
GET /screenshot?url=https://site2&emulation=mobile&token=no%20token 500 93.832 ms - 37
GET /uptime?url=https://site1&token=no%20token 200 51.927 ms - 20
GET /uptime?url=https://site1/id/sign-up&token=no%20token 200 44.314 ms - 20
events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: read ENOTCONN
    at tryReadStart (net.js:574:20)
    at Socket._read (net.js:585:5)
    at Socket.Readable.read (_stream_readable.js:481:10)
    at Socket.read (net.js:625:39)
    at new Socket (net.js:377:12)
    at Object.Socket (net.js:269:41)
    at createSocket (internal/child_process.js:314:14)
    at ChildProcess.spawn (internal/child_process.js:433:23)
    at Object.spawn (child_process.js:553:9)
    at BrowserRunner.start (/home/chrome/bnb_probe/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:79:34)
Emitted 'error' event on Socket instance at:
    at emitErrorNT (internal/streams/destroy.js:106:8)
    at emitErrorCloseNT (internal/streams/destroy.js:74:3)
    at processTicksAndRejections (internal/process/task_queues.js:80:21) {
  errno: -107,
  code: 'ENOTCONN',
  syscall: 'read'
}
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! bnb_probe@1.0.0 start: `node ./bin/www`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bnb_probe@1.0.0 start 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!     /home/chrome/.npm/_logs/2021-02-03T17_28_25_524Z-debug.log

Hello,

It seems it can't launch Chrome. It could be a memory or a swap limit with your operating system. What operating system do you use ?

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic

$ uname -a
Linux ip-10-2-5-243 5.4.0-1035-aws #37~18.04.1-Ubuntu SMP Wed Jan 6 22:31:04 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

$ free
total used free shared buff/cache available
Mem: 7792736 1871192 486636 4344 5434908 5835512
Swap: 0 0 0

Screenshot 2021-02-09 at 20 08 44

That was two minutes before botnbot_probe container fails.
You can see few chrome processes

You have a lot of zombie process. Not sure if it is the root cause of your problem but to get rid of that, you can start your botnbot_probe container with the --init flag.