AgoraIO / API-Examples

Play with AgoraSDK and have fun! Everything you need to start learning Agora.
294 stars 217 forks source link

Agora cloud recording- failed to find worker #373

Closed simdanonline closed 14 hours ago

simdanonline commented 6 months ago

I am trying to use cloud recording. After calling acquire, I get the resourceId, also start also returns the Sid, uid, and resource id. But whenever I call query or stop, I get 404 error.I have tried using both aws and google storage.

Code snippet below: const authHeader = "Basic " + base64.encode({agoraApiKey}:{agoraApiSecret});

  const body = {
  cname: channelName,
  uid,
  clientRequest: {
    token,
    storageConfig: {
      secretKey: "*****",
      vendor: 1,
      region: 5,
      bucket: "b****",
      accessKey: "*******",
      fileNamePrefix: ["video"],
    },
    recordingConfig: {
      channelType: 1,
      streamTypes: 2,
      maxIdleTime: 30,
      audioProfile: 1,
      videoStreamType: 0,
      transcodingConfig: {
        height: 640,
        width: 360,
        bitrate: 500,
        fps: 15,
        mixedVideoLayout: 1,
        backgroundColor: "#FF0000",
      },
    },
  },
};
const { data } = await axios.post(
  `https://api.agora.io/v1/apps/${agoraAppId}/cloud_recording/resourceid/${resourceId}/mode/mix/start`,
  body,
  {
    headers: {
      Authorization: authHeader,
    },
  }
);`

Then I get this response:

{"cname": "64ce638a934f", "code": 404, "resourceId": "s1pH1NB-7Cjy_hmfRaLzcG74ha3F3rG7L0RviD9tSQxEz6ekbROut-5iZ_HozZc_CawzSQ3J-jfh9Bfw_IJm4sNPIA9-uAN0", "serverResponse": {"command": "StopCloudRecorder", "payload": {"message": "failed to find worker"}, "subscribeModeBitmask": 1, "vid": "1209"}, "sid": "746d1de45d2780add6f055", "uid": "18761"}

plutoless commented 6 months ago

please refer to docs here https://docs.agora.io/en/cloud-recording/get-started/getstarted you will need to acquire first before start