About This Article
Network issues and API rate limits mean sync failures are unavoidable. Therefore, we need to design recovery methods for errors. This article explains error patterns and their solutions.
Types of Sync Failures
Error Pattern Classification
| Pattern | Cause | Frequency | Urgency |
|---|---|---|---|
| Connection error | Network failure, API down | Low | High |
| Timeout | Processing delay, overload | Somewhat low | Medium |
| Auth error | Token expired, insufficient permissions | Low | High |
| Rate limit | API call limit exceeded | Medium | Low |
| Data error | Invalid format, missing required fields | Medium | Medium |
| Duplicate error | Conflict with existing data | Somewhat high | Low |
Error Patterns and Solutions
Pattern 1: POS API Connection Error
| Item | Content |
|---|---|
| Situation | API connection to POS system fails |
| Cause examples | POS server down, network failure, under maintenance |
Maintain main registration process
Log error, notify admin
Execute re-sync manually or automatically
Customer impact: Normal use online. Guide store use with "Please wait a moment"
Pattern 2: Data Format Error
| Item | Content |
|---|---|
| Situation | POS API returns data format error |
| Cause examples | Required field empty, phone number format invalid, address too long |
Identify which field has the problem
If possible, fix and retry / If not, notify admin
| Auto-fix Example | Processing |
|---|---|
| Phone number | Remove hyphens |
| Address | Truncate to fit character limit |
| Empty field | Set default value |
Pattern 3: Duplicate Error
| Item | Content |
|---|---|
| Situation | 'This email address is already registered' error |
| Cause | Existing store member registers online, or duplicate registration due to sync timing |
Search existing customer by email address
Success -> Update existing customer's member number / Failure -> Record potential duplicate
Combine point balances, integrate purchase history, invalidate old record
Recovery Mechanism
Automatic Retry
| Attempt | Wait Time | Next Action |
|---|---|---|
| 1st failure | 2 seconds | Retry |
| 2nd failure | 4 seconds | Retry |
| 3rd failure | 8 seconds | Retry |
| 4th failure | - | Give up and log error |
Exponential backoff: Doubling wait time reduces server load
| Error Type | Retry | Reason |
|---|---|---|
| Connection error | Yes | Possibly temporary failure |
| Timeout | Yes | Possibly temporary overload |
| Auth error | No | Retry yields same result |
| Data format error | No | Data fix required |
| Duplicate error | No | Different response needed |
Managing Unsynced Data
| Customer ID | Shopify | POS Sync | CRM Sync | Notes |
|---|---|---|---|---|
| 12345 | Success | Success | Success | - |
| 12346 | Success | Failed | Success | Needs re-sync |
| 12347 | Success | Success | Skipped | - |
Admin panel verification method:
- Filter by "POS sync failed"
- Check error content
- Retry with "Re-sync" button
Admin Tools
Sync Status Check
| Item | Count | Action |
|---|---|---|
| Synced | 1,234 | - |
| Unsynced (POS) | 5 | View details |
| Unsynced (CRM) | 2 | View details |
| Customer ID | Name | Error Type | Time |
|---|---|---|---|
| 12346 | Taro Yamada | POS connection error | 10:30 |
| 12350 | Hanako Suzuki | Data format error | 10:25 |
Operation: "Batch re-sync unsynced" button processes all targets at once
Re-sync Function
Select unsynced customers from list (individual or batch)
Run sync process again with "Re-sync" button
Verify success/failure results
If still failing, check error details and respond
Error Log Design
Information to Record
| Item | Content | Purpose |
|---|---|---|
| Timestamp | Error occurrence time | Chronological analysis |
| Customer ID | Target customer | Tracking and retry |
| Sync target | POS/CRM etc. | Identify failure location |
| Error type | Connection/Auth/Data etc. | Determine response method |
| Error details | API response etc. | Cause investigation |
| Retry count | How many attempts | Escalation decision |
Log Example
| Field | Value | Description |
|---|---|---|
| timestamp | 2024-01-15T10:30:00Z | Error occurrence time |
| level | error | Log level |
| event | pos_sync_failed | Event type |
| customer_id | 12346 | Target customer ID |
| customer_email | yamada@example.com | Customer email |
| sync_target | pos | Target system |
| error_type | connection_error | Error type |
| error_message | Connection timed out after 15000ms | Error details |
| retry_count | 4 | Retry count |
| will_retry | false | Whether additional retry |
| shopify_sync | success | Shopify sync result |
| crm_sync | success | CRM sync result |
Monitoring and Alerts
Alert Conditions
| Condition | Alert Level | Notification Target |
|---|---|---|
| POS sync failures exceed 5/hour | Warning | Slack notification |
| POS sync fails continuously for 10+ minutes | Critical | Phone/Email |
| Unsynced data exceeds 100 items | Warning | Daily report |
| Auth error occurs | Critical | Immediate notification |
Dashboard
| Sync Target | Success Rate (Last 24 Hours) |
|---|---|
| POS | 99.2% |
| CRM | 99.8% |
| Overall | 99.5% |
Error trend: Graph error occurrence count over time to understand trends
Recent errors: 10:30 Connection error 1 case -> Resolved by auto-retry
Benefits of This Design
Availability
- Overall service continues despite some errors
- Auto-retry recovers from temporary failures
- Quick awareness when manual response needed
Operational Efficiency
- Automatic error detection and notification
- Easy re-sync from admin panel
- Rich logs for cause investigation
Customer Experience
- Basic service continues despite errors
- Minimized time to problem resolution
- Transparent status reporting possible