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

46 messages · Page 1 of 1 (latest)

violet spire
#

I'm trying to put a PHP upload into a Storage bucket, and I'm getting this error:

Here's my code:

$storage->createFile('[MY_BUCKET_ID]', '[MY_FILE_ID], Appwrite\InputFile::withData(file_get_contents($_FILES['[UPLOAD_FIELD_NAME]']['tmp_name'])));
smoky ocean
violet spire
#

v1.3.6

smoky ocean
open dawn
violet spire
open dawn
#

I mean where the PHP code runs
On your computer?

#

Or as Appwrite function?

violet spire
open dawn
#

Okay, is your tunnel is pointing to HTTP or HTTPS?

violet spire
open dawn
#

So first, change it also to be HTTPS internally

#

Then, When it is HTTPS can you try again?

violet spire
violet spire
#

So, I decided to try simplifying. I created a testfile.txt with one line of random text, then did:

$storage->createFile('[MY_BUCKET_ID]', 'test-file', Appwrite\InputFile::withPath('testfile.txt'))

Error:
PHP Fatal error: Uncaught Appwrite\\AppwriteException: File extension not allowed

open dawn
#

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

violet spire
violet spire
#

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

violet spire
#

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

#

It's detected the correct mime-type, though

violet spire
#

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:

[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
smoky ocean
violet spire
# violet spire I'm checking the Appwrite logs to see if there's anything useful there. There's ...

And also this:

[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
smoky ocean
violet spire
violet spire
violet spire
smoky ocean
smoky ocean
violet spire
#
    --volume /var/run/docker.sock:/var/run/docker.sock \
    --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
    --entrypoint="install" \
    appwrite/appwrite:1.3.6```
smoky ocean
violet spire
#

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

#

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.

violet spire
violet spire
# smoky ocean oh that does sound like a bug

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