-
Notifications
You must be signed in to change notification settings - Fork 30
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
🐛 Bug Report: appwrite cli logout automatically #110
Comments
@StarZeus, thanks for creating this issue! 🙏🏼 I just tried this and I can get my project for both attempts. Would you please check and make sure:
|
@stnguyen90 - Thank you for looking into this. To add clarity.
Also, I noticed that the ~/.appwrite/pref.json updated with cookies |
The appwrite url is |
It's replaced with an empty string? The only time that would happen is either:
Maybe you have something between the CLI and Appwrite messing up the cookies? |
Does this happen with other commands like |
It happens for all command. I'm not logged out from appwrite web console. Thats stays logged in. After every command the a_session_console_legacy and domain are not in cookie anymore. "cookie": "route=b1c61a93f68b5c389187caa649ee5027; Expires=Mon, 30-Oct-23 17:02:35 GMT; Max-Age=172800; Path=/(.*); Secure; HttpOnly" |
Very bizarre...Would you be able to curl Appwrite to see the full request? Something like: ENDPOINT="https://[YOUR_HOSTNAME]/v1"
# Sign in (make sure to replace [YOUR_EMAIL] and [YOUR_PASSWORD]
curl -s -k -v -b console-cookies.txt -c console-cookies.txt "$ENDPOINT/account/sessions/email" \
-H 'content-type: application/json' \
-H 'x-appwrite-project: console' \
--data-raw '{"email":"[YOUR_EMAIL]","password":"[YOUR_PASSWORD]"}' \
--compressed \
--insecure
# List projects
curl -s -k -v -b console-cookies.txt -c console-cookies.txt "$ENDPOINT/projects" \
-H 'content-type: application/json' \
-H 'x-appwrite-project: console' \
--compressed \
--insecure |
@StarZeus, have you had a chance to try the commands I suggested. Btw, I'll need to close this soon due to inactivity. |
I'll try the above curl command and post an update |
@stnguyen90 - I was able to execute above curl commands. I can see project details returning even when I hit the 2nd curl repeatedly. |
What is this you shared? This doesn't look like what Appwrite would typically respond. It seems there's something else that is passing back additional cookies...And since the CLI only grabs the first |
I am running appwrite in kubernetes cluster. "route" is the Sticky/Affinity cookie set by the nginx ingress controller so that subsequent requests are sent to the same container. Is there a reason why the cli captures only the first cookie? |
Below change to capture all cookies from response fixes my problem. I'll be raising a PR
|
Raised PR #104 |
@StarZeus, thanks for creating this PR. Would you please create the PR to target our repo instead of your forked master branch? |
@stnguyen90 - I have raised a new PR targeting appwrite repo. |
👟 Reproduction steps
appwrite login
command and console user id and passwordRegardless of what command we execute 2nd time onwards the command fails as the user is not logged in anymore
👍 Expected behavior
appwrite cli should stay logged in until logout
👎 Actual Behavior
appwrite cli logout automatically after each command
🎲 Appwrite version
Version 1.4.x
💻 Operating system
Linux
🧱 Your Environment
Appwrite version 1.4.7 installed on kubernetes v1.20
[email protected] installed on mac os Monterey
👀 Have you spent some time to check if this issue has been raised before?
🏢 Have you read the Code of Conduct?
The text was updated successfully, but these errors were encountered: