amplify-studio icon indicating copy to clipboard operation
amplify-studio copied to clipboard

Amplify Admin UI show credential error

Open Joshua-Zhang-S opened this issue 3 years ago • 15 comments

Before opening, please confirm:

App Id

d3ja25qdvvobwd

Region

us-west-2

Amplify Console feature

Environment variables

Describe the bug

Tried to open admin ui console from cli/link from amplify console, the error showed: An error occurred while fetching the app backend: Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1

Expected behavior

Show admin ui

Reproduction steps

Either from amplify console or click on link in the amplify console

Build Settings

No response

Additional information

No response

Joshua-Zhang-S avatar Aug 20 '21 23:08 Joshua-Zhang-S

Tried many options. Finally it showed me login page so I can use the invited user to get in.

Joshua-Zhang-S avatar Aug 21 '21 19:08 Joshua-Zhang-S

Hi :wave:, thanks for raising. I'm going to transfer to the Admin UI repo to get some more eyes on it.

siegerts avatar Aug 31 '21 16:08 siegerts

Thank you for reaching out. We are looking at this issue now.

yppartyk avatar Dec 03 '21 20:12 yppartyk

Why closed? any solution now?

indiejoseph avatar Dec 13 '21 09:12 indiejoseph

Fixed this issue by disable and re-enable Amplify studio

indiejoseph avatar Dec 13 '21 13:12 indiejoseph

I just ran into the same issue. I enabled Amplify Studio for the first time and invited one of my email addresses, granting "Full access".

I received the invitation email, clicked the link and was prompted for email, temporary password and new password. Then it showed an initial screen. I selected the option to manage models (I forget the exact name). Then a blank screen loaded with the following message:

An error occurred while fetching the app backend: Missing credentials in config, if using AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1

In case it matters, my web browser is Chrome 99.0.4844.51 and I'm on MacOS 12.2.1.

clintfoster avatar Mar 16 '22 14:03 clintfoster

@clintfoster are you using Studio with an existing app or a new one?

swaminator avatar Mar 16 '22 16:03 swaminator

@clintfoster what is your app ID and region?

yppartyk avatar Mar 16 '22 16:03 yppartyk

@swaminator It's an existing app that I re-created from scratch recently (via the CLI) while working around another issue. I can create it again in Amplify Studio if it will provide a benefit like avoiding legacy baggage brought over from the CLI (if any). However, my schemas are in separate files, and I don't think AS supports that yet, per my comment in aws-amplify/amplify-adminui#317 about Setup -> Data not showing my schemas.

@yppartyk The appId is d1o4lgqajf4ob6 in us-west-2.

clintfoster avatar Mar 17 '22 15:03 clintfoster

I've also confirmed a workaround - you can go to you Amplify console, visit the "App Settings: Amplify Studio settings" page, and disable and re-enable the "Enable Amplify Studio" toggle.

See related: https://github.com/aws-amplify/amplify-adminui/issues/580

johnpc avatar Jul 05 '22 21:07 johnpc

Actually taking another look over this ticket, there may be something different might be going on here. Is this consistently reproducible for you @clintfoster? I haven't been able to reproduce it without manually mucking with my Cognito resources.

johnpc avatar Jul 07 '22 14:07 johnpc

@johnpc I haven't tried Amplify Studio in quite some time. We use the CLI, except for managing connected branches, which we've been doing via the standard Amplify Admin console (since it seems to be the only way to share one backend between multiple frontends since you can't run amplify add hosting as you would with a single BE & FE in one project).

I tried Amplify Studio again just now as a test: From the standard Amplify console there is a "Launch Studio" button that I clicked (which is the scenario in the original reporter's description). It correctly launched Amplify Studio with an account icon in the upper right indicating I was signed in as an admin. As I recall, the account is actually client token-based (using Cognito under the covers) unlike the other consoles that use IAM credentials. Anyway, it apparently worked for the client account I set up some time ago. I did not get a blank screen and I did not have to explicitly login again.

I did not try to repro the scenario that I reported as a comment in this issue, which was during initial client signup when I clicked the email link and entered my temporary & new passwords, at which time I got a blank screen.

I have a recollection that sometimes the CLI will launch Amplify Studio (or some other browser app) for commands that I must not use very often. I think I may have seen the blank screen problem in that scenario too (possibly cleared by refreshing). I guess it is doing some kind of dance to pass a client token to the CLI.

clintfoster avatar Jul 07 '22 16:07 clintfoster

@johnpc The workaround of disabling and re-enabling amplify studio doesn't seem to work anymore. I tried it multiple times and even tried creating a new amplify project. One of my project's region is ap-southeast-1 and the appId is d1ns89ylf85fwv. Not sure what's wrong but thank you for your help :)

CoderUni avatar Oct 04 '22 13:10 CoderUni

Fixed this issue by disable and re-enable Amplify studio

I came to this post because I cleaned up my Cognito's Identity Pools and User Pools, by re-enabling Amplify Studio it is restored, thank you!

louielyl avatar Dec 31 '23 11:12 louielyl

To help all the fellow developers stumbling onto this.

Disabling and enabling Amplify Studio was not the culprit for me. As years had passed, I always forgot how and where to manage the users correctly, when the customer asked for help. I naively thought, that Amplify is just a facade for Cognito.

TLDR: Do not manage your Amplify Backend users from Cognito. Manage the users from the correct place.

Amplify > All apps > [Your app] > Backend environments > Manage environments > Amplify Studio settings > Access Control settings > Invite users

Using Cognito to manage the backend users will result in that weird environment error: AWS_CONFIG_FILE, set AWS_SDK_LOAD_CONFIG=1

thevangelist avatar Aug 22 '24 08:08 thevangelist