jef / streetmerchant

🤖 The world's easiest, most powerful stock checker
https://jef.buzz/streetmerchant
MIT License
4.97k stars 1.3k forks source link

ERR_SOCKET_CLOSED when using proxies #1638

Closed mcdalcin closed 3 years ago

mcdalcin commented 3 years ago

When using proxies, streetmerchant throws the following error after a few hours.

Error [ERR_SOCKET_CLOSED]: Socket is closed
    at new NodeError (node:internal/errors:278:15)
    at Socket._writeGeneric (node:net:759:8)
    at Socket._write (node:net:781:8)
    at doWrite (node:internal/streams/writable:407:12)
    at clearBuffer (node:internal/streams/writable:566:7)
    at Socket.Writable.uncork (node:internal/streams/writable:347:7)
    at ClientRequest._flushOutput (node:_http_outgoing:933:10)
    at ClientRequest._flush (node:_http_outgoing:902:22)
    at node:_http_client:337:47
    at callSocketMethod (node:_http_client:858:7)
Emitted 'error' event on ClientRequest instance at:
    at Socket.socketErrorListener (node:_http_client:490:9)
    at Socket.emit (node:events:376:20)
    at emitErrorNT (node:internal/streams/destroy:188:8)
    at emitErrorCloseNT (node:internal/streams/destroy:153:3)
    at processTicksAndRejections (node:internal/process/task_queues:80:21) {
  code: 'ERR_SOCKET_CLOSED'
}

Steps to Reproduce

After a few hours (13 hours most recently) of running with a global.proxies or store-name.proxies proxy list, streetmerchant throws this error and needs to be restart. When no proxy list is present, it runs without a hitch.

There are no reports of others hitting this issue so I'm not sure if it's reproducible by others. Any hints of where to look are appreciated!

Environment

ASCII_BANNER=""
ASCII_COLOR=""
AUTO_ADD_TO_CART=""
BROWSER_TRUSTED="true"
COUNTRY=""
DESKTOP_NOTIFICATIONS=""
EMAIL_PASSWORD=""
EMAIL_TO=""
EMAIL_USERNAME=""
HEADLESS=""
IN_STOCK_WAIT_TIME=""
LOG_LEVEL=""
LOW_BANDWIDTH=""
MAX_PRICE_SERIES_3070=""
MAX_PRICE_SERIES_3080=""
MAX_PRICE_SERIES_3090=""
MAX_PRICE_SERIES_RX6800=""
MAX_PRICE_SERIES_RX6800XT=""
MAX_PRICE_SERIES_RX6900XT=""
MAX_PRICE_SERIES_RYZEN5600="460"
MAX_PRICE_SERIES_RYZEN5800=""
MAX_PRICE_SERIES_RYZEN5900=""
MAX_PRICE_SERIES_RYZEN5950=""
MAX_PRICE_CORSAIR_SF=""
MICROCENTER_LOCATION=""
MQTT_BROKER_ADDRESS=""
MQTT_BROKER_PORT=""
MQTT_CLIENT_ID=""
MQTT_PASSWORD=""
MQTT_QOS=""
MQTT_TOPIC=""
MQTT_USERNAME=""
NVIDIA_ADD_TO_CART_ATTEMPTS=""
NVIDIA_SESSION_TTL=""
OPEN_BROWSER=""
PAGE_BACKOFF_MIN=""
PAGE_BACKOFF_MAX=""
PAGE_SLEEP_MIN=""
PAGE_SLEEP_MAX=""
PAGE_TIMEOUT=""
PAGERDUTY_INTEGRATION_KEY=""
PAGERDUTY_SEVERITY=""
PHILIPS_HUE_API_KEY=""
PHILIPS_HUE_CLOUD_ACCESS_TOKEN=""
PHILIPS_HUE_CLOUD_CLIENT_ID=""
PHILIPS_HUE_CLOUD_CLIENT_SECRET=""
PHILIPS_HUE_CLOUD_REFRESH_TOKEN=""
PHILIPS_HUE_LAN_BRIDGE_IP=""
PHILIPS_HUE_LIGHT_COLOR=""
PHILIPS_HUE_LIGHT_IDS=""
PHILIPS_HUE_LIGHT_PATTERN=""
PHONE_CARRIER=""
PHONE_NUMBER=""
PLAY_SOUND="cut.mp3"
PROXY_ADDRESS=""
PROXY_PORT=""
PUSHBULLET=""
PUSHOVER_TOKEN=""
PUSHOVER_USER=""
PUSHOVER_PRIORITY=""
SCREENSHOT=""
SHOW_ONLY_BRANDS=""
SHOW_ONLY_MODELS=""
SHOW_ONLY_SERIES="ryzen5600,3070"
SLACK_CHANNEL=""
SLACK_TOKEN=""
SMTP_ADDRESS=""
SMTP_PORT=""
STORES="nvidia,amazon-ca,bestbuy-ca,canadacomputers,newegg-ca,memoryexpress"
TELEGRAM_ACCESS_TOKEN=""
TELEGRAM_CHAT_ID=""
TWILIO_ACCOUNT_SID=""
TWILIO_AUTH_TOKEN=""
TWILIO_FROM_NUMBER=""
TWILIO_TO_NUMBER=""
TWITCH_ACCESS_TOKEN=""
TWITCH_CHANNEL=""
TWITCH_CLIENT_ID=""
TWITCH_CLIENT_SECRET=""
TWITCH_REFRESH_TOKEN=""
TWITTER_ACCESS_TOKEN_KEY=""
TWITTER_ACCESS_TOKEN_SECRET=""
TWITTER_CONSUMER_KEY=""
TWITTER_CONSUMER_SECRET=""
TWITTER_TWEET_TAGS=""
USER_AGENT=""
WEB_PORT="6970"

