Azure 媒体服务错误代码Azure Media Services error codes

使用 Azure 媒体服务时,可能会从服务收到因问题而异的 HTTP 错误代码,例如身份验证令牌到期或媒体服务不支持操作。When using Azure Media Services, you may receive HTTP error codes from the service depending on issues such as authentication tokens expiring to actions that are not supported in Media Services. 以下是媒体服务可能返回的 HTTP 错误代码 及其可能原因的列表。The following is a list of HTTP error codes that may be returned by Media Services and the possible causes for them.

400 错误请求400 Bad Request

请求包含无效的信息,并出于以下原因之一被拒绝:The request contains invalid information and is rejected due to one of the following reasons:

  • 指定了不受支持的 API 版本。An unsupported API version is specified. 有关当前版本,请参阅媒体服务 REST API 开发的设置For the most current version, see Setup for Media Services REST API Development.

  • 未指定媒体服务的 API 版本。The API version of Media Services is not specified. 若要了解如何指定 API 版本,请参阅媒体服务操作 REST API 参考For information on how to specify the API version, see Media Services Operations REST API Reference.

    备注

    如果使用 .NET 或 Java SDK 连接到媒体服务,则无论何时尝试并执行针对媒体服务的操作,都会指定 API 版本。If you are using the .NET or Java SDKs to connect to Media Services, the API version is specified for you whenever you try and perform some action against Media Services.

  • 指定了未定义的属性。An undefined property has been specified. 错误消息中给出了该属性名。The property name is in the error message. 仅可指定身份是给定实体的成员的那些属性。Only those properties that are members of a given entity can be specified. 有关实体及其属性的列表,请参阅 Azure 媒体服务 REST API 参考See Azure Media Services REST API Reference for a list of entities and their properties.

  • 指定了无效的属性值。An invalid property value has been specified. 错误消息中提供属性名称。The property name is in the error message. 请参阅上一个链接,了解有效的属性类型及其值。See the previous link for valid property types and their values.

  • 缺少必需的属性值。A property value is missing and is required.

  • 指定的 URL 中包含错误的值。Part of the URL specified contains a bad value.

  • 尝试更新 WriteOnce 属性。An attempt was made to update a WriteOnce property.

  • 尝试创建输入资产中有未指定的或无法确定的主 AssetFile 的作业。An attempt was made to create a Job that has an input Asset with a primary AssetFile that was not specified or could not be determined.

  • 尝试更新 SAS 定位符。An attempt was made to update a SAS Locator. 只能创建或删除 SAS 定位符。SAS locators can only be created or deleted. 可以更新流式处理定位符。Streaming locators can be updated. 有关详细信息,请参阅 定位符For more information, see Locators.

  • 提交了不受支持的操作或查询。An unsupported operation or query was submitted.

401 未授权401 Unauthorized

由于以下任一原因,无法在授权请求之前对其进行身份验证:The request could not be authenticated (before it can be authorized) due to one of the following reasons:

  • 缺少身份验证标头。Missing authentication header.
  • 身份验证标头值错误。Bad authentication header value.
    • 令牌已过期。The token has expired.
    • 令牌包含无效签名。The token contains an invalid signature.

403 禁止访问403 Forbidden

出于以下原因之一,不允许该请求:The request is not allowed due to one of the following reasons:

  • 无法找到媒体服务帐户或媒体服务帐户已被删除。The Media Services account cannot be found or has been deleted.

  • 媒体服务帐户已被禁用且请求类型不是 HTTP GET。The Media Services account is disabled and the request type is not HTTP GET. 服务操作也会返回 403 响应。Service operations will return a 403 response as well.

  • 身份验证令牌不包含用户的凭据信息:AccountName 和/或 SubscriptionId。The authentication token does not contain the user’s credential information: AccountName and/or SubscriptionId. 有关 Azure 管理门户中媒体服务帐户的此类信息,可在媒体服务 UI 扩展中找到。You can find this information in the Media Services UI extension for your Media Services account in the Azure Management Portal.

  • 无法访问资源。The resource cannot be accessed.

    • 尝试使用不可用于媒体服务帐户的 MediaProcessor。An attempt was made to use a MediaProcessor that is not available for your Media Services account.
    • 尝试更新媒体服务定义的 JobTemplate。An attempt was made to update a JobTemplate defined by Media Services.
    • 尝试覆盖某些其他媒体服务帐户的定位符。An attempt was made to overwrite some other Media Services account's Locator.
    • 尝试覆盖某些其他媒体服务帐户的 ContentKey。An attempt was made to overwrite some other Media Services account's ContentKey.
  • 由于已达到媒体服务帐户的服务配额,无法创建资源。The resource could not be created due to a service quota that was reached for the Media Services account. 有关服务配额的详细信息,请参阅配额和限制For more information on the service quotas, see Quotas and Limitations.

404 未找到404 Not Found

