8000 🐛 Bug Report: Digital Ocean Spaces and Upload a file · Issue #6259 · appwrite/appwrite · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

🐛 Bug Report: Digital Ocean Spaces and Upload a file #6259

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
2 tasks done
xuelink opened this issue Sep 15, 2023 · 6 comments
Closed
2 tasks done

🐛 Bug Report: Digital Ocean Spaces and Upload a file #6259

xuelink opened this issue Sep 15, 2023 · 6 comments
Assignees
Labels
bug Something isn't working product / storage Fixes and upgrades for the Appwrite Storage.

Comments

@xuelink
Copy link
Contributor
xuelink commented Sep 15, 2023

👟 Reproduction steps

When i use Digital Ocean Spaces and upload any file i am getting an error when i tried to open uploaded link in digital ocean spaces.

Firstly it uploads private not a public but only manually i can change from digitalocean dashboard.

Secondly even if i make it public, i cant open my file because getting following error.

Thirdly, i cannot get any link from digitalocan spaces, im getting only local link.

The image "https://************nge.ams3.digitaloceanspaces.com/storage/uploads/app-***************3f32a/****************e49/****************9348.png" cannot be displaved because it contains errors.

Note: all .env file configured well, i can write Digital Ocean Spaces as well.

👍 Expected behavior

It has to work as expected, getting link and i can open link when i will have permission

👎 Actual Behavior

All images i can see with my local link.
But in Digital ocean spaces i see thi error message.

The image "https://************nge.ams3.digitaloceanspaces.com/storage/uploads/app-***************3f32a/****************e49/****************9348.png" cannot be displaved because it contains errors.

🎲 Appwrite version

Version 1.3.x

💻 Operating system

Linux

🧱 Your Environment

I use oneclick installed appwrite from marketplace of Digital Ocean

Version 1.3.8
OS Ubuntu 22.04

No Firewall
No security rules
No filters

👀 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?

@xuelink xuelink added the bug Something isn't working label Sep 15, 2023
@stnguyen90
Copy link
Contributor

@behicsakar, thanks for opening this issue! 🙏 it's expected that the file is private. You should be accessing the file through Appwrite since it may be encrypted and/or compressed.

@xuelink
Copy link
Contributor Author
xuelink commented Sep 17, 2023

@stnguyen90 Yeah, unfortunately it does not work as expected. i upgraded 1.4.2 by manually installing w/ docker container but it still does not work.

It uploads files to DO Spaces without any warning. However, i cannot open any file in DO or direct link or anywhere. Image link shows me that it cannot be displaved because it contains errors.

@stnguyen90 stnguyen90 self-assigned this Sep 19, 2023
@stnguyen90 stnguyen90 added the product / storage Fixes and upgrades for the Appwrite Storage. label Sep 19, 2023
@stnguyen90
Copy link
Contributor

@behicsakar How are you uploading the file? Can you see the file in the Appwrite Console?

@xuelink
Copy link
Contributor Author
xuelink commented Sep 19, 2023

@stnguyen90
I am uploading file from appwrite console.

Let me tell the issue step by step with quick demo for this issue how its happening.

1- Created a DO droplet in ams3
2- Created a DO space in ams3 as well
3- Created Digital Ocean Api -> Spaces Keys
4- Connected droplet with ssh, installed docker and docker-compose by their manuel
5- install appwrite with a single docker command self-hosting which is

docker run -it --rm \
    --volume /var/run/docker.sock:/var/run/docker.sock \
    --volume "$(pwd)"/appwrite:/usr/src/code/appwrite:rw \
    --entrypoint="install" \
    appwrite/appwrite:1.4.3

6- Copied step3 DO Space Keys to related line in .env file.

_APP_STORAGE_DO_SPACES_ACCESS_KEY=DO00W842J7VAAM3EL9B8
_APP_STORAGE_DO_SPACES_SECRET=DEyYZqD6R0QFGFh68CtuOlsJ1xQU0CAM6/hpAvQPEXU
_APP_STORAGE_DO_SPACES_REGION=ams3
_APP_STORAGE_DO_SPACES_BUCKET=appwrite-issue6359

