Back

[SOLVED] "Document not found" error even tho the document is there

  • 0
  • Databases
  • Web
manazo
26 Sep, 2023, 12:58

Yes i am. but why should it matter? i'm logged in to the user account in the server side

TL;DR
Title: [SOLVED] "Document not found" error even though the document is there Solution: The issue was caused by the login being done on the server side, while the Appwrite SDK was making requests from the client side. Manually hitting the endpoint from the server side solved the problem. Unresolved issues: 1. Keeping the permission as "Any" may cause security issues. The user wants only registered users to be able to read the documents. 2. The user has a relationship attribute under the document they are trying to read, but it is showing an empty array.
๐ŸœUdon๐Ÿœ
26 Sep, 2023, 12:58

What are your collection permissions for what you're trying to access

manazo
26 Sep, 2023, 12:59

my collection permission lets all users read the documents

Drake
26 Sep, 2023, 13:00

What exactly are your permissions? Any or users?

๐ŸœUdon๐Ÿœ
26 Sep, 2023, 13:00

Making any read doesn't fix it?

manazo
26 Sep, 2023, 13:00

Users

Drake
26 Sep, 2023, 13:01

Try this

manazo
26 Sep, 2023, 13:01

let me give it a try

manazo
26 Sep, 2023, 13:10

it works now. but I've two new problems

  1. Keeping the permission as "Any" will cause security issues. I only want my registered users to read the documents
  2. I've got a relationship attribute under the document I'm trying to read, which is not empty. I get all the data in the result, but the relationship attribute. it's showing an empty array there
๐ŸœUdon๐Ÿœ
26 Sep, 2023, 13:14

If you can read it with any, then I think what Steven said about you not being correctly logged in might be the case

Guille
26 Sep, 2023, 22:05

If any is working, it could mean you aren't login in ssr, can you give us more information about how are you login your user in the server?

manazo
27 Sep, 2023, 20:16

sorry for the late everyone. so you were correct. my login was done on the server side. so all the cookies and stuff were stored on the server side. and Appwrite SDK makes requests from the client side. so what worked for me is to hit the endpoint manually from the server side

manazo
27 Sep, 2023, 20:16

Thanks for the help everyone<3

manazo
27 Sep, 2023, 20:17

[SOLVED] "Document not found" error even tho the document is there

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