Overview
This guide covers the most common issues you may encounter when running the Siigo Corprecam Scraper and their solutions.Environment Variable Issues
Error: Missing NGROK_AUTHTOKEN
Error: Missing NGROK_AUTHTOKEN
NGROK_AUTHTOKEN environment variable is not set in your .env file.Solution:- Get your ngrok auth token from ngrok dashboard
- Add it to your
.envfile:
- Restart the server
config.ts:7 and server.ts:46-49Error: Missing Siigo Credentials
Error: Missing Siigo Credentials
USER_SIIGO_CORPRECAM or PASSWORD_SIIGO_CORPRECAM in environment variables.Solution:Add your Siigo credentials to .env:config.ts:8-9 and main.ts:23-24Error: Database Connection Failed
Error: Database Connection Failed
.env:config.ts:10-14Playwright Timeout Issues
TimeoutError: Waiting for selector timed out
TimeoutError: Waiting for selector timed out
- Login page:
#siigoSignInName,#siigoPassword - Company selection:
trwith company NIT - Document creation:
a[data-value="Documento soporte"] - Product input:
#trEditRow #editProduct #autocomplete_autocompleteInput
- Check your internet connection
- Verify Siigo website is accessible
- Run with headless: false to see what’s happening (see Debugging Guide)
utils/functions.ts:25, utils/functions.ts:35, utils/functions.ts:47Error: Element not visible or clickable
Error: Element not visible or clickable
- The element may have changed in Siigo’s UI
- Check for blocking modals or notifications
- Increase retry attempts if needed
utils/retryUntilSucces.ts:1-31Error: Selector matched multiple elements
Error: Selector matched multiple elements
utils/functions.ts:42-45 for company selection exampleNgrok Connection Issues
Error: Ngrok tunnel failed to start
Error: Ngrok tunnel failed to start
- Invalid auth token - Check your ngrok dashboard
- Port already in use - Another process is using port 3000
- Network restrictions - Firewall blocking ngrok
- Free plan limits - Too many active tunnels
.env:server.ts:46-51Ngrok URL not updating in database
Ngrok URL not updating in database
setNgrok() function failed to update the database.Solution:- Check database connection
- Verify the PHP endpoint is accessible:
- Check server logs for ngrok URL
api/php.ts:78-89 and server.ts:51Siigo Login and Form Issues
Login fails repeatedly despite correct credentials
Login fails repeatedly despite correct credentials
- Siigo website changes - UI elements changed
- Captcha or security check - Manual verification required
- Session/cookie issues - Previous session interfering
- Wrong company NIT - Automation looking for wrong company
- Run with
headless: falseto see login attempt:
- Verify the company NIT matches:
- Clear browser state and retry
utils/functions.ts:12-89 and main.ts:25, main.ts:38Error: Provider (Proveedor) not found
Error: Provider (Proveedor) not found
- Verify provider exists in Siigo manually
- Check the NIT format (no dots, dashes, or extra spaces)
- Ensure database returns correct
proveedor_id:
- Check autocomplete timing:
utils/functions.ts:63-77 and utils/transformDs.ts:63Product selection fails or selects wrong product
Product selection fails or selects wrong product
- Product codes match exactly (case-sensitive)
- Products exist in the selected company
- Bodega (warehouse) is available for product
utils/functions.ts:91-126 and utils/transformDs.ts:40Error: Input field not clearing between products
Error: Input field not clearing between products
utils/functions.ts:232-242API and Data Issues
Error: Failed to fetch compra data
Error: Failed to fetch compra data
/scrapping endpoint returns error, no data fetched.Cause: PHP API endpoints unreachable or invalid compra ID.Solution:Test each endpoint manually:api/php.ts:8-76 and server.ts:21-36No products to process (arrays empty)
No products to process (arrays empty)
- Materials have correct
emp_id_fkin database - At least one product belongs to company 1 or 2
- Material codes exist in Siigo
utils/transformDs.ts:50-60 and main.ts:16-27Browser and Performance Issues
Firefox fails to launch
Firefox fails to launch
utils/functions.ts:4Script is too slow
Script is too slow
- Running with
headless: false(visual mode is slower) - Network latency to Siigo servers
- Retry logic being triggered frequently
- Use headless mode in production:
- Monitor retry logs - frequent retries indicate stability issues
- Optimize network/infrastructure
pressSequentially is intentional to work with Angular:Getting More Help
If your issue isn’t covered here:- Check the Debugging Guide for investigation techniques
- Review server logs for specific error messages
- Run with
headless: falseto visually inspect failures - Check Playwright documentation for selector strategies