-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot launch Amplify Studio: A valid backend environment was not specified #1068
Comments
Hey @stephenjen, thank you for reaching out. |
Hi @ykethan , I'm seeing this issue on at this url: https://ap-northeast-2.admin.amplifyapp.com/admin/d22yyxv6tcw0zy/dev/data-manager#, below: ![]() On Firefox's debug console I see a bunch of warnings and one error: ![]() |
@stephenjen did you try disabling and re-enabling studio? similar to steps in: docs.amplify.aws/console/adminui/access-management/#troubleshooting |
Sorry. Yes, I did, before posting this issue. |
Hey @stephenjen, thank you for the confirmation. From the error message in the error message in the screenshot does seem to be occurring on the cli.json file. the file should be similar to
|
Hi @ykethan, the bucket does not contain a studio-backend folder: ![]() But I do have a cli-inputs.json on local: ![]() |
Hey @stephenjen, the screeenshot shows the bucket created by the storage category. There should be another bucket similar to |
Hey @stephenjen, interesting. The bucket gets created when we create a amplify backend using Amplify CLI or Studio. |
Hi @ykethan, do you mean run it outside of my project or inside an empty folder within my project? |
@stephenjen outside your existing project directory, wanted to ensure if you are able to pull the projects backend. |
@stephenjen could you disable studio on the AWS Amplify console then re-run the pull command it should use the AWS profile to pull the project. |
Ok. I created a new Flutter project and ran Here the new cli.json:
|
Hey @stephenjen, if you are unable to find the bucket, could you replace
additioanlly, in the account do you not see any S3 bucket names that starts with as if the bucket contains folder like private, public or protected it an storage resource created by |
I did the above and was able to access Studio after re-enabling it, though I'm still missing the -deployment bucket and the DynamoDB tables in Studio are all empty.
My app is still updating the DynamoDB that is accessible from AWS Console, but this isn't appearing in Studio. How can I get them using the same account? Thanks. |
I should have been more clear - what can I do to make sure Studio is pointed to the same place as my app and AWS Console? |
Both AWS Console > my_app and Amplify Studio seem to be pointing to the same app, but while AWS Console > my_app shows data, Amplify Studio is empty. |
Hi @stephenjen - it definitely looks like there's drift between the s3 bucket for your app and the deployed state of your resources. If you update your data model via CLI and run Can you try that and let me know if it helps? |
Hi @johnpc, because the app is still in development, I'm frequently (maybe a 2-3 times a week) updating the data model, running |
I see. In order to debug this, I'll need some more information. It's important to note that the Amplify Studio interface is driven by calls to the AmplifyBackend sdk, which in turn reads configuration from files in your S3 bucket. So to debug, let's take a look at these s3 files and AmplifyBackend sdk responses. First, find your S3 bucketFirst, you will need to find your app's S3 bucket. You can find it by running the AWS CLI like this:
The bucket will be named with your app name and environment name in it - the above will grep for your environment name Once you find your bucket name (like
Then lets open this directory in your code editor so we can see everything. Understand S3 Bucket ContentsYour S3 bucket contains a number of directories, but lets focus for now on the First let's look at
This explains your first problem. The contents of Second, lets look at
These files drive the response from the SDK command:
These are the proximate cause of your issue in the "Data Modeling" and "Manage Content" tab of Studio. Check these files and ensure they are set to the proper values that you expect, and that the values from the
I cannot be certain how your bucket got into its invalid state, but hopefully this information helps find more information or get things back in order. |
Hi @johnpc, I'm getting When I run Does the fact that my app is updating rectangles<random-number>-dev and not amplify-rectangles-dev-<random-number>-deployment a possible source of problems? The directories you mentioned are in amplify-rectangles-dev-<random-number>-deployment but not in rectangles<random-number>-dev. Thanks again. |
It is not a problem that you have two buckets. One of those buckets ( The other bucket is the bucket we're talking about - Getting the AWS CLI working properly will help debug the problem in your bucket's state. You can follow https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html to update your aws cli version as well as find troubleshooting instructions for AWS CLI. Since we're still just exploring and understanding this bucket, lets only run the aws commands that read the bucket ( |
@johnpc Thanks again for the informative, detail reply. Much appreciated. Let me provide some updates: I was able to sync the local bucket folder to aws deployment directories and check the modelIntrospection.json, schema.graphql and schema.js files. The schema.graphql synced from S3 is identical to local at app_name/amplify/backend/api/amplifyDatasourceDev/schema.graphql, and there was nothing obviously wrong with the other two files. I then changed the local schema.graphql by removing all models and then adding a simple test model with just an ID and a string field, codegen'ed and pushed the update to AWS. I looked at the newly generated modelIntrospection.json, schema.graphql and schema.js files and they seem to properly reflect the update Then I added two new item to the model, one using AWS Console and the other using Amplify Studio, and even with this simple test model the issue still remains - the item added through AWS Console isn't visible through Amplify Studio and vice versa. |
Hi @johnpc, Everything's back to working! After your latest feedback I tested how creating an item manually through AWS Console differs from creating an item manually through Studio, and sure enough, creating through the Console does not create createdAt and updatedAt fields, however, these fields were created and populated automatically when going through Studio. I also noticed the item created through Studio was visible through Console. Then I deleted these records and loaded items through my app, and now both Console and Studio are in sync and items are visible in both. So to trace my last couple actions:
Hope the above help to narrow down the issue. |
Awesome! Thanks for that summary! I'll close this out - feel free to reopen or cut a new issue if you have trouble with anything else! |
|
Before opening, please confirm:
App Id
d22yyxv6tcw0zy
Region
ap-northeast-2
Environment name
rectangles
Figma File Version (if applicable)
No response
Amplify CLI Version
No response
If applicable, what version of Node.js are you using?
v17.5.0
What operating system are you using?
MacOS Sonoma
Browser type?
Safari and Firefox
Describe the bug
My Amplify Studio all of as sudden stopped working. When I access it from the browser, I get the following info message: A valid backend environment was not specified. There's a dropdown with one option, dev, but selecting it bring me to the same message.
Expected behavior
Amplify Studio to load in browser
Reproduction steps
Project Identifier
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: