discord-api-docs
discord-api-docs copied to clipboard
>64 media items in Components V2 results in 500 error
Description
When sending 64 fish:
{
"flags": "32768",
"components": [
{
"type": 17,
"components": [
{
"type": 12,
"items": [
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
}
]
},
{
"type": 12,
"items": [
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
}
]
},
{
"type": 12,
"items": [
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
}
]
},
{
"type": 12,
"items": [
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
}
]
},
{
"type": 12,
"items": [
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
}
]
},
{
"type": 12,
"items": [
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
}
]
},
{
"type": 12,
"items": [
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
}
]
},
{
"type": 12,
"items": [
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
}
]
}
]
}
]
}
The API acts as expected, and sends a message with 64 fish.
When attempting to send 65 or more fish:
{
"flags": "32768",
"components": [
{
"type": 17,
"components": [
{
"type": 12,
"items": [
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
}
]
},
{
"type": 12,
"items": [
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
}
]
},
{
"type": 12,
"items": [
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
}
]
},
{
"type": 12,
"items": [
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
}
]
},
{
"type": 12,
"items": [
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
}
]
},
{
"type": 12,
"items": [
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
}
]
},
{
"type": 12,
"items": [
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
}
]
},
{
"type": 12,
"items": [
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
},
{
"media": {"url": "https://em-content.zobj.net/source/twitter/408/fish_1f41f.png"},
"description": "๐"
}
]
}
]
}
]
}
The API returns:
{
"message": "500: Internal Server Error",
"code": 0
}
This limit is not documented and the error response is not informative.
This issue also persists despite the media type being used. The 64 limitation appears to include all elements of Media Gallery and Thumbnail
Steps to Reproduce
Send a Components V2 message with 65 or more media components (fishes are optional)
Expected Behavior
The API should send a clear error with a documented limitation on media components and error code, or allow the sending of >64 media components
Current Behavior
The api returns a 500 error when sending >64 media components
Screenshots/Videos
No response
Client and System Information
Testing performed with Postman
Confirming I'm also experiencing this issue with Components V2.
When attempting to send 64 or more media components, the API returns a 500 Internal Server Error, exactly as described.
My specific use case involves trying to send exactly 65 images (of cows, importantly!) to a group chat ("the boys chat"), and I'm consistently hitting this error when the count exceeds 64.
Hoping for a fix soon!
I can confirm this limitation also affects my attempt to send 128 penguin pictures (๐ง x128) via Components V2. The behavior is identical to both the fish and cow cases mentioned above:
- 64 penguins: Works perfectly
- 128 penguins: Returns 500: Internal Server Error
This appears to be a hard limit affecting all media types, whether fish, cows, or penguins. The undocumented 64-item restriction makes it impossible to properly fill empty channels with adequate amounts of aquatic birds (or other media).
Would love to see either:
- The limit raised (128 would be ideal for my penguin needs)
- Proper documentation of the limitation
- A more descriptive error message
Until then, my penguin campaign remains grounded. ๐งโ๏ธ
+1 on this limitation. As a particularly hungry individual, I can easily consume a large amount of food- in fact, up to 128 hamburgers in one sitting (for those unfamiliar, they look like this: ๐). Increasing the limit to 128 media items would significantly help accommodate my unusual appetite.
Currently, the restriction to 64 items means I can only receive half of what I need at a time, which is inconvenient and frustrating. If I had known beforehand, I could have accommodated my needs more properly.
I agree with @OoLunar's earlier points: if raising the limit isn't an option, please at least document this behavior clearly.
tl;dr the request entity is too large.
The correct error to return would be 40005
You can see that 100 items are possible when sending something invalid like https://a.tld/a
Also since when are issues part of shitpost places
It's just some lighthearted fun, sorry if it made you uncomfortable.
Anyway, I do agree that, even for other validation issues, better error reporting from the API might be nice. Plus the fact that this error is seemingly undocumented.
tl;dr the request entity is too large.
The correct error to return would be
40005You can see that 100 items are possible when sending something invalid like
https://a.tld/aAlso since when are issues part of shitpost places
It seems this may be the case.
When attempting to send 1x1 pixels https://upload.wikimedia.org/wikipedia/commons/c/ca/1x1.png, I can reach 66 pixels without issue, but 67 pixels returns:
{
"message": "500: Internal Server Error",
"code": 0
}
The fish vs pixel deviation suggests this error may be coming from Discord's backend - at some point - processing all of the image data and returning some form of error related to message size limitations.
With 66 1 pixel images, across 7 media galleries, and 83 characters in a text display component, the response is also:
{
"message": "500: Internal Server Error",
"code": 0
}
Further suggesting this is due to the request entity being too large to process.
The largest response body I was able to achieve was 31.08 KB uncompressed & 1.16 KB compressed, with the request body at 15.11 KB.
I thought the nature of this issue was rather fishy, hopefully we've reeled in the source of this issue & this uncaught error.
Thanks for the report. You may be hitting a payload dl limit with fish and mammals. Maybe try a smaller more compact species like a gecko lizard. Issue is synced and will get back to y'all on this.
I think it's the same situation as in #7448
When attempting to send 1x1 pixels https://upload.wikimedia.org/wikipedia/commons/c/ca/1x1.png, I can reach 66 pixels without issue, but 67 pixels returns:
In this case it has nothing to do with the size of the image. It entirely has to do with the size of the content in the JSON. We'll put a limit in here that produces a reasonable 400.
Also, why y'all gotta make more work for me ๐ฟ
We all say "thank you DV8" in complete unison