Skip to content
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 push amplify backend on existing environnement #14080

Open
3 tasks done
domov44 opened this issue Jan 25, 2025 · 2 comments
Open
3 tasks done

cannot push amplify backend on existing environnement #14080

domov44 opened this issue Jan 25, 2025 · 2 comments
Labels
pending-response Issue is pending response from the issue author pending-triage Issue is pending triage platform-push Issues related to `amplify push`

Comments

@domov44
Copy link

domov44 commented Jan 25, 2025

Before opening, please confirm:

JavaScript Framework

Next.js

Amplify APIs

GraphQL API, REST API

Amplify Version

v6

Amplify Categories

api, auth, storage, function

Backend

Amplify CLI

Environment information

# Put output below this line

System:
    OS: Windows 11 10.0.22631
    CPU: (8) x64 Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz
    Memory: 363.64 MB / 7.84 GB
  Binaries:
    Node: 20.10.0 - D:\nodejs\node.EXE
    npm: 10.8.1 - D:\nodejs\npm.CMD
  Browsers:
    Edge: Chromium (127.0.2651.74)
    Internet Explorer: 11.0.22621.3527
  npmPackages:
    @aws-amplify/storage: ^6.0.20 => 6.7.1
    @aws-amplify/storage/internals:  undefined ()
    @aws-amplify/storage/s3:  undefined ()
    @aws-amplify/storage/s3/server:  undefined ()
    @aws-amplify/storage/server:  undefined ()
    @aws-amplify/ui-react: ^6.1.6 => 6.1.6
    @aws-amplify/ui-react-internal:  undefined ()
    @babel/plugin-proposal-private-property-in-object: ^7.21.11 => 7.21.11 (7.21.0-placeholder-for-preset-env.2)
    @cypress/angular:  0.0.0-development
    @cypress/angular-signals:  0.0.0-development
    @cypress/mount-utils:  0.0.0-development
    @cypress/react:  0.0.0-development
    @cypress/react18:  0.0.0-development
    @cypress/svelte:  0.0.0-development
    @cypress/vue:  0.0.0-development
    @cypress/vue2:  0.0.0-development
    @testing-library/jest-dom: ^5.17.0 => 5.17.0
    @testing-library/react: ^13.4.0 => 13.4.0
    @testing-library/user-event: ^13.5.0 => 13.5.0
    aws-amplify: ^6.10.0 => 6.10.0
    aws-amplify/adapter-core:  undefined ()
    aws-amplify/analytics:  undefined ()
    aws-amplify/analytics/kinesis:  undefined ()
    aws-amplify/analytics/kinesis-firehose:  undefined ()
    aws-amplify/analytics/personalize:  undefined ()
    aws-amplify/analytics/pinpoint:  undefined ()
    aws-amplify/api:  undefined ()
    aws-amplify/api/server:  undefined ()
    aws-amplify/auth:  undefined ()
    aws-amplify/auth/cognito:  undefined ()
    aws-amplify/auth/cognito/server:  undefined ()
    aws-amplify/auth/enable-oauth-listener:  undefined ()
    aws-amplify/auth/server:  undefined ()
    aws-amplify/data:  undefined ()
    aws-amplify/data/server:  undefined ()
    aws-amplify/datastore:  undefined ()
    aws-amplify/in-app-messaging:  undefined ()
    aws-amplify/in-app-messaging/pinpoint:  undefined ()
    aws-amplify/push-notifications:  undefined ()
    aws-amplify/push-notifications/pinpoint:  undefined ()
    aws-amplify/storage:  undefined ()
    aws-amplify/storage/s3:  undefined ()
    aws-amplify/storage/s3/server:  undefined ()
    aws-amplify/storage/server:  undefined ()
    aws-amplify/utils:  undefined ()
    aws-sdk: ^2.1692.0 => 2.1692.0
    babel-plugin-styled-components: ^2.1.4 => 2.1.4
    chance: ^1.1.11 => 1.1.11
    cypress: ^13.14.2 => 13.14.2
    dotenv: ^16.4.5 => 16.4.5 (10.0.0)
    file-saver: ^2.0.5 => 2.0.5
    gsap: ^3.12.5 => 3.12.5
    jspdf: ^2.5.2 => 2.5.2
    jspdf-autotable: ^3.8.3 => 3.8.3
    lottie-react: ^2.4.0 => 2.4.0
    react: ^18.3.1 => 18.3.1
    react-content-loader: ^6.2.1 => 6.2.1
    react-content-loader/native:  undefined ()
    react-dom: ^18.3.1 => 18.3.1
    react-icons: ^5.3.0 => 5.3.0
    react-router-dom: ^7.0.1 => 7.0.1
    react-scripts: ^5.0.1 => 5.0.1
    react-toastify: ^10.0.6 => 10.0.6
    styled-components: ^6.1.13 => 6.1.13
    styled-components/native:  undefined ()
    web-vitals: ^4.2.4 => 4.2.4
    xlsx: ^0.18.5 => 0.18.5
  npmGlobalPackages:
    @aws-amplify/cli: 12.12.1
    @nestjs/cli: 10.4.5
    @vue/cli: 5.0.8
    eas-cli: 9.1.0
    expo-cli: 6.3.10
    firebase-tools: 13.1.0
    npm: 10.8.1
    sequelize-cli: 6.6.2


