I own two VPS. On both I have the same system (Ubuntu) installed in the same version. I have installed Appwrite on both of them. I connect to the first one without any problem through the SDK for JavaScript. For the second one (Oracle Free Tier) I get a 401 (Unauthorized) error message. From the firewall in the Oracle management panel I have ports 80 and 443 added.
I am guessing that something might be wrong with the configuration of Oracle VPS (Oracle Free Tier).
Additionally:
- Both have a domain with a working certificate. I have access to the Appwrite admin panel
- I have two projects on the Oracle VPS: The first is a clean new project, the second is a migrated project from first VPS (both projects with a 401 error)
Would you please provide more detail and context on the error? What are you doing that's causing the error? What's the full error message?
The error appears every time you try to connect to Endpoint. When retrieving logged-in account data (GET), when trying to log in (POST).
I will add that I have a copy of the entire project on the other VPS and as soon as I set the endpoint to this VPS in the js file, everything works. I checked the settings of both projects in the Appwrite panel and they are identical.
I am sending a screenshot of the errors. The first one (GET) is called by: await account.get();
The second when trying to log in: await account.createEmailSession(email, password);
Also appears: AppwriteException: User (role: guests) missing scope (account) (also visible on screenshot)
so account.get() is failing because you're not logged in...and what's the response body for the account.createEmailSession()?
Invalid credentials.
Problem solved. For some reason, the user's password changed during the project migration. After resetting it from the Appwrite panel, everything works. Thank you for guiding me to the solution.
Fyi, passwords are encrypted using the openssl environment variable. If it's different between the environments, Appwrite won't be able to decrypt the password
I'm also assuming you manually inserted the SQL data into the new instance
variable _APP_OPENSSL_KEY_V1 is the same. Project was migrated using build-in migration tool in Appwrite 1.4.X
Check other account on both Appwrite instances. On the first password works, but on the second (migrated project) password doesn't work.
I deleted the entire project. I created new. I did the migration with the built-in tool once again. I double-checked that the _APP_OPENSSL_KEY_V1 variable is the same in both instances and the effect is the same. The password works on the original instance, but still doesn't work on the new one (migrated). I checked several accounts.
First Instance Appwrite Version: 1.4.1 Second: 1.4.3 Maybe that's the problem?
Maybe
Can I ask for some proven way to backup and restore Appwrite. Tomorrow I will try to upgrade from 1.4.1 -> 1.4.3, but I have an important project there and I need to be sure that the data is safe.
https://youtu.be/lM5yZEPtlvg?feature=shared
Make sure to test your backup
Ya, I think there's a bug with the passwords. I've created an issue here: https://github.com/appwrite/appwrite/issues/6303
I understand, so I will wait for the fix.
Question: is the problem in the source instance from which the project migrates? Or on the side of the target instance. This is important to me because it is safer for me to update only the target Appwrite instance.
Target
You can also migrate your users yourself by using the server sdk
This is good info for me.
Sounds interesting. I can wait for a fix, but I'd love to know how to do it.
Fetch all the users: https://appwrite.io/docs/server/users?sdk=nodejs-default#usersList
Then create in destination https://appwrite.io/docs/server/users?sdk=nodejs-default#usersCreateArgon2User
Thanks
Recommended threads
- self-hosted auth: /v1/account 404 on saf...
Project created in React/Next.js, Appwrite version 1.6.0. Authentication works in all browsers except Safari (ios), where an attempt to connect to {endpoint}/v1...
- Having issues with login via CLI
``` ~/appwrite appwrite login --endpoint https://localhost/v1 --verbose ? Enter your email myvalidemai...
- delete document problems
i don't know what's going on but i get an attribute "tournamentid" not found in the collection when i try to delet the document... but this is just the document...