When using API to attach a file when too small for cloud storage, it will still try to get the new attachment from cloud storage generating an error
Categories
(bugzilla.mozilla.org :: API, defect)
Tracking
()
People
(Reporter: dkl, Assigned: dkl)
Details
Attachments
(1 file)
Currently BMO is configured to store any attachments smaller than 20k bytes in the DB directly and anything over that goes into GCP cloud storage. When using the REST API to create an attachment, if the attachment is under 20k then it is stored in the DB properly. But the return JSON to the client looks like:
{
"code" => 68000,
"documentation" => "https://bmo.readthedocs.io/en/latest/api/",
"error" => bless( do{\(my $o = 1)}, 'JSON::PP::Boolean' ),
"message" => "Failed to fetch key 9356883 from network storage: Not Found"
}
Normally the add attachment endpoint will return a JSON object containing the newly created attachment which explains why it is trying to fetch it back. But it should not be trying to get it from cloud storage in this case and get the data from the DB. So something is wrong where the code is still thinking it is cloud based attachment.
If you attach something larger than 20k or I lower the limit to something very small like 2, then the error disappears and the data returned looks correct.
Will investigate more
Comment 1•7 months ago
|
||
Assignee | ||
Comment 2•7 months ago
|
||
Description
•