Skip to content

Troubleshooting

This guide helps you diagnose and resolve common issues with the Etsy Integration.

OAuth and Authentication Issues

Error: "OAuth callback failed" or "Invalid redirect URI"

Symptoms: - Clicking "Login" redirects to Etsy, but callback fails - Error message about redirect URI mismatch

Causes: - Redirect URI in ERPNext doesn't match the one configured in your Etsy Personal App - Site URL is incorrect or has changed

Solutions:

  1. Verify Redirect URI:
  2. In ERPNext: Open Etsy Shop → Copy the "Redirect URI" field
  3. In Etsy Developer Portal: Go to your app → OAuth Redirect URIs
  4. Ensure they exactly match (including http:// or https://, port numbers, trailing slashes)

  5. Update Site URL:

    bench config dns_multitenant off
    bench --site [site-name] set-config host_name "https://yourdomain.com"
    

  6. Use localhost for Development:

  7. In Etsy Shop, check "Use localhost"
  8. Add http://localhost:8000/api/method/etsy.etsy.doctype.etsy_shop.etsy_shop.oauth_callback to Etsy app

Error: "Access token expired"

Symptoms: - API requests fail with "401 Unauthorized" - Etsy Shop status shows "Connected" but imports fail

Causes: - Access token expired and refresh failed - Refresh token is invalid or revoked

Solutions:

  1. Reconnect the Shop:
  2. Click "Disconnect" in Etsy Shop
  3. Click "Login" to re-authenticate
  4. This generates fresh tokens

  5. Check Token Expiry:

  6. Look at "Expires At" field in Etsy Shop
  7. If it's in the past, tokens need refresh

  8. Verify OAuth Credentials:

  9. Ensure CLIENT_ID and CLIENT_SECRET are correct
  10. Regenerate them in Etsy Developer Portal if needed

Error: "Invalid client credentials"

Symptoms: - OAuth flow fails immediately - Error about invalid client_id or client_secret

Causes: - Incorrect CLIENT_ID or CLIENT_SECRET - Credentials copied with extra spaces or characters

Solutions:

  1. Re-enter Credentials:
  2. Go to Etsy Developer Portal → Your Apps
  3. Copy Keystring (CLIENT_ID) carefully
  4. Copy Shared Secret (CLIENT_SECRET) carefully
  5. Paste into Etsy Shop fields, ensure no extra spaces

  6. Check App Status on Etsy:

  7. Ensure your Etsy Personal App is active (not suspended)

Import Issues

Orders Not Importing

Symptoms: - Click "Import Receipts" but no Sales Orders are created - Sync runs but order count doesn't increase

Diagnosis Steps:

  1. Check Error Log:
  2. Go to: Home > Tools > Error Log
  3. Search for "Etsy" or filter by today's date
  4. Review error messages

Error Log with Etsy Errors

  1. Verify Connection:
  2. Open Etsy Shop document
  3. Check "Status" field shows "Connected"
  4. Check "Expires At" is in the future

  5. Check Etsy Shop Configuration:

  6. Ensure required fields are filled:
    • Company
    • Sales Tax Account
    • Shipping Tax Account
    • Bank Accounts

Common Errors and Fixes:

"Account Not Found"

  • Error: Account 'Sales Tax' does not exist
  • Fix: Set valid tax accounts in Etsy Shop → Sales Order & Invoice Settings

"Customer Creation Failed"

  • Error: Customer naming series not set
  • Fix: Set Customer Naming Series in Etsy Shop → Customer Settings (or leave blank for default)

"Item Not Found"

  • Error: Item with Etsy Product ID X not found
  • Fix: Import listings first before importing orders
  • Click "Import Listings" in Etsy Shop
  • Then retry "Import Receipts"

Listings Not Importing

Symptoms: - Click "Import Listings" but no Etsy Listing documents are created - Items not created in ERPNext

Diagnosis Steps:

  1. Check Active Listings on Etsy:
  2. Log in to Etsy → Shop Manager → Listings
  3. Ensure you have active listings
  4. The integration only imports "Active" listings

  5. Check Error Log:

  6. Look for "Listing import failed" errors
  7. Review specific error messages

Common Errors and Fixes:

"Item Group Not Set"

  • Error: Item Group is required
  • Fix: Set Item Group in Etsy Shop → Item Settings OR in each Etsy Listing → Settings tab

"UOM Not Found"

  • Error: Unit of Measure 'Nos' does not exist
  • Fix: Set a valid UOM in Etsy Shop → Item Settings OR in each Etsy Listing → Settings tab

"Invalid Item Name"

  • Error: Item Name exceeds maximum length
  • Fix: Edit the Etsy Listing → Settings tab → Set a shorter Item Name (max 60 characters)

Duplicate Records

Symptoms: - Multiple Customers for the same Etsy buyer - Multiple Sales Orders for the same Etsy receipt

Causes: - Custom fields not created properly during installation - Database index not applied

Solutions:

  1. Re-run Installation Hook:

    bench --site [site-name] console
    
    from etsy.install import after_install
    after_install()
    exit()
    

  2. Verify Custom Fields:

    bench --site [site-name] console
    
    import frappe
    # Check if etsy_customer_id field exists on Customer
    frappe.get_all("Custom Field", filters={"dt": "Customer", "fieldname": "etsy_customer_id"})
    exit()
    

  3. Manually Remove Duplicates:

  4. Identify duplicate records
  5. Merge or delete duplicates manually
  6. Ensure future imports don't create duplicates

Synchronization Issues

Automatic Sync Not Running

Symptoms: - "Last Sync" timestamp in Etsy Settings doesn't update - Orders/listings not syncing automatically

Diagnosis Steps:

  1. Check Scheduler Status:

    bench --site [site-name] console
    
    import frappe
    frappe.get_value("System Settings", None, "scheduler_enabled")
    # Should return 1 (enabled)
    exit()
    

  2. Enable Scheduler (if disabled):

    bench --site [site-name] enable-scheduler
    bench restart
    

  3. Check Scheduled Job Types:

  4. Go to: Home > Tools > Scheduled Job Type
  5. Search for "Etsy"
  6. Verify:
    • "Stopped" is unchecked
    • "Cron Format" is set correctly

Scheduled Job Type Troubleshooting

Common Fixes:

Scheduler Disabled

bench --site [site-name] enable-scheduler
bench restart

Job Marked as Stopped

  • Open the Scheduled Job Type document
  • Uncheck "Stopped"
  • Save

Cron Expression Invalid

  • Check "Cron Format" field in Scheduled Job Type
  • Should be like */5 * * * * for 5-minute intervals
  • Edit Etsy Settings and save to regenerate cron

Sync Errors in Error Log

Symptoms: - Sync runs but creates errors in Error Log - Some records imported successfully, others fail

Diagnosis: - Review Error Log entries for specific error messages - Each error is isolated to a single record

Common Errors:

"Unique constraint violated"

  • Error: Duplicate entry 'X' for key 'etsy_order_id'
  • Meaning: Order already exists (expected behavior)
  • Action: No action needed; duplicate prevention working correctly

"Document not saved"

  • Error: Sales Order could not be saved
  • Meaning: Validation failed (missing required field, invalid data)
  • Action: Review error message for specific field, fix configuration

Performance Issues

Slow Imports

Symptoms: - Imports take a very long time - Timeouts during large historical imports

Causes: - Large number of records to import - Slow network connection - High database load

Solutions:

  1. Increase Job Timeout:

    bench --site [site-name] set-config job_timeout 3600
    bench restart
    

  2. Import in Batches:

  3. For historical imports, use smaller date ranges
  4. Instead of importing 1 year, import 1 month at a time

  5. Optimize Database:

    bench --site [site-name] mariadb
    
    OPTIMIZE TABLE `tabSales Order`;
    OPTIMIZE TABLE `tabCustomer`;
    OPTIMIZE TABLE `tabItem`;
    exit;
    

  6. Run During Off-Peak Hours:

  7. Schedule large imports during low-traffic times

High Memory Usage

Symptoms: - Server memory usage spikes during sync - Out-of-memory errors

Solutions:

  1. Reduce Sync Interval:
  2. Smaller batches = lower memory usage
  3. Change Sales Order interval from 5 to 10-15 minutes

  4. Increase Server Resources:

  5. Add more RAM to your server
  6. Use a larger VM/instance

Item and Variant Issues

Variants Not Created

Symptoms: - Item Template created but no Item Variants - Listing has variations on Etsy but not in ERPNext

Diagnosis: - Check Error Log for "Variant creation failed" - Verify inventory data in Etsy Listing → Inventory field (JSON)

Common Causes:

  1. Missing Attributes:
  2. Item Attributes not created properly
  3. Fix: Manually create Item Attributes matching Etsy properties (Color, Size, etc.)

  4. Invalid Attribute Values:

  5. Attribute values contain invalid characters
  6. Fix: Edit Item Attribute, clean up values

Item Prices Not Updating

Symptoms: - Etsy prices change but ERPNext items have old prices

Explanation: - Prices are updated only when you manually import listings or when auto-sync runs - Price updates are not pushed back to Etsy

Solutions: - Manually click "Import Listings" to refresh prices - Enable automatic listing sync in Etsy Settings

Stock Levels Out of Sync

Symptoms: - Stock levels in ERPNext don't match Etsy

Explanation: - Stock sync is one-way (Etsy → ERPNext) and only on initial import - Ongoing stock sync is not supported

Workaround: - Manage stock on Etsy only - Use ERPNext for order processing and accounting, not inventory management - Or manually update stock levels in ERPNext after Etsy changes

Configuration Issues

Missing Custom Fields

Symptoms: - "etsy_*" fields not visible on Customer, Sales Order, etc. - Errors about custom fields not found

Diagnosis:

bench --site [site-name] console
import frappe
frappe.get_all("Custom Field", filters={"fieldname": ["like", "etsy_%"]}, pluck="name")
# Should return multiple field names
exit()

Solutions:

  1. Re-run Installation:

    bench --site [site-name] console
    
    from etsy.install import after_install
    after_install()
    exit()
    

  2. Manually Create Custom Fields:

  3. Go to: Customization > Custom Field
  4. Create fields as defined in hooks.py

Custom Field List

  1. Migrate Site:
    bench --site [site-name] migrate
    

Naming Series Conflicts

Symptoms: - Duplicate naming series errors - Naming series not following configured pattern

Causes: - Placeholder not used correctly - Naming series conflicts with existing series

Solutions:

  1. Use Placeholders:
  2. For Sales Orders: EtsyOrder-{ETSY_ORDER_ID} (correct)
  3. Not: EtsyOrder-12345 (incorrect, hardcoded)

  4. Avoid Conflicts:

  5. Don't use the same naming series for Etsy and manual orders
  6. Use unique prefixes like Etsy- or ETSY-SO-

  7. Leave Blank for Default:

  8. If custom naming is causing issues, leave the field blank
  9. The integration will use the doctype's default naming series

API and Network Issues

Rate Limit Errors

Symptoms: - Error: "429 Too Many Requests" - Imports fail during large batches

Explanation: - Etsy API has rate limits (10 requests/second per token) - The app includes built-in rate limiting (250ms delay)

Solutions: - Wait a few minutes and retry - Rate limiting should handle this automatically - If persistent, reduce sync frequency

Network Timeouts

Symptoms: - Error: "Connection timeout" or "Request timeout" - Intermittent import failures

Causes: - Slow network connection - Etsy API temporary issues

Solutions:

  1. Retry Import:
  2. Manual imports can be retried immediately
  3. Automatic sync will retry on next schedule

  4. Increase Timeout:

    bench --site [site-name] set-config http_timeout 60
    bench restart
    

SSL Certificate Errors

Symptoms: - Error: "SSL certificate verification failed"

Causes: - Outdated CA certificates on server - Firewall or proxy interfering with HTTPS

Solutions:

  1. Update CA Certificates:

    sudo apt-get update
    sudo apt-get install ca-certificates
    

  2. Check System Time:

    date
    # Ensure system time is correct
    

  3. Disable SSL Verification (not recommended for production):

  4. Only as a last resort and temporary fix

Getting Help

If you've tried the solutions above and still have issues:

  1. Check Error Log:
  2. Home > Tools > Error Log
  3. Look for detailed error messages and stack traces

  4. Search GitHub Issues:

  5. Visit: https://github.com/maeurerdev/erpnext-etsy/issues
  6. Search for similar issues
  7. Check closed issues for solutions

  8. Create a New Issue:

  9. Click "New Issue" on GitHub
  10. Provide:

    • ERPNext version
    • App version (commit hash)
    • Detailed error messages from Error Log
    • Steps to reproduce
    • Relevant configuration (without sensitive data)
  11. Frappe Community:

  12. Post on Frappe Forum
  13. Tag with "etsy" and "integration"