title: AWS CodePipeline - artifact file permission denied
body: <p>Have and issue with yaml / json and error like below. Didn't change lines responsible for producing artifacts in AWS CodePipeline yet it throws error like below...</p>
  <pre><code>[Container] 2020/07/30 17:18:27 Running command printf '[{&quot;name&quot;:&quot;production-celery&quot;,&quot;imageUri&quot;:&quot;%s&quot;}]' $CELERY_REPO_URI:$IMAGE_TAG &gt; build/codebuild/imagedefinitions-prod-celery.json || true
     
  
  [Container] 2020/07/30 17:18:27 Running command ls -la build/codebuild/
     
  total 36
     
  drwxr-xr-x 2 root root 4096 Jul 30 17:18 .
      
  drwxr-xr-x 5 root root 4096 Jul 30 17:16 ..
      
  -rw-rw-r-- 1 root root 2569 Jul 30 17:06 Buildspec_production.yml
      
  -rw-rw-r-- 1 root root 1157 Jul 30 17:06 Buildspec_staging.yml
  
  -rw-rw-r-- 1 root root  351 Jul 30 17:06 buildspec_ci.yml
     
  -rw-rw-r-- 1 root root  351 Jul 30 17:06 buildspec_prod_ci.yml
     
  -rw-r--r-- 1 root root  110 Jul 30 17:18 imagedefinitions-prod-app.json
      
  -rw-r--r-- 1 root root  108 Jul 30 17:18 imagedefinitions-prod-celery.json
  
  
  
  -rw-rw-r-- 1 root root  580 Jul 30 17:06 imagedefinitions-staging.json
  
      
  [Container] 2020/07/30 17:18:27 Running command cat build/codebuild/imagedefinitions-prod-celery.json
  
  [{&quot;name&quot;:&quot;production-celery&quot;,&quot;imageUri&quot;:&quot;xxxxxxxxxxx.dkr.ecr.eu-central-1.amazonaws.com/celery-repo:7fb56ff&quot;}]
      
  [Container] 2020/07/30 17:18:27 Running command build/codebuild/imagedefinitions-prod-celery.json   
  /codebuild/output/tmp/script.sh: 4: /codebuild/output/tmp/script.sh: build/codebuild/imagedefinitions-prod-celery.json: Permission denied
    
  [Container] 2020/07/30 17:18:27 Command did not exit successfully build/codebuild/imagedefinitions-prod-celery.json exit status 126
  
  [Container] 2020/07/30 17:18:27 Phase complete: POST_BUILD State: FAILED
     
  [Container] 2020/07/30 17:18:27 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: build/codebuild/imagedefinitions-prod-celery.json. Reason: exit status 126
  </code></pre>
  <p>Have no idea what is wrong and why it throws <code>Permission denied</code> ??? Anyone did encounter such error?</p>
  <p>EDIT: yesterday evening was working fine... no changes...</p>