Common Issues
This guide covers common issues you may encounter when running the Price Tracker Bot and how to resolve them.Bot Not Responding
Bot Not Responding
Symptoms
- Bot doesn’t reply to commands
- No messages received from the bot
- Bot appears offline in Telegram
Possible Causes & Solutions
Solution:- Create a
.envfile in the project root - Add your token:
TELEGRAM_TOKEN=your_token_here - Get your token from @BotFather on Telegram
- Restart the bot
Polling Errors: Check your console for messages like
❌ Polling error:Common polling issues:- Network connectivity problems
- Token revoked or invalid
- Multiple instances of the bot running
- Verify your token is correct
- Check your internet connection
- Stop all other instances:
pkill -f "node.*index.mjs" - Restart the bot
Scraping Failures
Scraping Failures
Symptoms
- Error:
❌ No se pudo obtener información del producto - Products fail to add
- Price checks return errors
Playwright Not Installed
Solution:Amazon Blocking Requests
Symptoms:- Error:
Título no encontrado(index.mjs:127) - Error:
Precio inválido o no encontrado(index.mjs:129)
- Amazon detected automated scraping
- Product page structure changed
- Geographic restrictions
- Rate limiting
- Wait and retry: Amazon may temporarily block requests
- Check URL: Ensure the URL is a valid Amazon product page
- Try different products: Test with multiple products to isolate the issue
- Review selectors: Amazon may have changed their HTML structure
Invalid Product URL
Error messages:❌ URL inválida. Debe iniciar con http(s).(index.mjs:401)
- Starts with
http://orhttps:// - Points to an Amazon product page
- Contains product identifier (
/dp/or/gp/)
Price Not Updating
Price Not Updating
Symptoms
- Prices never change
- No automatic checks happening
/checkcommand times out
Cron Jobs Not Running
The bot has two scheduled tasks:- Price checks: Every 2 hours (index.mjs:733)
- Daily summary: Every day at 20:00 (index.mjs:720)
- Check console for:
🔄 Cron: revisión automática de precios... - Look for:
⏳ Iniciando revisión de precios...
- Bot process stopped or crashed
- System time incorrect
- No products added to track
- Keep the bot running continuously
- Use a process manager like
pm2: - Check system time:
date
Errors During Price Checks
Console messages to look for:❌ Error en cron checkPrices:(index.mjs:738)⚠️ Errores durante la revisión:(index.mjs:249)
- Run manual check:
/checkcommand - Watch console output for specific errors
- Test individual product URLs
- Review error logs for patterns
No Products Being Tracked
If you see:ℹ️ No hay productos para revisar. (index.mjs:142)Solution:- Add products using
/add [URL] - Verify products saved:
/list - Check
prices.jsonfile exists and contains data
Data Loss Issues
Data Loss Issues
Symptoms
- Products disappear after restart
- Price history missing
- Chat registrations lost
File Permission Problems
Check permissions:prices.json after every change (index.mjs:20, 41-48).JSON Corruption
Error:❌ Error al cargar datos: (index.mjs:32)This happens when prices.json contains invalid JSON.Solution:- Backup the file:
cp prices.json prices.json.backup - Validate JSON:
- Fix syntax errors or restore from backup
- If unrecoverable, delete and start fresh:
Disk Space Issues
Check available space:- Product data in
prices.json - Up to 120 price history entries per product (HISTORY_LIMIT at index.mjs:69)
History is automatically limited to the last 120 entries per product (index.mjs:196).
Data File Not Created
If you see:ℹ️ No existe prices.json — se creará al guardar. (index.mjs:37)This is normal on first run. The file is created automatically when you add your first product.Verify file creation:- Add a product:
/add [URL] - Check file exists:
ls -la prices.json - Review contents:
cat prices.json
Browser / Memory Issues
Browser / Memory Issues
Symptoms
- Bot crashes during price checks
- High memory usage
- Timeouts on
/checkor/add
Browser Launch Failures
The bot launches Chromium with specific args (index.mjs:148, 412):-
Install browser dependencies (Linux):
-
Increase shared memory (Docker):
Timeout Errors
Default timeout: 60 seconds (index.mjs:75)If pages load slowly:- Check internet speed
- Try different Amazon region
- Test with simpler products (fewer images/reviews)
Memory Leaks
The bot properly closes browsers after each operation:- Price checks: index.mjs:217
- Add product: index.mjs:417
- Edit product: index.mjs:566
- Chart generation: index.mjs:305
- Restart the bot daily using cron
- Reduce check frequency
- Limit number of tracked products
Notification Issues
Notification Issues
Symptoms
- No price drop alerts received
- Some chats not receiving notifications
- Error sending messages
Chat Not Registered
The bot auto-registers chats on first message (index.mjs:705-712).Verify registration:- Send
/startto the bot - Check console for:
🎉 Nuevo chat registrado: [chatId]
Message Send Failures
Error:❌ Error enviando notificación a [chatId]: (index.mjs:239)Causes:- User blocked the bot
- Chat no longer exists
- Bot doesn’t have permission
No Price Drops Detected
The bot only notifies when price decreases (index.mjs:199-207).Check logic:- Compares
scraped.price < originalPrice - Calculates difference and percentage
- Shows historical lowest price
- Check console:
ℹ️ No se detectaron bajadas de precio - Verify price data in
prices.json - Run
/checkmanually to test - Review console for comparison values
Getting Help
If you’re still experiencing issues:- Check console logs for error messages
- Review prices.json for data integrity
- Test with a fresh product to isolate the problem
- Open an issue on GitHub with:
- Error messages from console
- Steps to reproduce
- Your environment (OS, Node version)
- Relevant section of
prices.json(redact URLs if sensitive)
Most errors are logged with
❌ prefix in the console. Always check logs first when troubleshooting.