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

ImportError: cannot import name 'docevents' from 'botocore.docs.bcdoc' #34

Closed
ahmei0 opened this issue Sep 21, 2020 · 9 comments
Closed

Comments

@ahmei0
Copy link

ahmei0 commented Sep 21, 2020

botocore 1.18.0 removed AWS CLI specific doc files. Those were already migrated to the CLI in version 1.18.140.

This is failing codebuild stage.

Please add following awscli upgrade command install_stage_dependencies.sh

pip install --upgrade pip

https://github.com/awslabs/aws-control-tower-customizations/blob/master/source/bin/codebuild_scripts/install_stage_dependencies.sh

ahmei0 added a commit to ahmei0/aws-control-tower-customizations that referenced this issue Sep 21, 2020
@SamiMamdouh
Copy link

SamiMamdouh commented Sep 21, 2020

I'm facing same error
ImportError: cannot import name 'docevents' from 'botocore.docs.bcdoc' (/root/.pyenv/versions/3.8.3/lib/python3.8/site-packages/botocore/docs/bcdoc/__init__.py)
please fix it (above script should fix )
Thanks !

@groverlalit
Copy link
Member

Hello @SamiMamdouh @ahmei0
We are testing the fix and plan to publish a new version as soon as possible.

@jdstuart
Copy link

We're experiencing the same issue. Great to know a fix is in the works to solve this.

@rjenks
Copy link

rjenks commented Sep 24, 2020

(I'm not with Amazon/AWS) As a workaround, until the install_stage_dependencies.sh script is fixed in the main repo, you can make a 1 line change to the buildspec to fix this. The fix is based on the PR that ahmei0 posted above, not my work. The PR is to fix the install_stage_dependencies.sh script that we can't easily modify in our environment though. This workaround changes the buildspec which we do have control over while we wait for the real fix.

  • Go to the CodePipeline dashboard and select the "Custom-Control-Tower-CodeBuild" project
  • Go to the Build Details tab and scroll down to the Buildspec, click Edit
  • Find the "pre_build:" "commands:" section.
  • Add the following line just before the "bash install_stage_dependencies.sh $STAGE_NAME" line:
    - pip install --upgrade awscli

I can't afford downtime for our CT customization pipeline, so I needed to find a workaround.

@frumania
Copy link

frumania commented Sep 28, 2020

Adding

- pip install --upgrade --user awscli

just before each "pre_build" block in the buildspec should fix this:

e.g.

...
      - apt-get update && apt-get upgrade -y
      - apt-get install zip wget python-pip libyaml-dev -y
      - pip install --upgrade --user awscli
  pre_build:
...

(This is due to an update on botocore that was released on Sept 17th.
In order to be able to import the dependency, customers will need to upgrade the awscli or install the awscli manually until a fix is released)

@rcalvachi
Copy link

I modified the CfCT template for the BuildSpecs:

StackSetCodeBuild
SCPCodeBuild
CustomControlTowerCodeBuild

Add "\n - pip install --upgrade awscli\n - aws --version" to lines 517, 641 and 811.

Do it right after "- apt-get update && apt-get upgrade -y". Then Update the CfCT stack.

@hunttom
Copy link

hunttom commented Oct 9, 2020

Can you please close this ticket if v1.2.1 resolves this issue.

arniesaha pushed a commit to arniesaha/quickstart-taskcat-ci that referenced this issue Jan 26, 2021
@groverlalit
Copy link
Member

Issue resolved in release v1.2.1

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

9 participants