Skip to content
Back

Unable to push function from API KEY with CLI

  • 0
  • 1
  • Functions
9 Jul, 2026, 11:51

When trying to push functions from Gitlab CI (with an API KEY and using the CLI), i saw that i was unable to push functions.

TypeScript
$ appwrite client --endpoint $APPWRITE_ENDPOINT --project-id $APPWRITE_PROJECT_ID --key $APPWRITE_API_KEY
Success: Client configuration updated
$ appwrite push functions --function-id $APPWRITE_FUNCTION_ID --force --activate true
Info: Validating functions ...
Info: Checking for changes ...
Info: Pushing functions ...
Info: For detailed error pass the --verbose or --report flag
Error: Session not found. Please run `appwrite login` to create a session

Is it something that you stopped supporing or is it a bug ?

Looking at the code, it seams like the push function uses the ConsoleService for checking proxies rules :

TL;DR
Unable to push functions with API KEY using CLI due to a 'Session not found' error. This might be a bug in the SDK relating to the way it handles proxies and authentication. Possible fixes could include adding an option for the proxy part, skipping the proxy part for API KEY authentication, or ensuring that API keys with proxy scopes are properly implemented.
9 Jul, 2026, 11:53

As a fix, maybe :

  • when pushing functions/site to add an option for the proxy part (like a --with-proxies)
  • just skip that proxy part if it's an API KEY
  • or since i saw in the console, that the API keys have proxy scopes, to fix it and don't use the ConsoleService
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