Why are different Fauna databases displayed in the dashboard than are created via the CLI?

Viewed 115

I have authenticated with Fauna in two ways -

  • Logging into the site, which takes you to your dashboard
  • Using the CLI - fauna cloud-login

Given that I've logged into both using the same email/password combination, I would expect that they would show the same databases, but it looks like they are somehow scoped as if they are entirely different. Is this expected? Is there something that I'm missing?

Screenshots of database lists via web UI and CLI's fauna list-databases, respectively -

Fauna web dashboard

CLI list-databases

There is nothing in the docs that indicates that this behavior is expected. I'm stumped.

2 Answers

You are right, this doesn't appear to be working as expected.

Is your login to the dashboard with Github or Netlify? The shell does not currently support login with Github/Netlify. In this case, you will need to go to the dashboard, create a key for your database, and use that key to login to the shell instead of username/password.

If that is not the case, or otherwise does not help solve things for you, then you can send an email (from the one that you used to create the account) to support@fauna.com with the details of your issue.

I've cracked it. I'm not sure if there are any bugs involved, or if I just don't really understand the auth system, but

First, when you sign in to either the UI or the shell, it seems to revoke your (root?) key for the other one. Logging out and back in to the other will refresh your view there.

Second, this revocation is only for the applicable domain/region group you signed into. In the case of the UI this is all of them, while in the case of the shell, this is always 'Classic' (I tried fauna cloud-login --domain db.us.fauna.com but doesn't seem to work - ~/.fauna-shell still shows domain=db.fauna.com and the key is valid for Classic). This means you are still logged into the dashboard, but all of the 'Classic' databases disappear from view.

Third, while in the state mentioned above, you are able to create a new database in the US or EU region group, but not Classic (attempting will result in this error). You then remain logged into the shell with the Classic databases listed, and logged into the UI but having your Classic access revoked.

You're now seeing what I saw - fauna list-databases shows all databases in the Classic region group, while the dashboard UI shows all databases NOT in the Classic region group.

Logging out and back into the site will result in all databases being shown. Logging back into the shell will only ever show the Classic region group databases.

** Edit ** Attempting to login to a region group:

bash-3.2$ fauna version
fauna-shell/0.12.4 darwin-x64 node-v16.1.0
bash-3.2$ fauna cloud-login --domain=db.us.fauna.com
For email login, ...<truncated>

Email or secret key: <email>
Password: ***************
The 'cloud' endpoint already exists. Overwrite? [y/n]: y
bash-3.2$ fauna list-databases --domain=db.us.fauna.com
 ›   Error: Could not Connect to https://db.us.fauna.com Unauthorized Secret
bash-3.2$ fauna list-databases
listing databases
tsukiyomi
Related