-
Notifications
You must be signed in to change notification settings - Fork 4.4k
databases.php collection not found #7341
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
Conversation
…ection-not-found � Conflicts: � app/controllers/api/databases.php � composer.lock
…ection-not-found � Conflicts: � composer.lock
app/controllers/general.php
Outdated
->inject('project') | ||
->action(function (Document $project) { | ||
if ($project->getId() === 'console') { | ||
throw new Exception(Exception::PROJECT_RESERVED_PROJECT, 'Please check X-Appwrite-Project header'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This error is not good enough. It assumes the consumer context is the API but ignores SDKs or console where the consumer has no idea what this error is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gewenyu99 Any input for a message here? This is the case when the project is set as console
, and you're calling an unsupported API like databases, functions etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Questions here:
- Can I name my project ID
console
? We shouldn't allow this during creation. - Could this ever display on the console?
Either way:
[What went wrong][why we think it went wrong][steps to debug/fix]
We can try:
This endpoint is not available for the
console project. The Appwrite Console is a reserved project ID and cannot be used with the Appwrite SDKs and APIs. Please check if your project ID is correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- You can not name a project ID console, it's disallowed during creation.
- This happens in 99% when a user does not assign the X-Appwrite-Project header , We are the ones who fallback to console project
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@fogelito We should throw a separate error for when project ID is not assigned. Is that possible?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If console:
This endpoint is not available for the console project. The Appwrite Console is a reserved project ID and cannot be used with the Appwrite SDKs and APIs. Please check if your project ID is correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@abnegate Sound good?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good to me. @eldadfux?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- The console project is something internal, a normal dev using Appwrite has no idea what it is and its very confusing.
- We shouldn't mention
x-appwrite-project
just like that, this header is only visible to REST users, which are minority if we do mention the context should be clear and the first thing mention should be setting the project ID. We can also skip the header name altogether.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
-
@eldadfux We have two errors now. IF they get an error that mentions console, they have it set as their project. IMO this is fine.
-
We can do: No Appwrite project was specified. Please specify your Appwrite Project ID on your Appwrite SDK Client.
Also, are we getting |
@eldadfux Yep we are defaulting to console here: https://github.com/appwrite/appwrite/blob/main/app/init.php#L1233-L1235 |
Co-authored-by: Jake Barnby <jakeb994@gmail.com>
Co-authored-by: Jake Barnby <jakeb994@gmail.com>
Fix Collection not found 500
In the Error I saw the projectId = "console". so perhaps we can disable console project in the API?
Fixes: #6166