Repository navigation
Description
👟 Reproduction steps
- Self-host Appwrite 2.7.4 with an S3-compatible provider (VK Cloud Object Storage,
hb.ru-msk.vkcloud-storage.ru):_APP_STORAGE_DEVICE=s3 _APP_STORAGE_S3_ENDPOINT=https://hb.ru-msk.vkcloud-storage.ru _APP_STORAGE_S3_BUCKET=<bucket> _APP_STORAGE_S3_REGION=ru-msk _APP_EXECUTOR_CONNECTION_STORAGE=s3://<key>:<secret>@hb.ru-msk.vkcloud-storage.ru/?region=ru-msk - Upload any file to a bucket (
POST /v1/storage/buckets/{bucketId}/files), or create a function deployment so the executor stores the build output.
👍 Expected behavior
The file is uploaded and the build is stored.
👎 Actual behavior
The request fails with Utopia\Storage\Exception\RemoteException: Failed to decode S3 XML response. The object is in fact written to the bucket; only the response handling fails.
The provider answers a successful single-part PUT like this:
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: 0
S3::call() treats any application/xml response as XML and decodes it:
// packages/storage/src/Device/S3.php (2.7.4, line 1241-1246)
$isXml = $contentType === 'application/xml' || (str_starts_with($responseBody, '<?xml') && $contentType !== 'image/svg+xml');
return new S3\Response(
code: $code,
headers: $responseHeaders,
body: $decode && $isXml ? $this->decodeXml($responseBody) : $responseBody,
);For an empty body, decodeXml('') throws because simplexml_load_string('') returns false. The same code is in utopia-php/storage 4.4.0, which openruntimes/executor:1.3.7 bundles, so function builds fail as well. The code is unchanged on main as of 2026-11-24.
Stack trace (executor, while storing a build):
Utopia\Storage\Exception\RemoteException: Failed to decode S3 XML response
#0 vendor/utopia-php/storage/src/Device/S3.php(965): Utopia\Storage\Device\S3->decodeXml('')
...
Utopia\Storage\Device\S3->write(...)
Utopia\Storage\Device->copy(...)
Suggested fix
Skip decoding when the body is empty:
body: $decode && $isXml && $responseBody !== '' ? $this->decodeXml($responseBody) : $responseBody,We applied this one-line change locally, mounted into the appwrite/appwrite services and the executor. Single-part and multipart uploads and downloads now work against VK Cloud Object Storage.
🎲 Appwrite version
Version 2.7.4 (self-hosted). Executor: openruntimes/executor:1.3.7. Upgraded from 1.9.6, which did not have this problem.
💻 Operating system
Linux (Ubuntu 22.04, Docker).
🧱 Your Environment
- Storage: VK Cloud Object Storage (S3-compatible, path-style).
- Database: MongoDB 8.2.5.
Related, possibly worth a separate issue
Content-Encoding: aws-chunkedon stored objects. Objects uploaded by Appwrite 1.9.6 to the same provider were stored withContent-Encoding: aws-chunked; the provider keeps the header, unlike AWS. The new HTTP client in executor 1.3.7 lets curl decode responses, and curl fails on those objects withUnrecognized content encoding type. We removed the header from existing build/source objects with an in-place copy (x-amz-metadata-directive: REPLACE)._APP_CONSOLE_DOMAINdropped on upgrade.upgradedrops_APP_CONSOLE_DOMAINfrom.envbecause it is not inapp/config/variables.php. The generateddocker-compose.ymlstill uses it in the Traefik console router rules (Host(\${_APP_CONSOLE_DOMAIN:-localhost}`)`) and passes it to several services, so a console on its own domain stops being routed after an upgrade unless the variable is re-added by hand.
👀 Have you spent some time to check if this issue has been raised before?
- I checked and didn't find similar issue
🏢 Have you read the Code of Conduct?
- I have read the Code of Conduct
Activity