0017-00000250

Updated at:

Problem description

The InvalidArgument error occurs when the styleName parameter in a PutStyle request contains an invalid value.

Causes

The image style name exceeds the allowed length or contains characters that are not permitted.

A valid style name must meet both of these requirements:

  • Length: 1–63 characters

  • Allowed characters: letters (a–z, A–Z), digits (0–9), underscores (_), hyphens (-), and periods (.)

Examples

The following request fails because the styleName value is 64 characters long, exceeding the 63-character limit.

Request:

https://junchengtest.oss-cn-chengdu.aliyuncs.com/?style&styleName=ImagestyleImagestyleImagestyleImagestyleImagestyleImagestyleabcd
OSS LTAI****************:PCX5************************
Wed, 08 Feb 2023 06:36:40 GMT
body:
<Style>
  <Content>image/resize,p_60</Content>
</Style>

Error response:

<Error>
    <Code>InvalidArgument</Code>
    <Message>The value: ImagestyleImagestyleImagestyleImagestyleImagestyleImagestyleabcd of parameter: stylename is invalid.</Message>
    <RequestId>63E34323B519C43130859DA0</RequestId>
    <HostId>junchengtest.oss-cn-chengdu.aliyuncs.com</HostId>
</Error>

Solutions

Rename the image style to meet the naming requirements (1–63 characters, letters, digits, underscores, hyphens, and periods), then resend the request.

References