Joish
Joish

Reputation: 1540

Agora cloud recording not saving to S3 and returning 404

I am trying to save my audio feed to AWS S3. Acquire and start call give proper response as given in the documentation, but when I try to stop the recording it throws a 404 error code. Also the recording is not found in AWS S3 bucket.

Below are the request and response for each of the call

/acquire
#Request body 
body = {"cname": cname, "uid": uid, "clientRequest": {"resourceExpiredHour": 24}}
#Response
"Code": 200,
"Body":
{
 "resourceId": "IqCWKgW2CD0KqnZm0lcCzQisVFotYiClVu2jIxWs5Rpidc9y5HhK1HEHAd77Fy1-AK9piRDWUYNlU-AC7dnZfo6QVukbSB_eh3WqTv9_ULLK-EXxt93zdO8yAzY-3SGMPVJ5x4Rx3DsHgvBfnzJWhOvjMFEcEU9X4WMmtdXJxqjV3hhpsx74tefhzfPA2A7J2UDlmF4RRuINeP4C9uMRzPmrHlHB3BrQcogcBfdgb9DAx_ySNMUXGMQX3iGFuWBtjNRB4OLA2HS04VkSRulx3IyC5zkambri3ROG6vFV04jsPkeWb3hKAdOaozYyH4Sq42Buu7dM2ndVxCMgoiPDCi-0JCBL77RkuOijiOGQtOU-w9QKoPlTXRNeTur1MSfouE0A-4eDgu79FxK5abX7dckwcv9R3AExvs47U-uhmBh8vE6NXx4dQrXsu9Krx7Ao"
}


/start
#Request body 
body = {
        "uid": uid,
        "cname": cname,
        "clientRequest": {
            "recordingConfig": {
                "maxIdleTime": 30,
                "streamTypes": 0,
                "channelType": 0,
            },
            "recordingFileConfig": {"avFileType": ["hls"]},
            "storageConfig": {
                "accessKey": ACCESS_ID,
                "region": 8,
                "bucket": BUCKET_NAME,
                "secretKey": ACCESS_SECRET,
                "vendor": 1,
                "fileNamePrefix": [cname, TODAY_DATE.strftime("%d%m%Y")],
            },
        },
    }
#Response
"Code": 200,
"Body":
{
"sid": "fd987833cb49dc9ba98ceb8498ac23c4", 
"resourceId": "IqCWKgW2CD0KqnZm0lcCzQisVFotYiClVu2jIxWs5Rpidc9y5HhK1HEHAd77Fy1-AK9piRDWUYNlU-AC7dnZfo6QVukbSB_eh3WqTv9_ULLK-EXxt93zdO8yAzY-3SGMPVJ5x4Rx3DsHgvBfnzJWhOvjMFEcEU9X4WMmtdXJxqjV3hhpsx74tefhzfPA2A7J2UDlmF4RRuINeP4C9uMRzPmrHlHB3BrQcogcBfdgb9DAx_ySNMUXGMQX3iGFuWBtjNRB4OLA2HS04VkSRulx3IyC5zkambri3ROG6vFV04jsPkeWb3hKAdOaozYyH4Sq42Buu7dM2ndVxCMgoiPDCi-0JCBL77RkuOijiOGQtOU-w9QKoPlTXRNeTur1MSfouE0A-4eDgu79FxK5abX7dckwcv9R3AExvs47U-uhmBh8vE6NXx4dQrXsu9Krx7Ao"
}


/stop
#Request body 
body = {"cname": cname, "uid": uid, "clientRequest": {}}
#Response
{
    "resourceId": "IqCWKgW2CD0KqnZm0lcCzQisVFotYiClVu2jIxWs5Rpidc9y5HhK1HEHAd77Fy1-AK9piRDWUYNlU-AC7dnZfo6QVukbSB_eh3WqTv9_ULLK-EXxt93zdO8yAzY-3SGMPVJ5x4Rx3DsHgvBfnzJWhOvjMFEcEU9X4WMmtdXJxqjV3hhpsx74tefhzfPA2A7J2UDlmF4RRuINeP4C9uMRzPmrHlHB3BrQcogcBfdgb9DAx_ySNMUXGMQX3iGFuWBtjNRB4OLA2HS04VkSRulx3IyC5zkambri3ROG6vFV04jsPkeWb3hKAdOaozYyH4Sq42Buu7dM2ndVxCMgoiPDCi-0JCBL77RkuOijiOGQtOU-w9QKoPlTXRNeTur1MSfouE0A-4eDgu79FxK5abX7dckwcv9R3AExvs47U-uhmBh8vE6NXx4dQrXsu9Krx7Ao",
    "sid": "fd987833cb49dc9ba98ceb8498ac23c4",
    "code": 404,
    "serverResponse": {
        "command": "StopCloudRecorder",
        "payload": {
            "message": "Failed to find worker."
        },
        "subscribeModeBitmask": 1,
        "vid": "431306"
    }
}

My AWS bucket CORS policy is as follows:

[
    {
        "AllowedHeaders": [
            "Authorization",
            "*"
        ],
        "AllowedMethods": [
            "HEAD",
            "POST"
        ],
        "AllowedOrigins": [
            "*"
        ],
        "ExposeHeaders": [
            "ETag",
            "x-amz-meta-custom-header",
            "x-amz-storage-class"
        ],
        "MaxAgeSeconds": 5000
    }
]

Upvotes: 0

Views: 2290

Answers (1)

Victor Vasconcelos
Victor Vasconcelos

Reputation: 21

I was facing the same issue.

I wanted to record a session even with one user, but seems that this is not possible, must be two users with different uid. Not sure why but at least the following worked for me.

Try:

  1. Start your stream with one user like uid: 1
  2. Connect with another device to the same channel but different uid.
  3. Start recording
  4. Before stop your recording make sure that query request is returning data
  5. If you are getting data from query request, then your stream is recording.

Upvotes: 1

Related Questions