aws-actions/codeguru-reviewer

CodeGuru Review step fails with strange error

tsposato opened this issue · 4 comments

Hi,

I have a repository containing a java backend as well as a vue.js frontend.
Initially, I'd like to get the reviews working and have configured the following:

      - name: CodeGuru Reviewer
        uses: aws-actions/codeguru-reviewer@v1.1
        with:
          build_path: ${{ env.BACK_END_WORKING_DIR }}/target
          s3_bucket: codeguru-reviewer-mybucket

However, I get the following error:

2021-07-14 02:23:38,374 ERROR Exception occurred while executing
ValueError: ZIP does not support timestamps before 1980

It seems like this is coming from some of my node_modules dependencies from my frontend, however I'm not sure why it would even be trying to zip these files together considering I gave the path to my backend target which should just contain my backend java classes and jar file etc.

As a test, if I run an intermediate step to 'touch' all the files with a broken modified time, it continues but then I get this error:

2021-07-14 02:42:57,855 INFO All files zipped successfully
2021-07-14 02:42:57,855 INFO File generated at path /github/workspace/source.zip with size: 295333246 bytes
2021-07-14 02:43:08,339 INFO build_root: ./backend/target
2021-07-14 02:43:12,511 INFO All files zipped successfully
2021-07-14 02:43:12,512 INFO File generated at path /github/workspace/build.zip with size: 104034766 bytes
2021-07-14 02:43:19,071 ERROR Exception occurred while submitting the code review request
Traceback (most recent call last):
botocore.errorfactory.AccessDeniedException: An error occurred (AccessDeniedException) when calling the CreateCodeReview operation: You don't have access to GUID-HERE/source.zip or it doesn't exist.
2021-07-14 02:43:19,072 ERROR Exception occurred while executing
botocore.errorfactory.AccessDeniedException: An error occurred (AccessDeniedException) when calling the CreateCodeReview operation: You don't have access to GUID-HERE/source.zip or it doesn't exist.

My ci-cd user has the AmazonCodeGuruReviewerFullAccess policy attached and full access to the S3 bucket as well.
I have added debug on for the step/action but this is all the information I get.
I'm a little stuck here, can someone point me in the right direction?

Regards,
Terry

Could you provide your AWS Account number, region, and GitHub repo name for investigation?

Could you provide your AWS Account number, region, and GitHub repo name for investigation?

I'd be happy to, can I supply it privately?

Could you provide your AWS Account number, region, and GitHub repo name for investigation?

I'd be happy to, can I supply it privately?

Yes, definitely. Please send your info to this email address: codeguru-reviewer-feedback@amazon.com.
Appreciate your help!

This bug was due to 2 issues. The used IAM role did not have permission for s3:ListBucket, and Python 3.8 not supporting timestamps before 1980. We have made the code changes necessary for the timestamp, please let us know if you experience this issue again.