SpikeHD / AmazonMonitor

Amazon price checker, item monitor and stock monitor, all shoved into a Discord bot
GNU General Public License v3.0
221 stars 38 forks source link

[BUG] Navigation timeout exceeded #96

Closed kekkodance closed 1 year ago

kekkodance commented 1 year ago

Describe the issue:

Steps to reproduce

Paste the contents of your config.json, excluding the token, here:

{
  "prefix":"!",
  "token":"boo",
  "minutes_per_check":2,
  "search_response_ms": 30000,
  "url_params":{},
  "guild_item_limit":100,
  "cache_limit": 25,
  "required_perms":[""],
  "tld":"it",
  "auto_cart_link":false,
  "debug_enabled":true
}

Provide console output with debug mode enabled:

[LOG]  Checking item prices...
[MESSAGE]  Type: headless
[MESSAGE]  URL: https://www.amazon.it/dp/B098LWQPRT/
[ERROR]  TimeoutError: Navigation timeout of 30000 ms exceeded
    at LifecycleWatcher._LifecycleWatcher_createTimeoutPromise (file:///home/ubuntu/AmazonMonitor/node_modules/puppeteer/src/common/LifecycleWatcher.ts:220:12)
file:///home/ubuntu/AmazonMonitor/common/util.ts:4
import cheerio from 'cheerio'
                                                         ^
TypeError: Cannot read properties of null (reading 'price')
    at file:///home/ubuntu/AmazonMonitor/common/util.ts:224:40
    at Generator.next (<anonymous>)
    at fulfilled (file:///home/ubuntu/AmazonMonitor/common/util.ts:4:58)
SpikeHD commented 1 year ago

This could be due to a lot of things, such as:

Your best bet is to use something like PM2 to have it auto-restart, since these are rare enough that I can't really know why it occurs. It would cause a delay of a couple seconds at most.