Data Issue Investigation Techniques
Data Issue Investigation Techniques
Section titled “Data Issue Investigation Techniques”This guide covers advanced investigation techniques for diagnosing data issues beyond the basic workflow described in Data Issues Guide.
Investigation Strategy
Section titled “Investigation Strategy”1. Binary Search Approach
Section titled “1. Binary Search Approach”When investigating data issues, use binary search to narrow down the problem location:
flowchart TD
A[Start: Data Issue] --> B{Check Vendor Response}
B -->|Data incorrect in response| D[Vendor Side Problem]
B -->|Data correct in response| E{Check Parsing}
E -->|Parsing failed| F[Parsing Bug]
E -->|Parsed correctly| G{Check Sync/Save Logic}
G -->|Logic error| H[Sync Logic Bug]
G -->|No error found| I[Data Race/Intermittent]
D --> J[Contact Vendor]
F --> K[Fix Parsing Code]
H --> L[Fix Sync Logic]
I --> M[Retry/Document]
Principle: Cut possibilities in half with each check - Vendor vs RC, Request vs Response, Parse vs Process.
2. File Log Structure
Section titled “2. File Log Structure”File logs follow this naming convention:
{YYYYMMDD-HHMMSS}_{serial}_{type}.jsonExample: 20250308-123141_1a0e6_request.json
Types:
_request.json- Full request/response logged bylogRequestResponseToFile()_holdings.json- Holdings data subset from response- Other vendor-specific types
Path structure: s3://rightcapital-prd/logs/integration/{VENDOR}/{ADVISOR_ID}/{REFERENCE}/
3. Understanding Reference IDs
Section titled “3. Understanding Reference IDs”The z{number} directory names (e.g., z084793281) are Reference IDs - the Vendor’s identifier for our data.
To find Reference IDs:
- Go to Admin Center → Integrations
- Enter Advisor ID
- Find the vendor integration
- Click “Mappings”
- Input Household ID in “Mappable ID” filter
- The result shows the Reference ID
4. Code Tracing Techniques
Section titled “4. Code Tracing Techniques”When logs don’t reveal the issue, trace through the code:
Black Diamond Integration Structure:
graph TD
subgraph BlackDiamond Integration
Controller[Controller.php]
Integrator[Integrator.php]
Connector[Connector.php]
end
Controller --> Integrator
Integrator --> Connector
Key methods to trace:
getHoldings()- Fetches holdings datacall()- Makes HTTP request to vendorlogRequestResponseToFile()- Logs request/response
Code locations:
retail-api/app/Integrations/Lpl/Integrator.phpretail-api/app/Integrations/Lpl/Connector.php
5. Debugging Yodlee Race Conditions
Section titled “5. Debugging Yodlee Race Conditions”Yodlee’s data import can have race conditions:
Scenario:
- YodleeSaving request saves investment account (transaction in progress)
- Former request reads old Position list
- YodleeSaving transaction commits
- Latter request reads new Position list (with new positions)
- Former caches old Position data
- Latter reads from cache but has new positions without cache entries
Detection: Check Sentry events for Standalone position missing vendor value errors with timing patterns.
Code locations:
retail-api/app/Models/InvestmentAccountMarketValue.phppackages/libs/core-models/src/Models/InvestmentAccount.phppackages/libs/core-models/src/Models/RecentVendorPositionValue.php
Common Data Models
Section titled “Common Data Models”Standalone Positions
Section titled “Standalone Positions”Definition: Positions without a linked Security but have a reference. Only exist in Linked Accounts.
Investigation: When standalone positions are missing values:
- Check
recent_vendor_position_valuestable - Check
historical_positionstable for history - Verify vendor response in file logs
Investment Account Market Value
Section titled “Investment Account Market Value”Tables involved:
investment_accounts- Account recordsinvestment_account_market_values- Cached market values (4 working days)historical_investment_account_customs- Custom value settingspositions- Current positionshistorical_positions- Position historyrecent_vendor_position_values- Vendor-provided values (1 month)
Investigation script: php artisan accounts:calculate-investment-account-market-value
Communication with Vendors
Section titled “Communication with Vendors”Email Template
Section titled “Email Template”When vendor-side issues are identified:
Subject: Data Issue Investigation - {Vendor Name} - {Account/Household ID}
Structure:
- Describe the observed issue with timestamps
- Reference the specific account/holding IDs
- Attach relevant log excerpts
- Request investigation timeline
Example:
We're seeing incorrect data for household {ID} synced from {Vendor}.
Timeline:- 2025-03-07 14:30 UTC - Account shows incorrect balance- 2025-03-08 09:15 UTC - Previous sync was correct
Reference ID in your system: {z-number}Our Account ID: {encrypted_id}
Please investigate your records for this account during this timeframe.Advanced Cases
Section titled “Advanced Cases”Case: Black Diamond Deleted Account Still Receiving Data
Section titled “Case: Black Diamond Deleted Account Still Receiving Data”Symptom: Account deleted in BD but RC still receives updates.
Investigation:
- Check BD API response in file logs
- Verify if BD returns the deleted account
- If yes, BD issue; if no, check our merge logic
Result in case ENGR-10397: BD was still sending the account in their API response.
Case: Standalone Position Missing Vendor Value
Section titled “Case: Standalone Position Missing Vendor Value”Sentry Event: Standalone positions exist but missing vendor value.
Root cause analysis:
- Position exists in
positionswithsecurity_id = null - Historical position exists with
quantity > 0 - No matching record in
recent_vendor_position_values
Investigation steps:
- Check if vendor sent
priceorvaluein file log - Verify timing - was position created during Yodlee save?
- Check if value exists in earlier logs
Scripts and Commands
Section titled “Scripts and Commands”Useful Commands
Section titled “Useful Commands”# Check sync status for a mappingphp artisan integration:status --mapping-id=12345
# Trigger manual sync for one mappingphp artisan integration:sync --mapping-id=12345
# Sync all mappings for a vendorphp artisan integration:sync --vendor=schwab
# Check investment account market valuephp artisan accounts:calculate-investment-account-market-value --account-id=11394841 --as-of-date="2025-03-08"Related
Section titled “Related”- Data Issues Guide - Basic investigation workflow
- DITS Roadmap - Future automation vision
- Nightly Sync - Understanding sync timing