expo fetch:android:keystore returns "There is no valid Keystore defined for this app"

I have an android project. I have allowed expo to manage the upload keys and app signing keys, and building via expo build:android -t app-bundle. Up to this point, the builds and uploads to google play store have worked fine. This morning I upgraded expo-cli from 3.21.5 to 3.21.9, and it couldn’t find my android keystore. It gave me the message asking if I wanted expo to manage the keystore again. When I downgraded expo-cli back to v3.21.5, I was able to build and upload to google play. However, I decided it would be a good idea to back up the keystore locally. That is when I ran into an error.
expo fetch:android:keystore returns “There is no valid Keystore defined for this app”.
How in the world is the build and upload to google play working if there is no valid keystore, and how do I get my keystore out of expo so that I can have a backup?

Expo CLI 3.21.5 environment info:
System:
OS: macOS 10.15.3
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.16.0 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.5 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
IDEs:
Xcode: 11.5/11E608c - /usr/bin/xcodebuild
npmPackages:
expo: ^36.0.0 => 36.0.2
react: 16.9.0 => 16.9.0
react-dom: 16.9.0 => 16.9.0
react-native: https://github.com/expo/react-native/archive/sdk-36.0.1.tar.gz => 0.61.4
react-native-web: ^0.11.7 => 0.11.7
npmGlobalPackages:
expo-cli: 3.21.5

Dou you have the owner field in your app.json? If yes is it set to matthewforeman or some other team?
It’s possible that you have permission to build, but not read credentials.

Can you try 3.21.8 ?

Even if there is a bug on our side your credentials should be safe, as long as you don’t use --clear-credentials

It gave me the message asking if I wanted expo to manage the keystore again

Do not select that option, it can override existing keystore

Ok I just checked in db and I see that you built the same app both on your account and with owner set to different team/user.

If you want to download keystore assigned to @matthewforeman/yourapp then remove owner field or set it to your username
If you want to download keystore assigned to @other_user/yourapp then make sure you have correct permissions for that. I’m not 100% sure if fetching credentials is supported with teams, so it’s possible that only owner can do that.

Thanks! It didn’t occur to me that team accounts would only allow the owner to fetch the keystore, especially considering it allowed me to create the keystore in the first place. the owner upgraded me to admin, but that didn’t fix it. The only way we were able to get the keys was to have the account owner do it.

the owner upgraded me to admin, but that didn’t fix it

Yes endpoint we switched to in the latest version of expo-cli didn’t support teams, I added quickfix for just one endpoint that downloads keystore from the server (it’s merged, but I’m not sure if is released to prod), so build command should work ok, but you won’t be able to build a new app or clear credentials for existing ones. All those operations should work correctly in a few days.