aws-amplify / aws-amplify/amplify-hosting

Deploy is stuck when frontend is skipped

Open
#3,711 0 comments 0 reactions 0 assignees View on GitHub
pending-triage
Dominant language
Dockerfile
Stars
481
Forks
123
PR merge metrics
No merged PRs in 30d

Description

### Before opening, please confirm:

- [X] I have checked to see if my question is addressed in the [FAQ](https://github.com/aws-amplify/amplify-hosting/blob/master/FAQ.md).
- [X] I have [searched for duplicate or closed issues](https://github.com/aws-amplify/amplify-hosting/issues?q=is%3Aissue+).
- [X] I have read the guide for [submitting bug reports](https://github.com/aws-amplify/amplify-hosting/blob/master/CONTRIBUTING.md).
- [X] I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
- [X] I have removed any sensitive information from my code snippets and submission.

### App Id

https://ap-east-1.console.aws.amazon.com/amplify/home?region=ap-east-1#/d35bsvaicfsnob/pr-141/2

### AWS Region

ap-east-1

### Amplify Hosting feature

Console

### Frontend framework

React

### Next.js version

N/A

### Next.js router

N/A

### Describe the bug

I have these 3 variables set
![image](https://github.com/aws-amplify/amplify-hosting/assets/1074685/32a09103-d9c5-47d7-9551-9bcfb9e164c6)

in order to skip backend completely.

I created a pull request intentionally to test the case of updating a file outside of the frontend code folder (https://github.com/aitok-ai/LibreChat/pull/141), the result is that we successfully skip the building process but we got stuck for Deploy
![image](https://github.com/aws-amplify/amplify-hosting/assets/1074685/702efb5d-f1e2-4943-96fd-eeef4a49e427)

Output of the Deploy phase
![image](https://github.com/aws-amplify/amplify-hosting/assets/1074685/7cbd6b53-8091-4b05-9fce-3fd624b17247)

### Expected behavior

The deploy phase is skipped as well.

### Reproduction steps

1. create a PR that changes files outside the defined `AMPLIFY_DIFF_DEPLOY_ROOT` folder

### Build Settings

_No response_

### Log output

output of the Build tab
```
2023-09-18T05:01:39.533Z [INFO]: # Cloning repository: git@github.com:aitok-ai/LibreChat.git
2023-09-18T05:01:43.293Z [INFO]:
2023-09-18T05:01:43.352Z [INFO]: Cloning into 'LibreChat'...
2023-09-18T05:01:44.158Z [INFO]: From https://github.com/aitok-ai/LibreChat
* [new ref] refs/pull/141/head -> pr-141
Switched to branch 'pr-141'
2023-09-18T05:01:44.193Z [INFO]: Successfully cleaned up Git credentials
2023-09-18T05:01:44.194Z [INFO]: # Checking for Git submodules at: /codebuild/output/src1132725565/src/LibreChat/.gitmodules
2023-09-18T05:01:44.200Z [INFO]: # Retrieving environment cache...
2023-09-18T05:01:44.523Z [INFO]: # Retrieved environment cache
2023-09-18T05:01:44.523Z [INFO]: ---- Setting Up SSM Secrets ----
2023-09-18T05:01:44.523Z [INFO]: SSM params {"Path":"/amplify/d35bsvaicfsnob/prbeb/","WithDecryption":true}
2023-09-18T05:01:44.565Z [WARNING]: !Failed to set up process.env.secrets
2023-09-18T05:01:44.571Z [INFO]: # Determining if there are deployable frontend differences relative to repository root at: client
2023-09-18T05:01:44.571Z [INFO]: # NOTE: Set the AMPLIFY_DIFF_DEPLOY_ROOT environment variable to a valid relative path to override the default, ie: dist
2023-09-18T05:01:44.663Z [INFO]: # No differences detected.
2023-09-18T05:01:45.291Z [INFO]: No live updates for this build run
2023-09-18T05:01:45.296Z [INFO]: # Retrieving cache...
2023-09-18T05:01:45.356Z [INFO]: # Extracting cache...
2023-09-18T05:01:45.358Z [INFO]: # Extraction completed
2023-09-18T05:01:45.358Z [INFO]: # Retrieved cache
2023-09-18T05:02:08.905Z [INFO]: ## Skipping Frontend Build & Deploy, No changes detected...
2023-09-18T05:02:08.962Z [INFO]: ## Build completed successfully
2023-09-18T05:02:08.963Z [INFO]: # Starting caching...
2023-09-18T05:02:08.967Z [INFO]: # Creating cache artifact...
2023-09-18T05:02:08.969Z [INFO]: # Created cache artifact
2023-09-18T05:02:08.970Z [INFO]: # Uploading cache artifact...
2023-09-18T05:02:09.044Z [INFO]: # Uploaded cache artifact
2023-09-18T05:02:09.044Z [INFO]: # Caching completed
2023-09-18T05:02:09.046Z [INFO]: # No custom headers found.
2023-09-18T05:02:09.050Z [WARNING]: !! No index.html detected in deploy folder: /codebuild/output/src1132725565/src/LibreChat/client/dist/
2023-09-18T05:02:09.050Z [INFO]: # Starting build artifact upload process...
2023-09-18T05:02:09.066Z [INFO]: # Uploading build artifact '__artifacts.zip'...
2023-09-18T05:02:09.068Z [INFO]: # Uploading build artifact '__artifactsHash.zip'...
2023-09-18T05:02:09.166Z [INFO]: # Build artifact upload completed
2023-09-18T05:02:09.166Z [INFO]: # Starting environment caching...
2023-09-18T05:02:09.166Z [INFO]: # Uploading environment cache artifact...
2023-09-18T05:02:09.204Z [INFO]: # Uploaded environment cache artifact
2023-09-18T05:02:09.204Z [INFO]: # Environment caching completed
Terminating logging...
```

### Additional information

_No response_

Contributor guide

Open the contributing guide

Research direction

Start with the Amplify Hosting deploy flow that handles AMPLIFY_DIFF_DEPLOY_ROOT and the “No differences detected” path; compare the Build and Deploy phases shown in the logs. Reproduce with a pull request changing only files outside client, then confirm that the deploy phase is skipped rather than attempting artifact upload.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, react
Domain
ci-cd, cloud, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.