7- Also changed next 10000 line in .env as shown in docs local to dospaces

_APP_STORAGE_DEVICE=dospaces

8- Save it and run next command.

docker compose up -d --remove-orphans

9- Everything should work fine. Logged in console, created a project, created a bucket, and create a file, choose a file then create.
Screenshot 2023-09-19 at 15 21 39

10- when i click the File URL: https://db.example.com/v1/storage/buckets/650991d14f324a692ac9/files/6509924117279aeb2300/view?project=650750d21e4a6a589be3&mode=admin

11- Open DO Spaces, you can see the file as well.

Screenshot 2023-09-19 at 15 23 24

12- Try to open it directly from DO Spaces URL, it shows me

<Error>
<Code>AccessDenied</Code>
<Message/>
<BucketName>appwrite-issue6359</BucketName>
<RequestId>tx00000cda47f751ec91a3e-00650992df-46c0811f-ams3c</RequestId>
<HostId>46c0811f-ams3c-ams3-zg03</HostId>
</Error>

13- OK, i will give manuel permission to file in DO Spaces. Made it public permission.

Screenshot 2023-09-19 at 15 25 13 Screenshot 2023-09-19 at 15 25 18

14- Try to open this file again from DO Spaces link. Getting following message inside DO create a jpeg.
Screenshot 2023-09-19 at 15 26 43

15- Appwrite Docker Response
docker compose exec appwrite doctor

  __   ____  ____  _  _  ____  __  ____  ____     __  __
 / _\ (  _ \(  _ \/ )( \(  _ \(  )(_  _)(  __)   (  )/  \
/    \ ) __/ ) __/\ /\ / )   / )(   )(   ) _)  _  )((  O )
\_/\_/(__)  (__)  (_/\_)(__\_)(__) (__) (____)(_)(__)\__/

👩‍⚕️ Running Appwrite Doctor for version 1.4.2 ...

[Settings]
🟢 Hostname has a public suffix (db.example.com)
🟢 CNAME target has a public suffix (db.example.com)
🟢 Using a unique secret key for encryption
🟢 App environment is set for production
🟢 Abuse protection is enabled
🟢 Console access limits are enabled
🟢 HTTPS force option is enabled
🔴 Logging adapter is disabled

[Connectivity]
🟢 Console.DB(console)...............................connected
🟢 Projects.DB(database_db_main).....................connected
🟢 Cache(cache_redis_main)...........................connected
🟢 Queue(queue)......................................connected
🟢 PubSub(pubsub)....................................connected
🔴 SMTP...........................................disconnected

[Volumes]
🟢 Uploads Volume is readable
🟢 Uploads Volume is writeable
🟢 Cache Volume is readable
🟢 Cache Volume is writeable
🟢 Config Volume is readable
🟢 Config Volume is writeable
🟢 Certs Volume is readable
🟢 Certs Volume is writeable

[Disk Space]
🟢 Uploads Volume has 44.19GB free space (14.74% used)
🟢 Cache Volume has 44.19GB free space (14.74% used)
🟢 Config Volume has 44.19GB free space (14.74% used)
🟢 Certs Volume has 44.19GB free space (14.74% used)

Failed to check for a newer version

As you see, i tried to examine everything from beginning, but i cant access a file in digitalocean.

@stnguyen90
Copy link
Contributor

i cant access a file in digitalocean

@behicsakar, as I mentioned before, this is expected. You should not be accessing the file outside of Appwrite because the file may be compressed and/or encrypted.

@xuelink
Copy link
Contributor Author
xuelink commented Sep 21, 2023

i cant access a file in digitalocean

@behicsakar, as I mentioned before, this is expected. You should not be accessing the file outside of Appwrite because the file may be compressed and/or encrypted.

@stnguyen90 To clear my mind, i am asking one last thing, then im gonna close this issue.
So, does it mean, the url that appwrite console giving to me, it uses Digital Ocean Spaces and this url fetches data from the DO storage. Is it right ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working product / storage Fixes and upgrades for the Appwrite Storage.
Projects
None yet
Development

No branches or pull requests

2 participants
0