出于以下原因之一,资源不允许该请求:The request is not allowed on a resource due to one of the following reasons:

  • 尝试更新不存在的实体。An attempt was made to update an entity that does not exist.
  • 尝试删除不存在的实体。An attempt was made to delete an entity that does not exist.
  • 尝试创建与不存在的实体链接的实体。An attempt was made to create an entity that links to an entity that does not exist.
  • 尝试对不存在的实体执行 GET 操作。An attempt was made to GET an entity that does not exist.
  • 尝试指定未与媒体服务帐户关联的存储帐户。An attempt was made to specify a storage account that is not associated with the Media Services account.

409 冲突409 Conflict

出于以下原因之一,未允许该请求:The request is not allowed due to one of the following reasons:

  • 资产内有多个 AssetFile 具有指定的名称。More than one AssetFile has the specified name within the Asset.
  • 尝试在资产内创建第二个主 AssetFile。An attempt was made to create a second primary AssetFile within the Asset.
  • 尝试使用已使用的指定 ID 创建 ContentKey。An attempt was made to create a ContentKey with the specified Id already used.
  • 尝试使用已使用的指定 ID 创建定位符。An attempt was made to create a Locator with the specified Id already used.
  • IngestManifest 内有多个 IngestManifestFile 具有指定的名称。More than one IngestManifestFile has the specified name within the IngestManifest.
  • 尝试将第二个存储加密 ContentKey 链接到存储加密资产。An attempt was made to link a second storage encryption ContentKey to the storage-encrypted Asset.
  • 尝试将同一 ContentKey 链接到资产。An attempt was made to link the same ContentKey to the Asset.
  • 曾尝试向存储容器缺失或不再与资产关联的资产创建定位符。An attempt was made to create a locator to an Asset whose storage container is missing or is no longer associated with the Asset.
  • 曾尝试向已使用 5 个定位符的资产创建定位符。An attempt was made to create a locator to an Asset which already has 5 locators in use. (Azure 存储强制执行对一个存储容器只能使用五个共享访问策略这一限制。)(Azure Storage enforces the limit of five shared access policies on one storage container.)
  • 将资产的存储帐户链接到 IngestManifestAsset 与父 IngestManifest 所使用的存储帐户的情况不同。Linking storage account of an Asset to an IngestManifestAsset is not the same as the storage account used by the parent IngestManifest.

500 内部服务器错误500 Internal Server Error

在处理请求期间,媒体服务会遇到一些阻止处理继续执行的错误。During the processing of the request, Media Services encounters some error that prevents the processing from continuing. 这可能是以下原因之一造成的:This could be due to one of the following reasons:

  • 创建资产或作业因媒体服务帐户的服务配额信息暂时不可用而失败。Creating an Asset or Job fails because the Media Services account's service quota information is temporarily unavailable.
  • 创建资产或 IngestManifest blob 存储容器因帐户的存储帐户信息暂时不可用而失败。Creating an Asset or IngestManifest blob storage container fails because the account's storage account information is temporarily unavailable.
  • 其他意外错误。Other unexpected error.

503 服务不可用503 Service Unavailable

服务器当前无法接收请求。The server is currently unable to receive requests. 导致此错误的可能原因是向服务发出了过多的请求。This error may be caused by excessive requests to the service. 媒体服务限制机制会限制那些发出过多服务请求的应用程序的资源使用情况。Media Services throttling mechanism restricts the resource usage for applications that make excessive request to the service.

备注

查看错误消息和错误代码字符串,获取收到 503 错误的原因的更多详细信息。Check the error message and error code string to get more detailed information about the reason you got the 503 error. 此错误并不始终意味着限制。This error does not always mean throttling.

可能的状态说明是:Possible status descriptions are:

  • “服务器正忙。"Server is busy. 之前运行这种类型的请求所用时间超过 {0} 秒。”Previous runs of this type of request took more than {0} seconds."
  • “服务器正忙。"Server is busy. 每秒超过 {0} 个请求可能会受到限制。”More than {0} requests per second can be throttled."
  • “服务器正忙。"Server is busy. {1} 秒中超过 {0} 个请求可能会受到限制。”More than {0} requests within {1} seconds can be throttled."

若要处理此错误,我们建议使用指数回退重试逻辑。To handle this error, we recommend using exponential back-off retry logic. 这意味着在连续错误响应的重试之间使用渐进式长等待。That means using progressively longer waits between retries for consecutive error responses. 有关详细信息,请参阅 临时故障处理应用程序块For more information, see Transient Fault Handling Application Block.

备注

如果使用 用于 .NET 的 Azure 媒体服务 SDK,503 错误的重试逻辑由 SDK 实现。If you are using Azure Media Services SDK for .Net, the retry logic for the 503 error has been implemented by the SDK.

另请参阅See Also

媒体服务管理错误代码Media Services Management Error Codes

后续步骤Next steps

媒体服务 v3(最新版本)Media Services v3 (latest)

查看最新版本的 Azure 媒体服务!Check out the latest version of Azure Media Services!

媒体服务 v2(旧版)Media Services v2 (legacy)