Back

Uncaught Appwrite\\AppwriteException: HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)

  • 0
  • Self Hosted
  • Storage
Binyamin
9 Jun, 2023, 14:53

Make sure you're allowing the txt extension in your Bucket settings.

TL;DR
Summary: The user is experiencing an error (`Uncaught Appwrite\AppwriteException: HTTP/2 stream 0 was not closed cleanly: PROTOCOL_ERROR (err 1)`) while downloading files using the Appwrite dashboard and PHP and Python SDKs. Removing the `Content-type: application/json` header solves the issue. The user suspects it could be related to a Cloudflare tunnel problem. They are running Appwrite with Docker Compose and have seen abnormal worker exits in the logs. There are also some errors related to file uploads, such as 0-byte files with the name "data://" and occasional upload errors. The user
ideclon
9 Jun, 2023, 14:54

That was it - thank you!

ideclon
9 Jun, 2023, 15:50

Well, I spoke too soon - the first error (HTTP/2 stream 0 was not closed cleanly) is back

ideclon
9 Jun, 2023, 16:18

Sometimes the same file will upload one time and error another time

ideclon
9 Jun, 2023, 16:22

Also, sometimes the upload seems to work, but the uploaded file is 0 bytes, and says the filename is "data://"

ideclon
9 Jun, 2023, 16:22

It's detected the correct mime-type, though

ideclon
9 Jun, 2023, 17:29

I'm checking the Appwrite logs to see if there's anything useful there. There's nothing at the time I make a request, but I did find a lot of these:

TypeScript
[Error] Timestamp: 2023-06-09T17:17:07+00:00
[Error] Type: Utopia\Exception
[Error] Message: Not Found
[Error] File: /usr/src/code/vendor/utopia-php/framework/src/App.php
[Error] Line: 795
Drake
9 Jun, 2023, 17:30

something seems to be closing the connection...maybe it's cloudflare...maybe it's appwrite πŸ€·πŸΌβ€β™‚οΈ

ideclon
9 Jun, 2023, 17:30

And also this:

TypeScript
[2023-06-09 15:13:47 $9.0]    WARNING    Server::check_worker_exit_status(): worker(pid=12, id=0) abnormal exit, status=0, signal=11
A bug occurred in Swoole-v4.8.10, please report it.
The Swoole developers probably don't know about it,
and unless you report it, chances are it won't be fixed.
You can read How to report a bug doc before submitting any bug reports:
>> https://github.com/swoole/swoole-src/blob/master/.github/ISSUE.md 
Please do not send bug reports in the mailing list or personal letters.
The issue page is also suitable to submit feature requests.

OS: Linux 5.15.83-1-pve #1 SMP PVE 5.15.83-1 (2022-12-15T00:00Z) x86_64
GCC_VERSION: 10.3.1 20211027
OPENSSL_VERSION: OpenSSL 1.1.1t  7 Feb 2023
PHP_VERSION : 8.0.18

Worker 1 started successfully
ideclon
9 Jun, 2023, 17:30

Will try connecting directly

Drake
9 Jun, 2023, 17:39

i've seen this when i try to use XDebug πŸ‘€ you're not running from source, right?

ideclon
9 Jun, 2023, 17:40

Not sure what you mean by that - this is just a PHP webpage

ideclon
9 Jun, 2023, 17:40

Oh that - that's from docker compose logs

ideclon
9 Jun, 2023, 17:43

Seems to work perfectly when I point directly.

Drake
9 Jun, 2023, 18:00

I meant running Appwrite from source

Drake
9 Jun, 2023, 18:00

It must be cloudflare closing the connection form some reason

ideclon
9 Jun, 2023, 18:00

I'm running Appwrite with docker compose - I installed with the docker run command on the self hosting page

ideclon
9 Jun, 2023, 18:01
TypeScript
    --volume /var/run/docker.sock:/var/run/docker.sock \
    --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
    --entrypoint="install" \
    appwrite/appwrite:1.3.6```
Drake
9 Jun, 2023, 18:11

Ah okay. It must be a cloudflare tunnel problem then

ideclon
9 Jun, 2023, 18:19

Well, uploads are working. But when I tried downloading (with $storage->getFileDownload(), I just get what looks like a base64 string?

ideclon
9 Jun, 2023, 18:20

I had a look at the getFileDownload() function, and I saw it sets a Content-type: application/json header. When I remove that, I get back the file.

Drake
9 Jun, 2023, 18:27

oh that does sound like a bug

ideclon
9 Jun, 2023, 18:38

Can confirm it's also in the Python SDK

ideclon
12 Jun, 2023, 20:41

Also, when I download a file direct from the Appwrite dashboard, I get what looks like the same base64 string. The request from the dashboard does not contain a Content-type: application/json header

Drake
12 Jun, 2023, 20:50

it might be best to create issues for this: 1 for the php sdk and another for the python sdk

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more