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

Application breaks in docker environment when stock status is in stock #2177

Closed
Uh-huh-Philip opened this issue Mar 18, 2021 · 8 comments
Closed

Comments

@Uh-huh-Philip
Copy link
Contributor

Current Behavior

The application breaks with an "Unhandled 'error' event" when stock status is in stock in docker environment since open being upgraded from 7.4.2 to 8.0.1 #2070 in commit 00e4ddc.

Pretty sure it's caused by open 8.0.1 as everything works perfectly when I downgrade to open 7.4.2.

Environment

  • Docker

Logs

[9:40:04 AM] info :: 🚀🚨 [thewarehouse] [microsoft (xboxss)] xbox series s :: IN STOCK 🚨🚀
https://www.thewarehouse.co.nz/R2708604.html
[9:40:04 AM] error :: ✖ [thewarehouse] microsoft xboxss xbox series s - token.keyId is missing
node:events:355
throw er; // Unhandled 'error' event
^

Error: spawn xdg-open ENOENT
at Process.ChildProcess._handle.onexit (node:internal/child_process:282:19)
at onErrorNT (node:internal/child_process:480:16)
at processTicksAndRejections (node:internal/process/task_queues:81:21)
Emitted 'error' event on ChildProcess instance at:
at Process.ChildProcess._handle.onexit (node:internal/child_process:288:12)
at onErrorNT (node:internal/child_process:480:16)
at processTicksAndRejections (node:internal/process/task_queues:81:21) {
errno: -2,
code: 'ENOENT',
syscall: 'spawn xdg-open',
path: 'xdg-open',
spawnargs: [ 'https://www.thewarehouse.co.nz/R2708604.html' ]
}

@c0rrre
Copy link
Contributor

c0rrre commented Mar 19, 2021

i have the same problem with telegram notifications

@Uh-huh-Philip
Copy link
Contributor Author

This issues can also been bypassed by set OPEN_BROWSER to false in dotenv or disabling open browser in docker environment.
patch.txt
What do you think? @jef

@PavloFatula
Copy link

OPEN_BROWSER=FALSE doesn't help for me. I'm also have crashes during telegram notifications attempt. any thoughts?

@Uh-huh-Philip
Copy link
Contributor Author

@c0rrre @PavloFatula any log?

@PavloFatula
Copy link

PavloFatula commented Apr 2, 2021

@Uh-huh-Philip

PS C:\Users\user\Code\streetmerchant> docker-compose.exe up
Building streetmerchant
failed to get console mode for stdout: The handle is invalid.
[+] Building 1.3s (22/22) FINISHED
 => [internal] load build definition from Dockerfile                       0.0s
 => => transferring dockerfile: 1.01kB                                     0.0s
 => [internal] load .dockerignore                                          0.0s
 => => transferring context: 34B                                           0.0s
 => [internal] load metadata for docker.io/library/node:15.12.0-alpine3.1  1.2s
 => [internal] load build context                                          0.0s
 => => transferring context: 9.12kB                                        0.0s
 => [builder  1/10] FROM docker.io/library/node:15.12.0-alpine3.13@sha256  0.0s
 => CACHED [stage-1 2/8] RUN apk add --no-cache chromium                   0.0s
 => CACHED [stage-1 3/8] RUN addgroup -S appuser && adduser -S -g appuser  0.0s
 => CACHED [stage-1 4/8] WORKDIR /app                                      0.0s
 => CACHED [builder  2/10] WORKDIR /build                                  0.0s
 => CACHED [builder  3/10] COPY package.json package.json                  0.0s
 => CACHED [builder  4/10] COPY package-lock.json package-lock.json        0.0s
 => CACHED [builder  5/10] COPY tsconfig.json tsconfig.json                0.0s
 => CACHED [builder  6/10] RUN npm install -g typescript                   0.0s
 => CACHED [builder  7/10] RUN npm ci                                      0.0s
 => CACHED [builder  8/10] COPY src/ src/                                  0.0s
 => CACHED [builder  9/10] RUN npm run compile                             0.0s
 => CACHED [builder 10/10] RUN npm prune --production                      0.0s
 => CACHED [stage-1 5/8] COPY --from=builder /build/node_modules/ node_mo  0.0s
 => CACHED [stage-1 6/8] COPY --from=builder /build/build/ build/          0.0s
 => CACHED [stage-1 7/8] COPY web/ web/                                    0.0s
 => CACHED [stage-1 8/8] COPY package.json package.json                    0.0s
 => exporting to image                                                     0.0s
 => => exporting layers                                                    0.0s
 => => writing image sha256:a74cca0f26df19c5bc66b61ea42d72c1b153bc9ce20b7  0.0s
 => => naming to ghcr.io/jef/streetmerchant:latest                         0.0s
