Skip to content

Troubleshooting

Errors you may meet building and publishing the website, what causes them and how to fix them.

About 15 min · Verified 8 October 2026

Find the red stage first. Open CodePipelineshortlink-web-prod, or ask the CLI:

Your computerWhich stage failed, and why?
aws codepipeline get-pipeline-state --region ap-south-1 --name shortlink-web-prod \
  --query 'stageStates[].{stage:stageName,actions:actionStates[].{action:actionName,status:latestExecution.status,error:latestExecution.errorDetails.message}}' \
  --output json

Source and connection#

SymptomCauseFix
Source cannot read the repositoryConnection Pending, or in another RegionFinish Update pending connection; it must be Available in ap-south-1
Your fork is not selectableThe GitHub App is not installed on itGitHub → SettingsApplicationsAWS Connector for GitHubConfigure and add the fork
No execution after a pushThe push was not on main, or touched no filtered pathCheck the trigger filters, or use Release change
The pipeline builds the instructor's codeThe Source action points at the original repositoryEdit Source to <GITHUB_USER>/shortlink

Build#

SymptomCauseFix
codebuild:StartBuild AccessDenied and no CodeBuild logThe pipeline role cannot start the projectAdd the shortlink-web-start-builds policy (permissions chapter)
YAML_FILE_ERROR, no such file deploy/buildspec-web.ymlWrong buildspec path or file not on mainSet it to deploy/buildspec-web.yml and push
Tests failA real regressionRead the failing test, fix, push
vite build failsA syntax or import errorRead the error in the log, reproduce with npm --prefix shortlink-web run build
Out of memory during the buildCompute size too smallEdit the project and use a larger size (medium)
Source/artifact type error editing the projectCodeBuild checks both togetherBoth must be CODEPIPELINE (pipeline chapter)
Build succeeds, site says API unreachableVITE_API_BASE_URL missing or wrong on the build projectSet it to <API_URL> and release again

DeployWeb#

SymptomCauseFix
AccessDenied on a bucket you did not createdeploy/buildspec-web-deploy.yml still names the original bucketEdit it to <WEB_BUCKET>, push, release again
AccessDenied on ListObjectsV2 / PutObject / DeleteObject on your bucketThe deploy role's policy is missing or names a different bucketAdd shortlink-web-deploy-website-sync to codebuild-shortlink-web-deploy-service-role
AccessDenied reading the artifactThe deploy role cannot read the pipeline bucketAdd the artifact-read policy (permissions chapter)
NoSuchBucketA typo in the bucket name or Region in the buildspecCompare with S3Buckets
test -f shortlink-web/dist/index.html failsThe build artifact did not contain the siteCheck artifacts.files in buildspec-web.yml and the Build log
YAML_FILE_ERROR for the deploy buildspecdeploy/buildspec-web-deploy.yml is not inside the artifactIt must be listed in buildspec-web.yml under artifacts.files
Deploy is green but the site is unchangedBrowser cache, or it published to another bucketHard refresh; read the s3://… in the log

The site itself#

SymptomCauseFix
403 from the website URLThe bucket policy does not allow public read, or Block Public Access is onGuide 1, chapter 8. The deploy role is not involved
404 at the rootindex.html is in a nested folder, or the bucket was emptiedCheck aws s3 ls s3://<WEB_BUCKET>/ shows index.html at the top
Old JavaScript still loadsCached pageHard refresh. Confirm index.html has Cache-Control: no-cache
Network tab shows calls to the S3 hostnameThe variable was missing in that buildSet VITE_API_BASE_URL on shortlink-web-build, then release
CORS errors in the consoleThe API does not list the website originSet CORS_ORIGIN to <WEB_URL> in /etc/shortlink/shortlink.env and restart the API

Found a mistake? Edit this page on GitHub.