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.
$ 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 :
- https://github.com/appwrite/sdk-for-cli/blob/22.3.0/lib/commands/push.ts#L827
- https://github.com/appwrite/sdk-for-cli/blob/master/lib/commands/init.ts#L388
- https://github.com/appwrite/sdk-for-cli/blob/master/lib/sdks.ts#L89
which means the SDK for console have
requireAuthtotrueand so require either an access token OR a cookie.
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
Recommended threads
- Appwrite Functions not executing with a ...
I have multiple functions running with a CRON Job however, they all stopped executing around 35 mins ago from this post. Project ID:6a4a03920012bede992d Region:...
- Deployment fails at sidecar step "Build ...
Hi Appwrite team, I'm getting a consistent deployment failure on Appwrite Cloud. The build itself completes successfully, but a post-build sidecar step then fa...
- Can't create or update functions via CLI...
Self-hosted 1.9.5 — all function create/update return 500: Unknown attribute: "providerBranches" (metadata ↔ physical-column desync after upgrade) Env: Appwrit...