aws-amplify / amplify-cli

The AWS Amplify CLI is a toolchain for simplifying serverless web and mobile development.
Apache License 2.0
2.83k stars 823 forks source link

New env added was created without storage (s3) and with Pinpoint Analytics disabled #13818

Closed joshuamoreno1 closed 5 months ago

joshuamoreno1 commented 5 months ago

How did you install the Amplify CLI?

npm

If applicable, what version of Node.js are you using?

No response

Amplify CLI Version

12.12.2

What operating system are you using?

Mac

Did you make any manual changes to the cloud resources managed by Amplify? Please describe the changes made.

No manual changes made

Describe the bug

I have a project named nock with a dev environment with Storage (S3) and Pinpoint Analytics Active. image

S3 Bucket created:

image

But today I created a prod env with amplify env add. All works fine in command line but in AWS did not create a stack to s3 bucket.

image

image

When I try to add again in new environment it fails:

image

If I made "amplify status" in commnad line, all I get is "No Changes"

image

I have problems also with Pinpoint Analytics, is not working and dev project is configured well, but prod not working. Dev active: image

Prod disabled: image

On debug console i got these error:

#9      main.<anonymous closure>.<anonymous closure> (package:nock/main.dart:43:7)
<asynchronous suspension>
flutter: ConfigurationError
flutter: ConfigurationError {
  "message": "No Storage S3 plugin config detected."
}
flutter: #0      AmplifyAnalyticsPinpointDart._ensureConfigured (package:amplify_analytics_pinpoint_dart/src/analytics_plugin_impl.dart:51:7)
#1      AmplifyAnalyticsPinpointDart.recordEvent (package:amplify_analytics_pinpoint_dart/src/analytics_plugin_impl.dart:218:5)
#2      AnalyticsCategory.recordEvent.<anonymous closure> (package:amplify_core/src/category/amplify_analytics_category.dart:20:29)
#3      _rootRun (dart:async/zone.dart:1399:13)
#4      _CustomZone.run (dart:async/zone.dart:1301:19)
#5      _runZoned (dart:async/zone.dart:1804:10)
#6      runZoned (dart:async/zone.dart:1747:10)
#7      identifyCall (package:amplify_core/src/http/amplify_category_method.dart:147:10)
#8      AnalyticsCategory.recordEvent (package:amplify_core/src/category/amplify_analytics_category.dart:18:64)
#9      AnalyticsPinpointImpl.recordScreen (package:nock/infraestructure/amplify/analytics_pinpoint_impl.dart:8:29)
#10     AnalyticsMixin.sendAnalyticsScreenView (package:nock/ui/tools/mixins/analytics_mix<…>
flutter: ConfigurationError
flutter: ConfigurationError {
  "message": "Analytics not configured",
  "recoverySuggestion": "Please make sure to call: await Amplify.configure(amplifyconfig)"
}

Another things like cognito, graphql api, dynamodb tables and lambda functions works well.

Expected behavior

When Ones creates a new amplifyenvironment storage and analytics project must to be created sucessfull.

Reproduction steps

  1. Create and amplify project with storage and pintpoint analytics
  2. Create a new environment

Project Identifier

3df5115b5daa14eb94ef9b42a1064c90

Log output

``` # Put your logs below this line ```

Additional information

No response

Before submitting, please confirm:

joshuamoreno1 commented 5 months ago

Hi there!, Any update? I have not be able to deploy production environment for my app.

ykethan commented 5 months ago

Hey @joshuamoreno1, to confirm in the projects backend-config.json and team-provider-info.json file do you observe references to the resource. In the prod env on running amplify pull, does amplify status show the storage resource? Does amplify update storage throw any errors?

joshuamoreno1 commented 5 months ago

Hi there,

Yes, there are references:

team-provider-info.json:

Dev: image Prod: image

backend-config.json

image

But when I run amplify pull on prod env all works almost well but i see these error:

Error: File at path: '/Users/dev/projects/nock/amplify/backend/storage/nockstorage/parameters.json' does not exist

image

And when I run amplify status: all is No change

image

And when i run amplify update storage, I get an error similar to the first one

image
joshuamoreno1 commented 5 months ago

I was trying to fix it running amplify env checkout dev then amplify pull , copy the next file with differences:

File deleted: image

image

And then run amplify push override but i get No changes

image

joshuamoreno1 commented 5 months ago

Hi,

I removed storage in prod env, then add new storage, run amplify push, and all woking.

Its weird have to remove, but is now working well,

Thanks,

github-actions[bot] commented 5 months ago

This issue is now closed. Comments on closed issues are hard for our team to see. If you need more assistance, please open a new issue that references this one.