#Project with the requested ID could not be found. Please check the X-Appwrite-Project header.

16 messages · Page 1 of 1 (latest)

sullen agate
#

Fairly new to appwrite and running on svelte via the sdk.
Just wanna use the gitlab oauth provider with my gitlab instance and getting the error above.
Just checked all the necessary id's in my env file and there are all correct. GitLab oauth also working fine. Only the api complains.
Am i missing something in the configurations below?

const server = {
  endpoint: import.meta.env.VITE_APP_ENDPOINT.toString(),
  project: import.meta.env.VITE_APP_PROJECT.toString(),
  collection: import.meta.env.VITE_APP_COLLECTION_ID.toString(),
  database: import.meta.env.VITE_APP_DATABASE_ID.toString(),
};

const client = new Appwrite();
const account = new Account(client);
const database = new Databases(client);
client.setEndpoint(server.endpoint).setProject(server.project);
For login:
await sdk.account.createOAuth2Session("gitlab", "http://example.com/", "https://example.com/login", [ "openid", "profile", "email" ]);

The same goes also for oidc login with keycloak as a provider.

I would appreciate some smarter head than mine.

violet gulch
#

Hi, you say there is an error, could you tell me what error it is?

#

Oh I see, in the title

#

Sorry, I hadn't seen, your environment variables probably didn't go well. Did you try to print the import.meta.env.VITE_APP_PROJECT variable?

sullen agate
#

I did, i also for "test purposes" hard coded them directly, but same as above

violet gulch
#

On the appwrite interface, a project does exist?

sullen agate
#

Sure

violet gulch
#

Maybe you used the project name instead of the id?

sullen agate
#

Triple checked all ids an d also re-created the project

violet gulch
#

:')

sullen agate
#

Also set custom ids

violet gulch
#

Okay okay, very strange

#

This is a bit off topic but, what is the purpose of [ "openid", "profile", "email" ] when creating the session?

sullen agate
#

Nothing in particular, just added it after same error.

#

I mean those scopes should also be the default one

violet gulch
#

Yes it's true I forgot the scopes lol