aws-amplify / amplify-studio

AWS Amplify Studio (Formerly Admin UI)
136 stars 31 forks source link

Amplify Admin UI show credential error #311

Open Joshua-Zhang-S opened 3 years ago

Joshua-Zhang-S commented 3 years ago

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 commented 3 years ago

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

siegerts commented 3 years ago

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

yppartyk commented 2 years ago

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

indiejoseph commented 2 years ago

Why closed? any solution now?

indiejoseph commented 2 years ago

Fixed this issue by disable and re-enable Amplify studio

clintfoster commented 2 years ago

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.

swaminator commented 2 years ago

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

yppartyk commented 2 years ago

@clintfoster what is your app ID and region?

clintfoster commented 2 years ago

@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.

johnpc commented 2 years ago

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 commented 2 years ago

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.

clintfoster commented 2 years ago

@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.

CoderUni commented 1 year ago

@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 :)

louielyl commented 8 months ago

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!

thevangelist commented 3 weeks ago

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