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

make exit with code 1 for spawn adb ENOENT #827

Closed
vdelendik opened this issue Nov 23, 2023 · 2 comments
Closed

make exit with code 1 for spawn adb ENOENT #827

vdelendik opened this issue Nov 23, 2023 · 2 comments
Assignees
Milestone

Comments

@vdelendik
Copy link
Contributor

it is discovered only today with release candidate 2.6.1 builds...
most of stf services for andoird (60% and more) couldn't start mcloud-device (stf) container

docker logs -f device-Samsung_Galaxy_S23_Ultra-R...PE
2023-11-23T17:52:26.321Z INF/provider 8 [*] Subscribing to permanent channel "tir4oW+aT+ez6X5ZnCMaqw=="
2023-11-23T17:52:26.324Z INF/db 8 [*] Connecting to n.farm:28015
2023-11-23T17:52:26.325Z INF/provider 8 [*] Sending output to "tcp://n.farm:7270"
2023-11-23T17:52:26.326Z INF/provider 8 [*] Receiving input from "tcp://n.farm:7250"
Unhandled rejection Error: spawn adb ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
    at onErrorNT (node:internal/child_process:476:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)

let's identify the place and make sure to do exit with 1 error code to initiate container automatic restart on failure

@vdelendik vdelendik added this to the 2.6.1 milestone Nov 23, 2023
vdelendik added a commit that referenced this issue Nov 24, 2023
#827 Catch register error and exit process
vdelendik added a commit that referenced this issue Nov 29, 2023
@vdelendik
Copy link
Contributor Author

merged and built stf:2.6.1 and mcloud-device:2.6.1

@vdelendik
Copy link
Contributor Author

verified on my own using required distributed env:

2023-11-30T12:15:57.879Z INF/provider 8 [*] Subscribing to permanent channel "N+iQ/MgVSMeYTC9CNZgJCw=="
...
2023-11-30T12:15:57.900Z FTL/provider 8 [*] Adb client error OperationalError: spawn adb ENOENT
    at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
    at onErrorNT (node:internal/child_process:476:16)
    at processTicksAndRejections (node:internal/process/task_queues:83:21) {
  cause: Error: spawn adb ENOENT
      at Process.ChildProcess._handle.onexit (node:internal/child_process:283:19)
      at onErrorNT (node:internal/child_process:476:16)
      at processTicksAndRejections (node:internal/process/task_queues:83:21) {
    errno: -2,
    code: 'ENOENT',
    syscall: 'spawn adb',
    path: 'adb',
    spawnargs: [ '-P', 5037, 'start-server' ],
    cmd: 'adb -P 5037 start-server'
  },
  isOperational: true,
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn adb',
  path: 'adb',
  spawnargs: [ '-P', 5037, 'start-server' ],
  cmd: 'adb -P 5037 start-server'
}
2023-11-30T12:15:57.902Z FTL/util:lifecycle 8 [*] Shutting down due to fatal error with optional error :  undefined
Exit status: 1
2023-11-30T12:15:59.014Z INF/provider 8 [*] Subscribing to permanent channel "xTYMM2asR42bjELaVVUJoQ=="
2023-11-30T12:15:59.019Z INF/db 8 [*] Connecting to ...

1st attempt fail and 2nd successfully connected to adb and registered device in stf

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

2 participants