All error codes

invalid_memory

HTTP 422 Memory must be a whole number of gigabytes

What happened

memory_mb is not a whole number of gigabytes. Memory is expressed in megabytes, but only whole gigabytes are accepted, so the value must be a multiple of 1024.

What to do

Round memory_mb to a multiple of 1024 - 4096 for 4 GB, 8192 for 8 GB - and send the request again. The rule is the same when creating a server and when resizing one.

Retrying

Fix the request and send it again.

How it arrives

{
    "type": "https://docs.fiberax.com/errors/invalid_memory",
    "title": "Memory must be a whole number of gigabytes",
    "status": 422,
    "code": "invalid_memory",
    "request_id": "a277dcd1ca652c65"
}

Branch your code on code, never on the wording of title.