阿里云oss视频截取的时候显示 403错误是什么原因?怎么办?

在使用阿里云OSS的视频截取功能是,如果出现403错误,可以按照本篇文章去处理修复。

403错误是网站访问过程中,常见的错误提示,意思为资源不可用,服务器理解客户的请求,但拒绝处理它。通常由于服务器上文件或目录的权限设置导致的WEB访问错误,比如IIS或者apache设置了访问权限不当。

那么具体是哪个访问权限有问题了,可以仔细看下报错的网页,一般来说网页标题是403,在页面的右上角会有详细报错原因,咱们可以根据这个报错原因进行排查。

阿里云OSS视频截取403错误示例图

常见的403错误内容问题及原因如下表所示:

错误分类 错误码和错误信息 错误原因 解决办法
欠费相关

ErrorCode: UserDisable

ErrorMessage:  UserDisable

  • OSS欠费被禁
  • 由于安全原因被禁
UserDisable.UserDisable错误
时间ErrorCode: RequestTimeTooSkewed
ErrorMessage: The difference between the request time and the current time is too large.
发送请求的时间与OSS收到请求的时间间隔超出了15分钟,OSS从安全考虑认为该请求是无效的,返回报错。请检查发送请求设备的系统时间,并根据时区调整到正确时间。详情请参见RequestTimeTooSkewed.The difference between…错误
文件损坏ErrorCode: ImageDamage
ErrorMessage: The image file may be damaged.
说明图片文件有部分信息丢失或损坏,导致无法正常识别或处理。ImageDamage.The image file may be damaged错误
跨域

ErrorCode: AccessForbidden

ErrorMessage: CORSResponse: This CORS request is not allowed. This is usually because the evalution of Origin, request method / Access-Control-Request-Method or Access-Control-Requet-Headers are not whitelisted by the resource’s CORS spec.

没有配置CORS或CORS配置错误OSS设置跨域访问
防盗链ErrorCode: AccessDenied

ErrorMessage: You are denied by bucket referer policy.

访问域名不在OSS防盗链的白名单中。OSS防盗链
权限

ErrorCode: AccessDenied

ErrorMessage: The bucket you are attempting to access must be addressed using the specified endpoint. Please send all future requests to this endpoint.

Bucket和Endpoint不符OSS权限相关常见错误的排查方法
ErrorCode: AccessDenied
ErrorMessage: AccessDenied
说明访问OSS的用户没有当前操作的权限。

ErrorCode: InvalidAccessKeyId
ErrorMessage: The OSS Access Key Id you provided does not exist in our records.

原因可能是AccessKeyID禁用或不存在。
ErrorCode: SignatureDoesNotMatch
ErrorMessage: The request signature we calculated does not match the signature you provided. Check your key and signing method.
签名不匹配。
ErrorCode: AccessDenied

ErrorMessage: You are forbidden to list buckets.

无ListBuckets权限如果需要修改权限,可参考基于读写权限ACL的权限控制中的权限列表赋予相应的权限。
ErrorCode: AccessDenied

ErrorMessage: You do not have write acl permission on this object

无SetObjectAcl权限
ErrorCode: AccessDenied

ErrorMessage: You do not have read acl permission on this object.

无GetObjectAcl权限
ErrorCode: AccessDenied

ErrorMessage: The bucket you access does not belong to you.

子用户没有Bucket管理的权限(如GetBucketAcl CreateBucket、DeleteBucket SetBucketReferer、 GetBucketReferer等)如果需要修改权限,可参考使用RAM Policy控制OSS的访问权限修改权限。
ErrorCode: AccessDenied

ErrorMessage: You have no right to access this object because of bucket acl.

子用户/临时用户没有访问Object的权限(如putObject getObject、appendObject deleteObject、postObject)等
ErrorCode: AccessDenied

ErrorMessage: Access denied by authorizer’s policy.

临时用户访问无权限,该临时用户角色扮演指定授权策略,该授权策略无权限
ErrorCode: AccessDenied

ErrorMessage: You have no right to access this object.

子用户/临时用户无当前操作权限(如initiateMultipartUpload等)
ErrorCode: AccessDenied

ErrorMessage: Invalid according to Policy: Policy expired.

PostObject中Policy无效 PostObject
ErrorCode: AccessDenied

ErrorMessage: Invalid according to Policy: Policy Condition failed:[“eq”, “$Content-Type”, “application/octet-stream”] …

Content-Type限定了,比如请求中Content-Type限定为image/png,而实际与限定不符。设置Content-Type

大家遇到阿里云OSS 视频截取403错误的话,按照上面的表格排查问题就可以解决啦。

相关阅读:

  1. OSS常用工具汇总
  2. ossfs使用问题排查案例

发布者:lidazhuang,转转请注明出处:https://www.cms2.cn/aliyun/oss/6333.html

发表评论

邮箱地址不会被公开。 必填项已用*标注