aws-amplify / amplify-hosting

AWS Amplify Hosting provides a Git-based workflow for deploying and hosting fullstack serverless web applications.
https://aws.amazon.com/amplify/hosting/
Apache License 2.0
449 stars 113 forks source link

Amplify app build successfuly but dont deploy correctly. It's working perporly for long time. #2426

Closed MjdBh closed 2 years ago

MjdBh commented 2 years ago

Before opening, please confirm:

JavaScript Framework

React

Amplify APIs

GraphQL API

Amplify Categories

auth, storage, function, api

Environment information

``` # Put output below this line ``` System: OS: Linux 5.4 Linux Mint 20.2 (Uma) CPU: (8) x64 Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz Memory: 1.53 GB / 19.36 GB Container: Yes Shell: 5.0.17 - /bin/bash Binaries: Node: 14.16.0 - ~/.nvm/versions/node/v14.16.0/bin/node Yarn: 1.22.11 - ~/.nvm/versions/node/v14.16.0/bin/yarn npm: 6.14.11 - ~/.nvm/versions/node/v14.16.0/bin/npm Watchman: 20210801.210521.0 - /usr/local/bin/watchman Browsers: Chrome: 96.0.4664.45 Firefox: 94.0 npmPackages: @aws-amplify/api: ^3.2.24 => 3.2.30 @aws-amplify/cli: ^4.45.2 => 4.51.0 @aws-amplify/core: ^3.8.16 => 3.8.22 @babel/core: ^7.13.15 => 7.14.0 (7.9.0) @babel/plugin-proposal-class-properties: ^7.13.0 => 7.13.0 (7.8.3) @babel/preset-env: ^7.13.15 => 7.14.1 (7.9.0) @babel/preset-react: ^7.13.13 => 7.13.13 (7.9.1) @babel/runtime: ^7.13.9 => 7.14.0 (7.9.0) @date-io/date-fns: ^1.3.6 => 1.3.13 @material-ui/core: ^4.11.2 => 4.12.3 @material-ui/icons: ^4.11.2 => 4.11.2 @material-ui/lab: ^4.0.0-alpha.57 => 4.0.0-alpha.58 @material-ui/pickers: ^3.2.10 => 3.3.10 @material-ui/styles: ^4.10.0 => 4.11.4 amazon-chime-sdk-component-library-react: ^2.9.1 => 2.9.1 amazon-chime-sdk-js: ^2.16.1 => 2.16.1 ant-design-draggable-modal: 0.0.16 => 0.0.16 autosuggest-highlight: ^3.1.1 => 3.1.1 aws-amplify: ^3.3.21 => 3.3.27 aws-sdk: ^2.854.0 => 2.900.0 (2.785.0) axios: ^0.19.0 => 0.19.2 (0.21.1) axios-mock-adapter: ^1.17.0 => 1.19.0 babel-loader: ^8.2.2 => 8.2.2 (8.1.0) babel-polyfill: ^6.26.0 => 6.26.0 bulma: ^0.9.2 => 0.9.2 bulma-helpers: ^0.3.12 => 0.3.12 chart.js: ^2.9.4 => 2.9.4 classnames: ^2.2.6 => 2.3.1 clean-webpack-plugin: ^4.0.0-alpha.0 => 4.0.0-alpha.0 clsx: ^1.0.4 => 1.1.1 compress.js: ^1.1.2 => 1.1.2 copy-webpack-plugin: ^8.1.1 => 8.1.1 cross-env: ^5.2.0 => 5.2.1 css-loader: ^5.2.1 => 5.2.4 (3.4.2) cypress: ^7.3.0 => 7.3.0 date-fns: ^2.18.0 => 2.21.1 (1.30.1) downshift: ^3.2.10 => 3.4.8 echarts: ^4.2.1 => 4.9.0 echarts-for-react: ^2.0.15-beta.0 => 2.0.16 eslint-config-airbnb: ^18.2.1 => 18.2.1 eslint-config-prettier: ^8.3.0 => 8.3.0 eslint-plugin-cypress: ^2.11.3 => 2.11.3 eslint-plugin-import: ^2.22.1 => 2.22.1 (2.20.1) eslint-plugin-jsx-a11y: ^6.4.1 => 6.4.1 (6.2.3) eslint-plugin-prettier: ^3.4.0 => 3.4.0 eslint-plugin-react: ^7.21.5 => 7.23.2 (7.19.0) eslint-plugin-react-hooks: ^4.2.0 => 4.2.0 (1.7.0) file-loader: ^6.2.0 => 6.2.0 (4.3.0) gh-pages: ^2.1.1 => 2.2.0 graphql: ^15.4.0 => 15.5.0 (14.0.0, 14.7.0) graphql-tag: ^2.11.0 => 2.12.4 (2.10.1) history: ^4.10.0 => 4.10.1 html-webpack-plugin: ^5.3.1 => 5.3.1 (4.0.0-beta.11) lodash: ^4.17.15 => 4.17.21 (4.17.15, 4.17.20) material-design-icons: ^3.0.1 => 3.0.1 material-design-icons-iconfont: ^6.1.0 => 6.1.0 material-icons: ^0.5.3 => 0.5.5 material-ui-phone-number: ^2.2.6 => 2.2.6 memo-parser: 0.2.1 mini-css-extract-plugin: ^1.4.1 => 1.6.0 (0.9.0) moment: ^2.29.1 => 2.29.1 moment-timezone: ^0.5.33 => 0.5.33 (0.5.27) new-plugin-package: 1.0.0 node-sass: ^4.14.1 => 4.14.1 notistack: ^0.8.8 => 0.8.9 pdf-viewer-reactjs: ^2.1.2 => 2.2.3 prettier: 2.3.0 => 2.3.0 (1.19.1) prettier-eslint: ^12.0.0 => 12.0.0 (9.0.2) prettier-eslint-cli: ^5.0.0 => 5.0.1 prettier-plugin-apex: 1.9.1 => 1.9.1 prop-types: ^15.7.2 => 15.7.2 react: ^17.0.1 => 17.0.2 (16.14.0) react-autosuggest: ^9.4.3 => 9.4.3 react-beforeunload: ^2.5.2 => 2.5.2 react-big-calendar: ^0.30.0 => 0.30.0 react-chartjs-2: ^2.11.1 => 2.11.2 react-dom: ^16.13.1 => 16.14.0 react-draggable: ^4.4.3 => 4.4.3 react-helmet: ^5.2.1 => 5.2.1 react-highlight: ^0.12.0 => 0.12.0 react-idle-timer: ^4.6.4 => 4.6.4 react-jitsi: ^1.0.4 => 1.0.4 react-loadable: ^5.5.0 => 5.5.0 react-material-ui-form-validator: ^2.0.9 => 2.1.4 react-new-window: ^0.1.3 => 0.1.3 react-perfect-scrollbar: ^1.5.2 => 1.5.8 react-quill: ^1.3.3 => 1.3.5 react-redux: ^7.2.2 => 7.2.4 react-resizable: ^1.11.0 => 1.11.1 react-rnd: ^10.3.3 => 10.3.3 react-router-config: ^5.0.1 => 5.1.1 react-router-dom: ^5.2.0 => 5.2.0 react-scripts: ^3.4.1 => 3.4.4 react-select: ^3.0.4 => 3.2.0 react-vis: ^1.11.7 => 1.11.7 recharts: ^1.6.2 => 1.8.5 redux: ^4.0.4 => 4.1.0 redux-logger: ^3.0.6 => 3.0.6 redux-persist: ^6.0.0 => 6.0.0 redux-persist/integration/react: undefined () sass-loader: ^11.0.1 => 11.0.1 (8.0.2) shortid: ^2.2.14 => 2.2.16 style-loader: ^2.0.0 => 2.0.0 (0.23.1) styled-components: ^5.3.1 => 5.3.1 styled-components/macro: undefined () styled-components/native: undefined () styled-components/primitives: undefined () styled-system: ^5.1.5 => 5.1.5 swiper: ^4.5.0 => 4.5.1 webpack: ^5.32.0 => 5.36.2 (4.42.0) webpack-cli: ^4.6.0 => 4.6.0 webpack-dev-server: ^3.11.2 => 3.11.2 (3.11.0) npmGlobalPackages: @aws-amplify/cli: 7.5.4 @nestjs/cli: 8.1.4 aws-cdk: 1.132.0 create-js-project: 1.0.0 expo-cli: 4.5.2 ffmpeg-concat: 1.3.3 generator-jhipster-react-native: 4.2.0 generator-jhipster: 7.1.0 gtop: 1.1.1 npm: 6.14.11 react-native-cli: 2.0.1 serve: 12.0.1 typescript: 4.4.4 yarn: 1.22.11

