Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Github Taskcat action is failing with nodejs dependency issue. #298

Closed
KiranReddy230 opened this issue Apr 13, 2022 · 5 comments
Closed
Assignees

Comments

@KiranReddy230
Copy link

Hi @ShahradR , github taskcat action ShahradR/action-taskcat is failing with nodejs dependency error. This was working fine untill lastweek and started throwing issues from today. Please find the below failure logs.

Step 2/6 : RUN apk add --no-cache nodejs~=12 npm~=12 && rm -rf /var/cache/apk/*
---> Running in 806e412203fa
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/community/x86_64/APKINDEX.tar.gz
ERROR: unable to select packages:
nodejs-current-17.9.0-r0:
breaks: world[nodejs12]
satisfies: npm-8.1.3-r0[cmd:node]
npm-8.1.3-r0:
breaks: world[npm
12]
The command '/bin/sh -c apk add --no-cache nodejs~=12 npm~=12 && rm -rf /var/cache/apk/*' returned a non-zero code: 2
Warning: Docker build failed with exit code 2, back off 8.801 seconds before retry.
/usr/bin/docker build -t 2bcf09:4a4711ea98244f109ccac686acafef2b -f "/home/runner/work/_actions/ShahradR/action-taskcat/v2.0.0/Dockerfile" "/home/runner/work/_actions/ShahradR/action-taskcat/v2.0.0"
Sending build context to Docker daemon 1.107MB

Step 1/6 : FROM taskcat/taskcat:latest
---> e8b42812b7ca
Step 2/6 : RUN apk add --no-cache nodejs~=12 npm~=12 && rm -rf /var/cache/apk/*
---> Running in d5b3db10547c
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/community/x86_64/APKINDEX.tar.gz
ERROR: unable to select packages:
nodejs-current-17.9.0-r0:
breaks: world[nodejs12]
satisfies: npm-8.1.3-r0[cmd:node]
npm-8.1.3-r0:
breaks: world[npm
12]
The command '/bin/sh -c apk add --no-cache nodejs~=12 npm~=12 && rm -rf /var/cache/apk/*' returned a non-zero code: 2
Warning: Docker build failed with exit code 2, back off 2.588 seconds before retry.
/usr/bin/docker build -t 2bcf09:4a4711ea98244f109ccac686acafef2b -f "/home/runner/work/_actions/ShahradR/action-taskcat/v2.0.0/Dockerfile" "/home/runner/work/_actions/ShahradR/action-taskcat/v2.0.0"
Sending build context to Docker daemon 1.107MB

Step 1/6 : FROM taskcat/taskcat:latest
---> e8b42812b7ca
Step 2/6 : RUN apk add --no-cache nodejs~=12 npm~=12 && rm -rf /var/cache/apk/*
---> Running in 4169df0786f6
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/main/x86_64/APKINDEX.tar.gz
fetch https://dl-cdn.alpinelinux.org/alpine/v3.15/community/x86_64/APKINDEX.tar.gz
ERROR: unable to select packages:
nodejs-current-17.9.0-r0:
breaks: world[nodejs12]
satisfies: npm-8.1.3-r0[cmd:node]
npm-8.1.3-r0:
breaks: world[npm
12]
The command '/bin/sh -c apk add --no-cache nodejs~=12 npm~=12 && rm -rf /var/cache/apk/*' returned a non-zero code: 2
Error: Docker build failed with exit code 2

ShahradR added a commit that referenced this issue Apr 14, 2022
Update the Dockerfile and unpin the nodejs and npm versions from the
container, after the base taskcat/taskcat:latest version was upgraded to
use Alpine v3.15.

Associated issue: #298
@ShahradR
Copy link
Owner

Hi @KiranReddy230!

Thank you so much for flagging this—it seems that this issue was caused by a change in the upstream container. I'll take a look and update this thread as soon as I have more information. Thank you!!

@KiranReddy230
Copy link
Author

Thank you @ShahradR. Will wait for your update.

ShahradR added a commit that referenced this issue Apr 15, 2022
Update the Dockerfile to install taskcat from python:3.8.13-alpine3.15,
after the taskcat/taskcat:latest image was rebuilt and now uses Alpine
v3.15 and Python 3.10.

In Python 3.3, abstract base classes were moved from the "collections"
module to "collections.abc". In Python 3.10, the classes were removed
from the "collections" module, which causes certain taskcat commands to
return with error "AttributeError module 'collections' has no attribute
'Mapping'". See https://bit.ly/3vnAnOr for more details.

Associated issue: #298
ShahradR added a commit that referenced this issue Apr 15, 2022
In order to maintain compatibility with existing GitHub workflows, pin
the taskcat version to v0.9.23. Users can upgrade both taskcat and
cfn_lint to their latest versions by setting the `upgrade_taskcat` and
`upgrade_cfn_lint` input parameter in their workflows, respectively.

Associated issue: #298
ShahradR added a commit that referenced this issue Apr 15, 2022
Update the Dockerfile to install taskcat from python:3.8.13-alpine3.15,
after the taskcat/taskcat:latest image was rebuilt and now uses Alpine
v3.15 and Python 3.10.

In Python 3.3, abstract base classes were moved from the "collections"
module to "collections.abc". In Python 3.10, the classes were removed
from the "collections" module, which causes certain taskcat commands to
return with error "AttributeError module 'collections' has no attribute
'Mapping'". See https://bit.ly/3vnAnOr for more details.

Associated issue: #298
ShahradR added a commit that referenced this issue Apr 15, 2022
In order to maintain compatibility with existing GitHub workflows, pin
the taskcat version to v0.9.23. Users can upgrade both taskcat and
cfn_lint to their latest versions by setting the `upgrade_taskcat` and
`upgrade_cfn_lint` input parameter in their workflows, respectively.

Associated issue: #298
@ShahradR
Copy link
Owner

Hi @KiranReddy230

I just pushed an updated Dockerfile to the repository for both the v1 and v2 releases of the project, which should resolve your issue!

If you are referencing the GitHub Action using the latest or major version (@v1 or @v2), you should be able to re-run your job and hopefully it should work! If you're referencing a specific commit or tag, you'll need to update your GitHub workflow to reference the latest version—the diff below shows the update you would need to make if you're referencing a specific release.

I also opened aws-ia/taskcat#731 with the taskcat team, and they've already pushed a fix to update the base container!

Let me know if this resolves your issue, or if you have any other questions/comments/concerns, and thanks again for flagging this!

GitHub workflow update when referencing a specific commit

Update your workflow as shown below if you're referencing a specific commit. If you're only referencing the main branch or a major version (@v1 or @v2), no changes are required.

  - name: Run taskcat test run
-   uses: ShahradR/[email protected]
+   uses: ShahradR/[email protected]
    with:
      commands: test run
      update_taskcat: true
      update_cfn_lint: true

@ShahradR ShahradR pinned this issue Apr 18, 2022
@KiranReddy230
Copy link
Author

@ShahradR Thanks a lot for fixing this. I am able to run my github actions successfully now. Good to close this issue.
Regards.

@ShahradR
Copy link
Owner

That's awesome, glad to hear it's working again!! 🥳

I'll close the ticket, but if you run into any other issues, feel free to create a new one and we can take a look at it! And thanks again for reaching out and flagging this, really appreciated!!

@ShahradR ShahradR self-assigned this Apr 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants