Skip to content
Back

Cannot create function from CLI with KEY

  • 0
  • Self Hosted
  • Functions
Ibaraki Douji
25 Jul, 2025, 20:56

I tried to setup a gitlab CI that push functions from an appwrite.json, tho when doing a first push it fails saying it needs a session. Tho it does create the function but without a domain. And if i relaunch the CI, it can deploy without issues.

After looking at the cli sdk i saw that it came from this : https://github.com/appwrite/sdk-for-cli/blob/master/lib/commands/push.js#L1490

TypeScript
try {
  const variables = await consoleVariables({ parseOutput: false, sdk: await sdkForConsole() });
  domain = ID.unique() + '.' + variables['_APP_DOMAIN_FUNCTIONS'];
} catch (error) {
  console.error('Error fetching console variables.');
  throw error;
}

and i suspect that the sdkForConsole needs a session but the key doesn't have one.

Maybe as a fix, it could be nice to have an option like --no-domain or to just warn instead of completely stop the deployement.

TL;DR
Developers are encountering issues creating functions from CLI due to a required session that the key doesn't have. A possible fix could be adding an option like `--no-domain` or a warning instead of halting deployment.
Ibaraki Douji
25 Jul, 2025, 20:57

and also yes the function is created inside the CI, as the ID is manually generated with a npm command and put in the appwrite.json before the first main push

Ibaraki Douji
25 Jul, 2025, 20:59

and i don't really want to create a console user for the gitlab CI

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