Describe the bug

Hi, i have an amplify project deployed with 2 environments, “production” and “develop”, i modified my project by creating a new local environment “test” i changed some things (graphql model, add a rest api with lambdas, and environment variables for my lambda linked to the rest api)

Everything works, so once I'm done, via the CLI I switch to “develop” and delete my “test” environment. I commit and push to github etc., at build time I get the error that my environment variables are not declared.

Image

I came across this documentation: https://docs.amplify.aws/gen1/nextjs/build-a-backend/functions/environment-variables/

I apply what is requested, amplify push but I get an error that I can't resolve

Image

I'm thinking that the error comes from what I've done, but if I create with the CLI an environment and do amplify push, it works.

Expected behavior

I would like to know how I can debug my errors, and if possible why this only happens with an existing environment?

Reproduction steps

Idk ? thats the problem.

Code Snippet

// Put your code below this line.

Log output

// Put your logs below this line


aws-exports.js

/* eslint-disable */
// WARNING: DO NOT EDIT. This file is automatically generated by AWS Amplify. It will be overwritten.

const awsmobile = {
    "aws_project_region": "eu-west-3",
    "aws_appsync_graphqlEndpoint": "https://7of4h543uvgftjmeidoros2rou.appsync-api.eu-west-3.amazonaws.com/graphql",
    "aws_appsync_region": "eu-west-3",
    "aws_appsync_authenticationType": "AMAZON_COGNITO_USER_POOLS",
    "aws_appsync_apiKey": "da2-rpjcynupsvcsfpgzak45swwv7a",
    "aws_cognito_identity_pool_id": "eu-west-3:97e62872-96dd-4537-809e-5d87a8f1742f",
    "aws_cognito_region": "eu-west-3",
    "aws_user_pools_id": "eu-west-3_TGwVzrYUy",
    "aws_user_pools_web_client_id": "114642t8t42h155ahv5uglhj1j",
    "oauth": {},
    "aws_cognito_username_attributes": [],
    "aws_cognito_social_providers": [],
    "aws_cognito_signup_attributes": [
        "EMAIL"
    ],
    "aws_cognito_mfa_configuration": "OFF",
    "aws_cognito_mfa_types": [
        "SMS"
    ],
    "aws_cognito_password_protection_settings": {
        "passwordPolicyMinLength": 8,
        "passwordPolicyCharacters": []
    },
    "aws_cognito_verification_mechanisms": [
        "EMAIL"
    ],
    "aws_user_files_s3_bucket": "recipesappea0631f8364f439bb0004d59ea016d09140900-develop",
    "aws_user_files_s3_bucket_region": "eu-west-3"
};


export default awsmobile;

Manual configuration

No response

Additional configuration

No response

Mobile Device

No response

Mobile Operating System

No response

Mobile Browser

No response

Mobile Browser Version

No response

Additional information and screenshots

No response

@github-actions github-actions bot added the pending-triage Issue is pending triage label Jan 25, 2025
@Samaritan1011001
Copy link
Member

Samaritan1011001 commented Jan 28, 2025

Hi @domov44, thank you for opening the issue and the details on it. I believe this belongs to Amplify CLI, I will have someone transfer this over so they can best assist you.

@Samaritan1011001 Samaritan1011001 transferred this issue from aws-amplify/amplify-js Jan 28, 2025
@ykethan
Copy link
Member

ykethan commented Jan 28, 2025

Hey @domov44, thank you for reaching the error appears to be occurring on the API nested stack. On the CloudFormation console, with view nested option enabled, could you then search for apirecipesapp in the Filter by stack name search bar. You could then try clicking on the detect root cause button or scroll through the list of events and status reason which should provide us additional information on failure.
additionally, were there any errors thrown on the amplify push after the function env variables were updated?

@ykethan ykethan added pending-response Issue is pending response from the issue author platform-push Issues related to `amplify push` labels Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending-response Issue is pending response from the issue author pending-triage Issue is pending triage platform-push Issues related to `amplify push`
Projects
None yet
Development

No branches or pull requests

3 participants