10000 🐛 Bug Report: ListDocuments() w/ Older SDK Returns 401 · Issue #3504 · appwrite/appwrite · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

🐛 Bug Report: ListDocuments() w/ Older SDK Returns 401 #3504

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
stnguyen90 opened this issue Jul 5, 2022 · 3 comments
Closed
2 tasks done

🐛 Bug Report: ListDocuments() w/ Older SDK Returns 401 #3504

stnguyen90 opened this issue Jul 5, 2022 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@stnguyen90
Copy link
Contributor
stnguyen90 commented Jul 5, 2022

👟 Reproduction steps

  1. Have a database with id = default and a collection within that database
  2. Make a GET /v1/database/collections/<collection id>/documents request

👍 Expected behavior

Appwrite should be backwards compatible and still work.

👎 Actual Behavior

Error response:

{
    "message": "User (role: guest) missing scope (collections.read)",
    "code": 401,
    "type": "general_unauthorized_scope",
    "version": "0.15.1"
}

Appwrite docker log:

appwrite  | [Error] Timestamp: 2022-07-05T21:40:58+00:00
appwrite  | [Error] Method: GET
appwrite  | [Error] URL: /v1/databases/:databaseId/collections/:collectionId/usage
appwrite  | [Error] Type: Appwrite\Extend\Exception
appwrite  | [Error] Message: User (role: guest) missing scope (collections.read)
appwrite  | [Error] File: /usr/src/code/app/controllers/general.php
appwrite  | [Error] Line: 319

It looks like there's a problem with the usage alias:

->alias('/v1/database/collections/:collectionId/documents', ['databaseId' => 'default'])

🎲 Appwrite version

Version 0.15.x

💻 Operating system

Linux

🧱 Your Environment

No response

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

@ghost
Copy link
ghost commented Aug 7, 2022

Unfortunately, I am still getting a similar error, but for a different route;

appwrite_1                      | [Error] Timestamp: 2022-08-07T15:27:32+00:00
appwrite_1                      | [Error] Method: GET
appwrite_1                      | [Error] URL: /v1/databases/:databaseId/collections
appwrite_1                      | [Error] Type: Appwrite\Extend\Exception
appwrite_1                      | [Error] Message: foo@bar.com (role: member) missing scope (collections.read)
appwrite_1                      | [Error] File: /usr/src/code/app/controllers/general.php
appwrite_1                      | [Error] Line: 319

and the HTTP response 401;

{
    "message": "foo@bar.com (role: member) missing scope (collections.read)",
    "code": 401,
    "type": "general_unauthorized_scope",
    "version": "0.15.3"
}

I am using the client JavaScript SDK appwrite@9.0.1 and Docker image version 0.15.3

@stnguyen90
Copy link
Contributor Author

@methodman7556, the endpoint you're hitting is /v1/databases/:databaseId/collections which doesn't seem like the list documents endpoint. Can you share your code and a stack trace?

@ghost
Copy link
ghost commented Aug 7, 2022

@stnguyen90 no need. It was a mistake from my side. Incorrect usage of the client SDK. I am sorry. Everything works fine 😄

Sorry, something went wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant
0