Successfully built a74cca0f26df19c5bc66b61ea42d72c1b153bc9ce20b73315fad941d80ad1847
WARNING: Image for service streetmerchant was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
Creating streetmerchant ... done
Attaching to streetmerchant
streetmerchant    |
streetmerchant    | > streetmerchant@3.5.0 test:notification
streetmerchant    | > npm run compile && node build/test/functional/test-notification.js
streetmerchant    |
streetmerchant    |
streetmerchant    | > streetmerchant@3.5.0 compile
streetmerchant    | > tsc
streetmerchant    |
streetmerchant    | sh: tsc: not found
streetmerchant    | npm notice
streetmerchant    | npm notice New minor version of npm available! 7.4.2 -> 7.8.0
streetmerchant    | npm notice Changelog: <https://github.com/npm/cli/releases/tag/v7.8.0>
streetmerchant    | npm notice Run `npm install -g npm@7.8.0` to update!
streetmerchant    | npm notice
streetmerchant    | npm ERR! code 127
streetmerchant    | npm ERR! path /app
streetmerchant    | npm ERR! command failed
streetmerchant    | npm ERR! command sh -c tsc
streetmerchant    |
streetmerchant    | npm ERR! A complete log of this run can be found in:
streetmerchant    | npm ERR!     /home/appuser/.npm/_logs/2021-04-02T22_25_06_966Z-debug.log
streetmerchant    | npm notice
streetmerchant    | npm notice New minor version of npm available! 7.6.3 -> 7.8.0
streetmerchant    | npm notice Changelog: <https://github.com/npm/cli/releases/tag/v7.8.0>
streetmerchant    | npm notice Run `npm install -g npm@7.8.0` to update!
streetmerchant    | npm notice
streetmerchant    | npm ERR! code 127
streetmerchant    | npm ERR! path /app
streetmerchant    | npm ERR! command failed
streetmerchant    | npm ERR! command sh -c npm run compile && node build/test/functional/test-notification.js
streetmerchant    |
streetmerchant    | npm ERR! A complete log of this run can be found in:
streetmerchant    | npm ERR!     /home/appuser/.npm/_logs/2021-04-02T22_25_06_988Z-debug.log
streetmerchant exited with code 127

changed dokerfile
line45: CMD ["test:notification"]

dotenv changes:

AUTO_ADD_TO_CART=FALSE
HEADLESS=true
OPEN_BROWSER=false
TELEGRAM_ACCESS_TOKEN=tokem
TELEGRAM_CHAT_ID=id

npm run start
works perfectly fine, as well as telegram notifications

@jef
Copy link
Owner

jef commented Apr 14, 2021

This issues can also been bypassed by set OPEN_BROWSER to false in dotenv or disabling open browser in docker environment.
patch.txt
What do you think? @jef

Strange this isn't defaulted already. Will push an update. Thanks for the suggestion! Also applied to test-notification.ts.

@jef jef closed this as completed in d13f7f1 Apr 14, 2021
@jef
Copy link
Owner

jef commented Apr 15, 2021

Everything good now?

@Uh-huh-Philip
Copy link
Contributor Author

Hi @jef,
Yes, this issue is solved. The newest code works great in Docker environment now.
Cheers.

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

No branches or pull requests

4 participants