jef / streetmerchant

πŸ€– The world's easiest, most powerful stock checker
https://jef.buzz/streetmerchant
MIT License
4.96k stars 1.31k forks source link

Stuck when browser gets disposed #1174

Closed shubDhond closed 3 years ago

shubDhond commented 3 years ago

Description

After running the script, it will run fine for a while until it hits some error like this:

[12:31:04 PM] error :: βœ– [bestbuy] gigabyte 3060ti gaming oc - Navigation failed because browser has disconnected!

after that all of the other execution contexts also get stuck:

[12:31:04 PM] error :: βœ– [bestbuy] gigabyte 3060ti gaming oc - Navigation failed because browser has disconnected!
[12:31:04 PM] error :: βœ– [amazon] gigabyte 3070 vision oc - Navigation failed because browser has disconnected!
[12:31:05 PM] debug :: [amazon-de] Ending this loop as browser is disposed...
[12:31:05 PM] debug :: [alternate] Ending this loop as browser is disposed...
[12:31:05 PM] debug :: [arlt] Ending this loop as browser is disposed...
[12:31:05 PM] debug :: [unieuro] Ending this loop as browser is disposed...
[12:31:05 PM] debug :: [cyberport] Ending this loop as browser is disposed...
[12:31:05 PM] debug :: [gamestop-de] Ending this loop as browser is disposed...
[12:31:05 PM] debug :: [walmart] Ending this loop as browser is disposed...
[12:31:05 PM] debug :: [argos] Ending this loop as browser is disposed...
[12:31:06 PM] debug :: [game] Ending this loop as browser is disposed...
[12:31:06 PM] debug :: [topachat] Ending this loop as browser is disposed...
[12:31:06 PM] debug :: [bandh] Ending this loop as browser is disposed...
[12:31:06 PM] debug :: [euronics-de] Ending this loop as browser is disposed...
[12:31:06 PM] debug :: [otto] Ending this loop as browser is disposed...
[12:31:06 PM] debug :: [spielegrotte] Ending this loop as browser is disposed...
[12:31:06 PM] debug :: [asus-de] Ending this loop as browser is disposed...
[12:31:06 PM] debug :: [mediamarkt] Ending this loop as browser is disposed...
[12:31:06 PM] debug :: [overclockers] Ending this loop as browser is disposed...
[12:31:06 PM] debug :: [amd-de] Ending this loop as browser is disposed...
[12:31:06 PM] debug :: [asus] Ending this loop as browser is disposed...
[12:31:06 PM] debug :: [saturn] Ending this loop as browser is disposed...
[12:31:07 PM] debug :: [evga-eu] Ending this loop as browser is disposed...
[12:31:07 PM] debug :: [amazon-uk] Ending this loop as browser is disposed...
[12:31:07 PM] debug :: [azerty] Ending this loop as browser is disposed...
[12:31:07 PM] debug :: [xbox] Ending this loop as browser is disposed...
[12:31:07 PM] debug :: [bestbuy-ca] Ending this loop as browser is disposed...
[12:31:07 PM] debug :: [computeruniverse] Ending this loop as browser is disposed...
[12:31:07 PM] debug :: [evga] Ending this loop as browser is disposed...
[12:31:07 PM] debug :: [officedepot] Ending this loop as browser is disposed...
[12:31:07 PM] debug :: [adorama] Ending this loop as browser is disposed...
[12:31:07 PM] debug :: [pccomponentes] Ending this loop as browser is disposed...
[12:31:07 PM] debug :: [novatech] Ending this loop as browser is disposed...
[12:31:08 PM] debug :: [proshop-dk] Ending this loop as browser is disposed...
[12:31:08 PM] debug :: [very] Ending this loop as browser is disposed...
[12:31:08 PM] debug :: [amazon-nl] Ending this loop as browser is disposed...
[12:31:08 PM] debug :: [caseking] Ending this loop as browser is disposed...
[12:31:08 PM] debug :: [amazon-it] Ending this loop as browser is disposed...
[12:31:08 PM] debug :: [mindfactory] Ending this loop as browser is disposed...
[12:31:09 PM] debug :: [aria] Ending this loop as browser is disposed...
[12:31:09 PM] debug :: [alternate-nl] Ending this loop as browser is disposed...
[12:31:09 PM] debug :: [canadacomputers] Ending this loop as browser is disposed...
[12:31:09 PM] debug :: [newegg-ca] Ending this loop as browser is disposed...
[12:31:09 PM] debug :: [expert] Ending this loop as browser is disposed...
[12:31:09 PM] debug :: [proshop-de] Ending this loop as browser is disposed...
[12:31:09 PM] debug :: [amd-it] Ending this loop as browser is disposed...
[12:31:09 PM] debug :: [notebooksbilliger] Ending this loop as browser is disposed...
[12:31:09 PM] debug :: [kabum] Ending this loop as browser is disposed...
[12:31:09 PM] debug :: [amd] Ending this loop as browser is disposed...
[12:31:09 PM] debug :: [amazon-ca] Ending this loop as browser is disposed...
[12:31:10 PM] debug :: [comet] Ending this loop as browser is disposed...
[12:31:10 PM] debug :: [zotac] Ending this loop as browser is disposed...
[12:31:10 PM] debug :: [nvidia-api] Ending this loop as browser is disposed...
[12:31:10 PM] debug :: [amazon-es] Ending this loop as browser is disposed...
[12:31:10 PM] debug :: [coolmod] Ending this loop as browser is disposed...
[12:31:10 PM] debug :: [corsair] Ending this loop as browser is disposed...
[12:31:10 PM] debug :: [newegg] Ending this loop as browser is disposed...
[12:31:10 PM] debug :: [ebuyer] Ending this loop as browser is disposed...
[12:31:10 PM] debug :: [microcenter] Ending this loop as browser is disposed...
[12:31:11 PM] debug :: [medimax] Ending this loop as browser is disposed...
[12:31:11 PM] debug :: [playstation] Ending this loop as browser is disposed...
[12:31:11 PM] debug :: [coolblue] Ending this loop as browser is disposed...
[12:31:11 PM] debug :: [galaxus] Ending this loop as browser is disposed...
[12:31:11 PM] debug :: [amazon-fr] Ending this loop as browser is disposed...
[12:31:11 PM] debug :: [antonline] Ending this loop as browser is disposed...
[12:31:11 PM] debug :: [target] Ending this loop as browser is disposed...
[12:31:11 PM] debug :: [box] Ending this loop as browser is disposed...
[12:31:11 PM] debug :: [ccl] Ending this loop as browser is disposed...
[12:31:12 PM] debug :: [nvidia] Ending this loop as browser is disposed...
[12:31:12 PM] debug :: [eprice] Ending this loop as browser is disposed...
[12:31:12 PM] debug :: [currys] Ending this loop as browser is disposed...
[12:31:12 PM] debug :: [pny] Ending this loop as browser is disposed...
[12:31:12 PM] debug :: [amd-ca] Ending this loop as browser is disposed...
[12:31:12 PM] debug :: [gamestop] Ending this loop as browser is disposed...
[12:31:12 PM] debug :: [smythstoys] Ending this loop as browser is disposed...
[12:31:12 PM] debug :: [wipoid] Ending this loop as browser is disposed...
[12:31:13 PM] debug :: [memoryexpress] Ending this loop as browser is disposed...
[12:31:13 PM] debug :: [euronics] Ending this loop as browser is disposed...
[12:31:14 PM] debug :: [scan] Ending this loop as browser is disposed...
[12:31:14 PM] debug :: [amazon-de-warehouse] Ending this loop as browser is disposed...
[12:31:14 PM] debug :: [vsgamers] Ending this loop as browser is disposed...
[12:31:41 PM] debug :: β„Ή [nvidia] refreshing session token