Describe the bug

Our application is a react web application.it was working properly. I another branch from the main branch we applied Nextjs so all branch's environment deploys failed. We rolled back this branch and deleted it but didn't fixed it. We cleared deploy and build cache also created a new environment but didn't resolve it.

Expected behavior

After a successful build, it should deploy correctly.

Reproduction steps

You can redeploy a failed deploy in the build history.

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": "ca-central-1", "aws_cognito_identity_pool_id": "ca-central-1:8eb165f8-534b-4542-892b-f620cfc79f8b", "aws_cognito_region": "ca-central-1", "aws_user_pools_id": "ca-central-1_upEtyW5jh", "aws_user_pools_web_client_id": "5of3ee07dfinqeohhg6vkdd6cb", "oauth": {}, "aws_cognito_login_mechanisms": [ "PREFERRED_USERNAME" ], "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": "vidkids-new100528-stage", "aws_user_files_s3_bucket_region": "ca-central-1", "aws_appsync_graphqlEndpoint": "https://jklasb3lqvgejftrccq6aguxx4.appsync-api.ca-central-1.amazonaws.com/graphql", "aws_appsync_region": "ca-central-1", "aws_appsync_authenticationType": "AMAZON_COGNITO_USER_POOLS", "aws_cloud_logic_custom": [ { "name": "VidkidsFilesApi", "endpoint": "https://kpmroqicea.execute-api.ca-central-1.amazonaws.com/stage", "region": "ca-central-1" } ] };

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

