Issue Description
Customers report that recorded assets are missing from the primary cloud storage destination (e.g., Alibaba Cloud OSS) despite the Cloud Recording API returning a successful upload status. Investigations frequently reveal that the assets were successfully uploaded, but to an alternative storage provider (e.g., AWS S3) due to client-side business logic inconsistencies.
Platform/SDK
Service: Agora Cloud Recording
Root Cause
The Agora Cloud Recording service strictly adheres to the storage provider specified in the start request payload. The service never autonomously modifies storage routing. Mismatches occur exclusively due to client-side logic errors, such as:
Race Conditions: Duplicate recording requests triggered in rapid succession with conflicting configurations.
State Mismatched: The customer-side database recording the destination state (OSS) differs from the actual successful API call (S3).
Environment Switching: Application logic that dynamically selects storage providers based on user region or IP, which may fail to update the corresponding session record in the customer’s database.
Step-by-Step Solution
Audit the Source of Truth
Retrieve the raw request payload sent to the Agora Cloud Recording
startendpoint. Validate thestorageConfigblock to confirm the provider (vendor ID) and the specific bucket/path parameters requested.Verify Asset Existence across Endpoints
If the assets are missing from the primary bucket, perform a cross-platform audit. Search all potential storage providers configured in the application logic for the session SID or channel name.
Correlate Webhook and Upload Records
Analyze the full lifecycle of the recording task by comparing three sources:
The storage-provider-specific webhook delivery logs.
Agora backend upload status records (available via support internal tools).
The actual contents of the target storage buckets.
Detect Duplicate Request Patterns
Investigate if the application layer triggered competing recording start requests. A common pattern involves a failed initial request (e.g., OSS configuration error) followed by a successful secondary request (e.g., S3 configuration), where the application recorded the state of the failed request instead of the final successful one.
Validate Full Payload Integrity
Ensure the customer’s backend retains the full Cloud Recording request and response payloads, including
SID,resourceID,HTTP status, and the specificstorageConfig.
Best Practice
Centralize Storage Logic: Enforce a single source of truth for storage configuration. The service configuration should be locked before the recording starts.
Atomic State Updates: Database records must only be updated based on the successful response from the Cloud Recording API, not from the initial request attempt.
Integrity Auditing: Implement automated post-session audits that verify file existence in the configured storage bucket immediately after the
recorder_leaveevent.Logging: Require customers to log the full request/response payloads of all Cloud Recording API calls for rapid support engagement.