Possible solution

I believe this has something to do with the following piece of code:

https://github.com/jef/streetmerchant/blob/75ee95b2217fb4bf667869011a009210ff8c22e7/src/store/lookup.ts#L369-L372

But I'm not sure about how to fix it.

jef commented 3 years ago

Does it stay idle after this is over?

shubDhond commented 3 years ago

@jef yep it does

jef commented 3 years ago

Do you mind giving me your .env?

shubDhond commented 3 years ago
# ** All configuration variables are optional **
# Read https://github.com/jef/streetmerchant#customization for help on customizing this file
#############################################################################################

ASCII_BANNER=""
ASCII_COLOR=""
AUTO_ADD_TO_CART=""
BROWSER_TRUSTED=""
COUNTRY=""
DESKTOP_NOTIFICATIONS=""
DISCORD_NOTIFY_GROUP=""
DISCORD_WEB_HOOK="https://discord.com/api/webhooks/##"
EMAIL_PASSWORD=""
EMAIL_TO=""
EMAIL_USERNAME=""
HEADLESS=""
IN_STOCK_WAIT_TIME=""
LOG_LEVEL=""
LOW_BANDWIDTH=""
MAX_PRICE_SERIES_3060TI="600"
MAX_PRICE_SERIES_3070="700"
MAX_PRICE_SERIES_3080="800"
MAX_PRICE_SERIES_3090=""
MAX_PRICE_SERIES_CORSAIR_SF=""
MAX_PRICE_SERIES_RX6800=""
MAX_PRICE_SERIES_RX6800XT=""
MAX_PRICE_SERIES_RX6900XT=""
MAX_PRICE_SERIES_RYZEN5600=""
MAX_PRICE_SERIES_RYZEN5800=""
MAX_PRICE_SERIES_RYZEN5900=""
MAX_PRICE_SERIES_RYZEN5950=""
MAX_PRICE_SERIES_SONYPS5C=""
MAX_PRICE_SERIES_SONYPS5DE=""
MAX_PRICE_SERIES_TEST=""
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=""
PROXY_ADDRESS="####"
PROXY_PROTOCOL="http"
PROXY_PORT="###"
PUSHBULLET=""
PUSHOVER_TOKEN=""
PUSHOVER_USER=""
PUSHOVER_PRIORITY=""
SCREENSHOT=""
SHOW_ONLY_BRANDS=""
SHOW_ONLY_MODELS=""
SHOW_ONLY_SERIES="3060ti,3070"
SLACK_CHANNEL=""
SLACK_TOKEN=""
SMTP_ADDRESS=""
SMTP_PORT=""
STORES="newegg,bestbuy,amazon,bandh"
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=""

