Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

review exit code for below error and if possible exit with -1 #873

Closed
vdelendik opened this issue Jan 17, 2024 · 2 comments
Closed

review exit code for below error and if possible exit with -1 #873

vdelendik opened this issue Jan 17, 2024 · 2 comments
Assignees
Milestone

Comments

@vdelendik
Copy link
Contributor

according to the findings we see that below error might be fixed by stf/mcloud-device container restart. it seems like in 2.6.x we decided to do exit with error code 0 and make device unhealthy. Simple stf restart restore device in 90% of cases

2024-01-10 13:58:11:136 [HTTP] [HTTP] 
2024-01-17T10:33:54.539Z INF/device:resources:service 22 [GC...0] Installing STFService
2024-01-17T10:33:56.637Z INF/provider 9 [*] Providing 0 of 1 device(s); waiting for "GC...0"
2024-01-17T10:34:06.641Z INF/provider 9 [*] Providing 0 of 1 device(s); waiting for "GC...0"
2024-01-17T10:34:11.215Z FTL/device 22 [GC...0] Setup had an error TimeoutError: operation timed out
    at afterTimeout (/opt/node_modules/@devicefarmer/adbkit/node_modules/bluebird/js/main/timers.js:11:15)
    at Timeout.timeoutTimeout [as _onTimeout] (/opt/node_modules/@devicefarmer/adbkit/node_modules/bluebird/js/main/timers.js:53:9)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7)
2024-01-17T10:34:11.216Z FTL/util:lifecycle 22 [GC...0] Shutting down due to fatal error with optional error :  undefined
2024-01-17T10:34:11.228Z INF/provider 9 [*] Cleaning up device worker "GC...0"
2024-01-17T10:34:11.228Z ERR/provider 9 [*] Device worker "GC...0" died with code 1
2024-01-17T10:34:11.229Z INF/util:lifecycle 9 [*] Winding down for graceful exit, with optional error :  ExitError: Exit code "1"
    at ChildProcess.exitListener (/opt/lib/units/provider/index.js:208:29)
    at ChildProcess.emit (node:events:527:28)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) {
  code: 1
}
Warning: .then() only accepts functions but was passed: [object Object]
    at /opt/lib/units/provider/index.js:305:42
    at processImmediate (node:internal/timers:466:21)
From previous event:
    at Timeout.work [as _onTimeout] (/opt/lib/units/provider/index.js:289:17)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7)
Unhandled rejection ExitError: Exit code "1"
    at ChildProcess.exitListener (/opt/lib/units/provider/index.js:208:29)
    at ChildProcess.emit (node:events:527:28)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
2024-01-17T10:34:11.254Z WRN/db 9 [*] Connection closed
Exit status: 0

2024-01-10 13:58:11:709 [HTTP] [HTTP] {}
2024-01-10 13:58:11:759 [AppiumDriver@4db3] [AppiumDriver@4db3] Removing session 920079aa-eef2-4a21-b1eb-2bce8547faa5 from our master session list
@vdelendik vdelendik added this to the 2.6.3 milestone Jan 17, 2024
vdelendik added a commit that referenced this issue Jan 18, 2024
#873 Replace exit code 0 to exit code 1
@vdelendik vdelendik added the bug label Jan 25, 2024
@vdelendik
Copy link
Contributor Author

for below reason also return code 1 to initiate stf container restart:

2024-01-24T10:29:16.195Z FTL/device 22 [G...X4] Setup had an error TimeoutError: operation timed out
    at afterTimeout (/opt/node_modules/@devicefarmer/adbkit/node_modules/bluebird/js/main/timers.js:11:15)
    at Timeout.timeoutTimeout [as _onTimeout] (/opt/node_modules/@devicefarmer/adbkit/node_modules/bluebird/js/main/timers.js:53:9)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7)
2024-01-24T10:29:16.196Z FTL/util:lifecycle 22 [G...X4] Shutting down due to fatal error with optional error :  undefined
2024-01-24T10:29:16.214Z INF/provider 9 [*] Cleaning up device worker "G...X4"
2024-01-24T10:29:16.215Z ERR/provider 9 [*] Device worker "G...X4" died with code 1
2024-01-24T10:29:16.216Z INF/util:lifecycle 9 [*] Winding down for graceful exit, with optional error :  ExitError: Exit code "1"
    at ChildProcess.exitListener (/opt/lib/units/provider/index.js:208:29)
    at ChildProcess.emit (node:events:527:28)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) {
  code: 1
}
Warning: .then() only accepts functions but was passed: [object Object]
    at /opt/lib/units/provider/index.js:305:42
    at processImmediate (node:internal/timers:466:21)
From previous event:
    at Timeout.work [as _onTimeout] (/opt/lib/units/provider/index.js:289:17)
    at listOnTimeout (node:internal/timers:559:17)
    at processTimers (node:internal/timers:502:7)
Unhandled rejection ExitError: Exit code "1"
    at ChildProcess.exitListener (/opt/lib/units/provider/index.js:208:29)
    at ChildProcess.emit (node:events:527:28)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12)
2024-01-24T10:29:16.242Z WRN/db 9 [*] Connection closed
Exit status: 0

@dhreben
Copy link
Contributor

dhreben commented Jan 26, 2024

Verified.
Restarting (1) 28 seconds ago

2024-01-26T11:34:32.727Z INF/device:resources:service 22 [9885e6513238354f31] Installing STFService
2024-01-26T11:34:33.918Z FTL/device 22 [9885e6513238354f31] Setup had an error PrematureEOFError: Premature end of stream, needed 1 more bytes
    at Socket.<anonymous> (/opt/node_modules/@devicefarmer/adbkit/lib/adb/parser.js:118:32)
    at Socket.emit (node:events:539:35)
    at endReadableNT (node:internal/streams/readable:1345:12)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)
2024-01-26T11:34:33.919Z FTL/util:lifecycle 22 [9885e6513238354f31] Shutting down due to fatal error with optional error :  undefined
2024-01-26T11:34:33.938Z INF/provider 9 [*] Cleaning up device worker "9885e6513238354f31"
2024-01-26T11:34:33.939Z ERR/provider 9 [*] Device worker "9885e6513238354f31" died with code 1
2024-01-26T11:34:33.940Z FTL/util:lifecycle 9 [*] Shutting down due to fatal error with optional error :  ExitError: Exit code "1"
    at ChildProcess.exitListener (/opt/lib/units/provider/index.js:208:29)
    at ChildProcess.emit (node:events:527:28)
    at Process.ChildProcess._handle.onexit (node:internal/child_process:291:12) {
  code: 1
}
Exit status: 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

3 participants