2021-11-30T20:15:30 [INFO]: Beginning deployment for application dmzn15fe65z58, branch:main, buildId 0000000044 2021-11-30T20:15:30 [INFO]: Cannot find any generated SSR resources to deploy. If you intend for your app to be SSR, please check your app Service Role permissions. Otherwise, please check out our docs on how to setup your app to be detected as SSG (https://docs.aws.amazon.com/amplify/latest/userguide/server-side-rendering-amplify.html#deploy-nextjs-app) 2021-11-30T20:15:30 [ERROR]: {"code":"7","message":"No ssrResources.json file"}

chrisbonifacio commented 2 years ago

Hi @MjdBh 👋 thank you for raising this issue. I'm going to transfer this issue over to the console repo because it has more to do with deployment than the javascript library and for better support in that knowledge area.

github-actions[bot] commented 2 years ago

Hi :wave:, thanks for opening! While we look into this...

If this issue is related to custom domains, be sure to check the custom domains troubleshooting guide to see if that helps. Also, there is a more general troubleshooting FAQ that may be helpful for other questions.

Lastly, please make sure you've specified the App ID and Region in the issue!

ghost commented 2 years ago

Hi @MjdBh 👋🏽 Can you check your build settings to make sure the baseDirectory is set to build? If it's set to .next or out then Amplify will treat your app as an SSR app which can cause deployment to fail if your application isn't SSR.

MjdBh commented 2 years ago

HI, @hloriana thank you for your response. Yes, the base directory is correct. we rolled back any changes and didn't change the main branch. But all environment deploy failed.

ghost commented 2 years ago

@MjdBh try following this FAQ guide to change from SSR to SSG: https://github.com/aws-amplify/amplify-console/blob/main/FAQ.md#convert-an-ssr-app-to-ssg. It should tell Amplify to build a static site and not look for SSR resources to generate.

MjdBh commented 2 years ago

The problem is it. We didn't change this env to SSR. we tested on other environments and another branch why why our main branch has this issue.

ghost commented 2 years ago

@MjdBh what is your AppID and region?

MjdBh commented 2 years ago

@hloriana my region is ca-central and AppID is dmzn15fe65z58.

shubhadip commented 2 years ago

@MjdBh what was the solution, even i am facing this issue.

MjdBh commented 2 years ago

@shubhadip I used the following command and it worked for me.

aws amplify update-app --app-id --platform WEB --region

github-actions[bot] commented 1 year ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.