I'm using a proxy and webhook but I've replaced those with #

shubDhond commented 3 years ago

Hey @jef, I tried the fix in the PR above but it still ends up in this state. Does this repro for you with my .env?

jef commented 3 years ago

I just ran with latest using your .env/dotenv:

# ** All configuration variables are optional **
# Read https://github.com/jef/streetmerchant#customization for help on customizing this file
#############################################################################################

ASCII_BANNER=""
ASCII_COLOR=""
AUTO_ADD_TO_CART=""
BROWSER_TRUSTED=""
COUNTRY=""
DESKTOP_NOTIFICATIONS=""
DISCORD_NOTIFY_GROUP=""
#DISCORD_WEB_HOOK="https://discord.com/api/webhooks/##"
EMAIL_PASSWORD=""
EMAIL_TO=""
EMAIL_USERNAME=""
HEADLESS=""
IN_STOCK_WAIT_TIME=""
LOG_LEVEL=""
LOW_BANDWIDTH=""
MAX_PRICE_SERIES_3060TI="600"
MAX_PRICE_SERIES_3070="700"
MAX_PRICE_SERIES_3080="800"
MAX_PRICE_SERIES_3090=""
MAX_PRICE_SERIES_CORSAIR_SF=""
MAX_PRICE_SERIES_RX6800=""
MAX_PRICE_SERIES_RX6800XT=""
MAX_PRICE_SERIES_RX6900XT=""
MAX_PRICE_SERIES_RYZEN5600=""
MAX_PRICE_SERIES_RYZEN5800=""
MAX_PRICE_SERIES_RYZEN5900=""
MAX_PRICE_SERIES_RYZEN5950=""
MAX_PRICE_SERIES_SONYPS5C=""
MAX_PRICE_SERIES_SONYPS5DE=""
MAX_PRICE_SERIES_TEST=""
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=""
#PROXY_ADDRESS="####"
#PROXY_PROTOCOL="http"
#PROXY_PORT="###"
PUSHBULLET=""
PUSHOVER_TOKEN=""
PUSHOVER_USER=""
PUSHOVER_PRIORITY=""
SCREENSHOT=""
SHOW_ONLY_BRANDS=""
SHOW_ONLY_MODELS=""
SHOW_ONLY_SERIES="3060ti,3070"
SLACK_CHANNEL=""
SLACK_TOKEN=""
SMTP_ADDRESS=""
SMTP_PORT=""
STORES="newegg,bestbuy,amazon,bandh"
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=""

image

Let me know if it's still happening for you. I'd make sure you're on the latest: git pull origin main && npm install

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.