Logs

0 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'start' ]
1 info using npm@7.0.14
2 info using node@v15.3.0
3 timing config:load:defaults Completed in 2ms
4 timing config:load:file:/usr/lib/node_modules/npm/npmrc Completed in 1ms
5 timing config:load:builtin Completed in 1ms
6 timing config:load:cli Completed in 4ms
7 timing config:load:env Completed in 1ms
8 timing config:load:file:/home/streetmerchant-new-drake/streetmerchant/.npmrc Completed in 0ms
9 timing config:load:project Completed in 2ms
10 timing config:load:file:/root/.npmrc Completed in 0ms
11 timing config:load:user Completed in 0ms
12 timing config:load:file:/usr/etc/npmrc Completed in 0ms
13 timing config:load:global Completed in 1ms
14 timing config:load:cafile Completed in 0ms
15 timing config:load:validate Completed in 0ms
16 timing config:load:setUserAgent Completed in 1ms
17 timing config:load:setEnvs Completed in 1ms
18 timing config:load Completed in 15ms
19 verbose npm-session 8f2338d371084de2
20 timing npm:load Completed in 42ms
21 timing command:run-script Completed in 48862295ms
22 verbose stack Error: command failed
22 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/@npmcli/promise-spawn/index.js:64:27)
22 verbose stack     at ChildProcess.emit (node:events:376:20)
22 verbose stack     at maybeClose (node:internal/child_process:1055:16)
22 verbose stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:288:5)
23 verbose cwd /home/streetmerchant-new-drake/streetmerchant
24 verbose Linux 5.9.6-x86_64-linode139
25 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "start"
26 verbose node v15.3.0
27 verbose npm  v7.0.14
28 error code 1
29 error path /home/streetmerchant-new-drake/streetmerchant
30 error command failed
31 error command sh -c npm run build && node build/index.js
32 verbose exit 1
github-actions[bot] commented 3 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days

github-actions[bot] commented 3 years ago

This issue has been closed because it is stale. Reopen if necessary.

joshlopes commented 3 years ago

@mcdalcin did you manage to fix this issue?