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

New Apline container build runs with Python 3.10, throws "AttributeError module 'collections' has no attribute 'Mapping'" #731

Closed
ShahradR opened this issue Apr 15, 2022 · 4 comments
Assignees

Comments

@ShahradR
Copy link

Hello taskcat team!

I saw that the Docker image was recently updated and rebuilt, using python:3-alpine as the base image. Unfortunately, it looks like the latest Python container runs using Python 3.10, which might have broken a few things—specifically, Python 3.10 removes the Mappings class from the collections package, as highlighted in #714, and commands like test run now throw [ERROR ] : AttributeError module 'collections' has no attribute 'Mapping' when invoked from the container.

One fix might be to update the Dockerfile's parent image and pin the version to a specific release of Python and Alpine—I've updated the taskcat GitHub Action to use the python:3.8.13-alpine3.15 image to get people's pipelines working again, and it seems to be doing the trick!

To reproduce

Steps to reproduce the behavior:

  1. Pull the latest taskcat Docker image by running docker pull taskcat/taskcat:latest
  2. Run taskcat test run against the Docker container by running the command in the section below
  3. Notice that taskcat throws [ERROR ] : AttributeError module 'collections' has no attribute 'Mapping'

Command to invoke the Docker container

The following command was used to run taskcat in the Docker container. The mount path points to a test directory in the action-taskcat project, which contains a CloudFormation template that never creates any resources.

docker run \
  -it \
  --mount type=bind,source=/home/shahradr/action-taskcat/e2e/resources/default/,target=/mnt \
  --entrypoint taskcat \
  taskcat/taskcat:latest \
  test run

Questions regarding the system under test

Questions Answers
1. Are you testing a QuickStart or Custom template? Custom template
2. Attach or link a copy of the template if possible (remove any sensitive info) See example template
3. Provide the parameters that you passed. (remove any sensitive info) test run
4. How did you install taskcat? (docker or pip3) Docker
5. Are you using a profile, an instance role or access keys to run taskcat? Access keys
6. Is your AWS environment configured via aws configure? No

Expected behavior

taskcat should execute the test run command successfully, without throwing [ERROR ] : AttributeError module 'collections' has no attribute 'Mapping'

Screenshots

taskcat-docker-collections-error

Version

Application Version
taskcat 0.9.30
Python 3.10.4

Additional context

This issue was initially flagged in ShahradR/action-taskcat#298—I was installing some Node.js packages on top of the taskcat/taskcat:latest image to support the taskcat GitHub Action, which caused the container build to fail.

@troy-ameigh troy-ameigh self-assigned this Apr 15, 2022
@troy-ameigh
Copy link
Contributor

Thank you for your issue, I am looking into this.

@troy-ameigh
Copy link
Contributor

Docker images have been fixed. They are still tagged as release-0.9.30 and latest.

@ShahradR
Copy link
Author

Thank you so much for the quick response—super appreciated!!

I tried both tags: release-0.9.30 works perfectly, but it looks like we're getting a manifest unknown error with latestI think the tag might be missing from Docker Hub?

Here is the output when running the docker run command using the two tags.

Running the taskcat container with the latest tag

taskcat-latest-missing-manifest

Running the taskcat container with the release-0.9.30 tag

taskcat-0 9 30-working

@troy-ameigh
Copy link
Contributor

Latest image tag issue resolved.

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