5

I can locally publish my application to the S3 bucket and the application works. But deployment through AWS Amplify console (web) fails on the Build step of the backend.

The build step of the backend fails because of a missing configuration file or directory.

{
  Error: ENOENT: no such file or directory, scandir '/codebuild/output/src145745747/src/aws-service-catalog/amplify/backend/auth/cognito8f0f2f1d'
      at Object.fs.readdirSync (fs.js:904:18)
      at getCfnFiles (/root/.nvm/versions/node/v8.12.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/lib/push-resources.js:337:20)
      at updateS3Templates (/root/.nvm/versions/node/v8.12.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/lib/push-resources.js:350:39)
      at packageResources.then.then.then.then (/root/.nvm/versions/node/v8.12.0/lib/node_modules/@aws-amplify/cli/node_modules/amplify-provider-awscloudformation/lib/push-resources.js:42:17)
      at <anonymous>
      at process._tickDomainCallback (internal/process/next_tick.js:229:7)
    errno: -2,
    code: 'ENOENT',
    syscall: 'scandir',
    path: '/codebuild/output/src145745747/src/aws-service-catalog/amplify/backend/auth/cognito8f0f2f1d'
}

Anybody has tips how to debug/resolve this problem?

Patrick W
  • 1,485
  • 4
  • 19
  • 27
Erik Slagter
  • 229
  • 1
  • 10
  • `cognito8f0f2f1d` correspond to the folder containing the auth config that you added using `amplify auth add`. So, you might be missed to add that folder into version control. – Castro Roy Apr 13 '19 at 02:46
  • @CastroRoy yes I think that is the problem. My .gitignore was too tight and did not include that directory. Thank you for your reply! – Erik Slagter Apr 15 '19 at 11:46

2 Answers2

1

See my reply on the thread above. The directory was not included in my git repo.

Erik Slagter
  • 229
  • 1
  • 10
0

It's sad that aws amplify is not showing any details on build failure even on debug mode.

The solution is recloning the app and test locally and then push the changes.

The problem happens to be Git is missing changes. This git issue is resolved by following this steps

enter image description here

Dagm Fekadu
  • 598
  • 1
  • 8
  • 22