All Products
Search
Document Center

Object Storage Service:0006-00000224

Last Updated:Mar 20, 2026

Problem description

A PostObject request fails because a value in the conditions array of the policy form field has an invalid data type.

Causes

Each condition in the conditions array is a tuple that starts with an operator, followed by operator-specific fields and values. The data type of the value must match what the operator requires. The in and not-in operators require a List (a JSON array) as the value, not a String.

Examples

The following policy triggers the error. The not-in operator receives "no-cache" as a String, but it requires a List:

{
    "expiration": "2023-02-19T13:19:00.000Z",
    "conditions": [
        ["not-in", "cache-control", "no-cache"]
    ]
}

Solutions

Pass the correct data type for each operator. The following table shows the required value type for each operator used in the examples below:

OperatorRequired value typeExample
eqString["eq", "$success_action_status", "201"]
starts-withString["starts-with", "$key", "user/eric/"]
content-length-rangeTwo integers (min, max)["content-length-range", 1, 1024]
inList["in", "$content-type", ["image/jpeg", "image/png"]]
not-inList["not-in", "$cache-control", ["no-cache"]]

The following example shows a valid conditions array using all supported operators:

{
    "expiration": "2023-02-19T13:19:00.000Z",
    "conditions": [
        ["content-length-range", 1, 1024],
        ["eq", "$success_action_status", "201"],
        ["starts-with", "$key", "user/eric/"],
        ["in", "$content-type", ["image/jpeg", "image/png"]],
        ["not-in", "$cache-control", ["no-cache"]]
    ]
}

References