2

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 Answers2

1

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.

ptpaterson
  • 9,131
  • 4
  • 26
  • 40
1

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
  • 1
    The shell should work with region groups (--domain should work now) since it was updated a few days ago. Can you install the latest version and try to login to the different endpoints now? – ptpaterson Jul 20 '21 at 15:57
  • 1
    The experience of logging in to the shell and/or dashboard and it invalidating the other's keys is a bug in the experience, and it is being actively worked on. To be clear, the invalidation is working as intended. But the way it presents to you once it happens is indeed confusing/misleading. – ptpaterson Jul 20 '21 at 15:58
  • @ptpaterson I've updated the question with the result of attempting to login to the US region group. – Josiah Gore Jul 21 '21 at 16:16
  • 1
    My mistake, the github repository has been updated, but the npm package has not been published with the changes yet. See this pull request: https://github.com/fauna/fauna-shell/pull/106 – ptpaterson Jul 22 '21 at 14:17