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' release 1.15.0 #2596

Closed
bruce-lindsay opened this issue Sep 17, 2020 · 47 comments
Closed

ImportError: cannot import name 'docevents' release 1.15.0 #2596

bruce-lindsay opened this issue Sep 17, 2020 · 47 comments

Comments

@bruce-lindsay
Copy link

Describe the bug
aws help command not functioning in release https://github.com/boto/boto3/releases/tag/1.15.0
I am using miniconda3 python runtime environment with the python implementation of AWS CLI. The error originally occurred on our CI pipeline.

Steps to reproduce

  • pip install "boto3==1.15.0"
  • aws help
    Traceback (most recent call last):
    File "C:\Users\X\Miniconda3\Scripts\aws.cmd", line 50, in
    import awscli.clidriver
    File "C:\Users\X\Miniconda3\lib\site-packages\awscli\clidriver.py", line 36, in
    from awscli.help import ProviderHelpCommand
    File "C:\Users\X\Miniconda3\lib\site-packages\awscli\help.py", line 23, in
    from botocore.docs.bcdoc import docevents
    ImportError: cannot import name 'docevents'

Expected behavior
aws help is displayed as when boto3 1.14.63 is installed

@bruce-lindsay bruce-lindsay added the needs-triage This issue or PR still needs to be triaged. label Sep 17, 2020
@bruce-lindsay bruce-lindsay changed the title ImportError: cannot import name 'docevents' ImportError: cannot import name 'docevents' release 1.15.0 Sep 17, 2020
@gregory-lyons
Copy link

Looks like docevents was removed in botocore 1.18.0 boto/botocore@dd24dd1#diff-cebf7e5767458186d20a75e5390de4de

@gregory-lyons
Copy link

Upgrading awscli to >=1.18.140 should fix this: aws/aws-cli#5538

@nateprewitt
Copy link
Contributor

Thanks for the quick update, @gregory-lyons! That's correct, we released botocore 1.18.0 today which removed AWS CLI specific doc files. Those were already migrated to the CLI in version 1.18.140 (aws/aws-cli#5538) so the CLI no longer depends on botocore for them.

All versions of the CLI released prior to 1.18.141 explicitly require a version of botocore < 1.18.0. It looks like pip doesn't respect this because dependency resolution isn't released yet. When boto3 1.15.0 is installed, pip is uninstalling the required dependencies for the CLI. We're currently evaluating options, but I think the immediate fix is to be updating the CLI in line with boto3.

@bruce-lindsay
Copy link
Author

Thank you, I will upgrade awscli

@gdoron
Copy link

gdoron commented Sep 17, 2020

I'm curious how many workflows broke because of this change...

@zviklausner
Copy link

All our workflows have now broken because of this as well

@webysther
Copy link

webysther commented Sep 17, 2020

aws glue python shell stop working after this update.

@webysther
Copy link

As workaround for AWS Glue is add botocore = "<1.18.0"

@ElijahLynn
Copy link

Our prod deploy broke because of this today, it appears. Thanks for opening this!

@tbuchier
Copy link

tbuchier commented Sep 18, 2020

All our pipelines were broken as Codebuild images use a CLI < 1.18.140...

Solved by forcing an upgrade on awscli

@j--wong
Copy link

j--wong commented Sep 18, 2020

This broken our codebuild jobs too 😞

@sjmorton
Copy link

Broke all my deploys too. Upgrading awscli fixed them. Thanks for the info!

@okram999
Copy link

okram999 commented Sep 18, 2020

in CodeBuild, update the aws cli like so for the agent/node, as a workaround. line # 11

image

@orende
Copy link

orende commented Sep 18, 2020

Can confirm that this change broke workflows all across my company on multiple continents.

@yogeshpgarud
Copy link

All our workflows have now broken because of this change

@seyfiaslann
Copy link

We have the same issue for our CodeBuild projects

@rgplaza
Copy link

rgplaza commented Sep 18, 2020

We have the same issue trying to launch Glue Zeppelin Notebook Servers.

@NightWuYo
Copy link

Same issue here, thanks for raising this and lead me to the solution.

@MiteshShah
Copy link

MiteshShah commented Sep 18, 2020

Same issue and thanks for the solution pip3 install awscli fix our issue

image

@sree64
Copy link

sree64 commented Sep 18, 2020

this upgrade broke all our pipelines in all environments. we figured out that this was due to boto3 release and we downgraded boto3 to a stable release . While installing boto3 we used pip install boto3==1.14.62. And this solved the problem .

@dduenas
Copy link

dduenas commented Sep 18, 2020

same here, some pipelines broken becasue of this.

@jblackburn22
Copy link

jblackburn22 commented Sep 18, 2020

The YUM package on Amazon Linux 2 is impacted by this.

$ sudo yum reinstall awscli
Loaded plugins: extras_suggestions, langpacks, priorities, update-motd
Resolving Dependencies
--> Running transaction check
---> Package awscli.noarch 0:1.18.107-1.amzn2.0.1 will be reinstalled
--> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================================
 Package               Arch                  Version                             Repository                 Size
=================================================================================================================
Reinstalling:
 awscli                noarch                1.18.107-1.amzn2.0.1                amzn2-core                2.0 M

Transaction Summary
=================================================================================================================
Reinstall  1 Package

Total download size: 2.0 M
Installed size: 7.6 M
Is this ok [y/d/N]: y
Downloading packages:
awscli-1.18.107-1.amzn2.0.1.noarch.rpm                                                    | 2.0 MB  00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : awscli-1.18.107-1.amzn2.0.1.noarch                                                            1/1
  Verifying  : awscli-1.18.107-1.amzn2.0.1.noarch                                                            1/1

Installed:
  awscli.noarch 0:1.18.107-1.amzn2.0.1

Complete!
i-06a25febbba71da48 [ec2-user@dp-fe-int1 tmp]$ sudo aws s3 cp s3://***redacted**/assets/ansible/current-daily/master/ansible-bootstrap.sh /var/local/ansible/bootstrap
Traceback (most recent call last):
  File "/bin/aws", line 19, in <module>
    import awscli.clidriver
  File "/usr/lib/python2.7/site-packages/awscli/clidriver.py", line 36, in <module>
    from awscli.help import ProviderHelpCommand
  File "/usr/lib/python2.7/site-packages/awscli/help.py", line 23, in <module>
    from botocore.docs.bcdoc import docevents
ImportError: cannot import name docevents

@bonudagar
Copy link

can someone send commands and instructions to fix this issue for production pipelines?

@cmackenzie1
Copy link

@bonudagar it has been shared a few times in this thread, but for anyone else who might have also missed it, you can upgrade your version of awscli.

pip install --upgrade awscli

See this comment for more details #2596 (comment)

@syates21
Copy link

Pretty sure this broke the code pipeline for anyone who uses AWS Landing Zone. The build step pulls a new boto version each time, but also uses the AWS CLI and runs on the aws/codebuild/standard:2.0 image which I'm guessing has an older version of the CLI (have to check for the specifics). Not cool though

@jayceebernardino
Copy link

Same issue here as well. It impacted our boostrapping workflow for our eks worker nodes.

@dev-head
Copy link

cool, just need to go upgrade a hundred or so repo's on a friday afternoon and a bunch of base images. Who's going to tell my kids they won't see me the rest of the weekend? 😢

@bruhnf
Copy link

bruhnf commented Sep 25, 2020

I see the solution to the issue being posted as:

- pip install --upgrade awscli

Our aws pro-services person had us update the BuildSpec in the CI pipeline to:

- pip install --upgrade --user awscli

Just curious why he had me use the --user switch. Would I not want this installed/updated in my system directory, as opposed to the home directory of the buildspec?

@yrral86
Copy link

yrral86 commented Sep 25, 2020

Also broken in alpine linux as the latest version available is 1.18.55-r0

https://pkgs.alpinelinux.org/package/edge/community/x86_64/aws-cli

@lloydpick

https://gitlab.alpinelinux.org/alpine/aports/-/merge_requests/12829

If you're going to use alpine, I recommend learning how to update packages. It took literally 2 minutes to create that MR and they are usually merged within a couple hours.

@joarder
Copy link

joarder commented Oct 7, 2020

These doesn't look like will be fixed soon by package maintainers... which is... shameful.

If you need to to fix this you might want to pin these versions

botocore==1.17.63
awscli==1.18.140 
boto3==1.14.63

I hope this save you some time, while we wait for these to be addressed

Our build was successful after explicitly specify the below in the requirements

botocore==1.18.14
awscli==1.18.155
boto3==1.15.14

@swetashre swetashre removed the needs-triage This issue or PR still needs to be triaged. label Oct 22, 2020
yijiezh pushed a commit to aws/sagemaker-rl-container that referenced this issue Oct 27, 2020
* This change fixes the 'docevents' import error  due to an upgrade in botocore. boto/boto3#2596

Co-authored-by: Akash Goel <[email protected]>
goelakash pushed a commit to aws/sagemaker-rl-container that referenced this issue Oct 28, 2020
*  This change fixes the 'docevents' import error  due to an upgrade in botocore. boto/boto3#2596
@perk11
Copy link

perk11 commented Nov 15, 2020

Got this after installing awscli using apt in Ubuntu 20.04.
sudo apt purge awscli
sudo pip3 install awscli

helped

But still seems like it shouldn't have been broken in the first place.

apaj added a commit to apaj/firesim that referenced this issue Nov 16, 2020
The yum install python-pip/pip install boto3 sequence wouldn't let me run successfully aws-setup. It turns out that the developers of the boto package did something (described here in detail: boto/boto3#2596) that requires the awscli package to be upgraded via pip.
@cgchinmay
Copy link

Still facing the same issue. Current packages
awscli = 1.18.155 awsebcli = 3.19.2 boto3 = 1.15.14 botocore = 1.18.14

Krenair added a commit to alphagov/tech-ops that referenced this issue Nov 24, 2020
Since boto/boto3#2596, we can't just pip3 install
boto3 on top of it. The image we use comes from this PaaS repository:
https://github.com/alphagov/paas-docker-cloudfoundry-tools/blob/main/awscli/Dockerfile
which pins awscli to 1.17.2.

Also, use curl-ssl from GHCR instead of DockerHub.
Krenair added a commit to alphagov/tech-ops that referenced this issue Nov 24, 2020
Since boto/boto3#2596, we can't just pip3 install
boto3 on top of it. The image we use comes from this PaaS repository:
https://github.com/alphagov/paas-docker-cloudfoundry-tools/blob/main/awscli/Dockerfile
which pins awscli to 1.17.2. This commit uses 1.18.140 which shouldn't have the issue.

Also, use curl-ssl from GHCR instead of DockerHub.
Krenair added a commit to alphagov/paas-docker-cloudfoundry-tools that referenced this issue Nov 24, 2020
Per boto/boto3#2596 (comment)

The PaaS might not use this but we've seen it when steal^H^H^H^H^Hre-using the
image for OctoDNS.
Krenair added a commit to alphagov/paas-docker-cloudfoundry-tools that referenced this issue Nov 24, 2020
Per boto/boto3#2596 (comment)

The PaaS might not use this but we've seen it when re-using the image for
OctoDNS.
sbstjn added a commit to superwerker/superwerker that referenced this issue Jan 28, 2021
@kdaily
Copy link
Member

kdaily commented May 18, 2021

Per the last comment here this is now resolved, closing.

#2596 (comment)

@kdaily kdaily closed this as completed May 18, 2021
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@gageleblanc
Copy link

this STILL EXISTS and is NOT RESOLVED no matter how many times i try to install various versions of the aws cli directly from the Amazon page for it.

@StarGrin
Copy link

i don't not what happend, just close my ubuntu 18,and then open it the next day.
in my terminal, i just find my docker service is not run, cmd like 'docker ps', get an err like 'Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?'.
then i fixed it by adding a 'registry-mirrors' in '/etc/docker/daemon.json';
and just rightnow , i got something wrong on 'awscli',
File "/usr/lib/python3/dist-packages/awscli/help.py", line 23, in <module> from botocore.docs.bcdoc import docevents ImportError: cannot import name 'docevents'
the same err, and the reason is that 'awscli' package’ version is wrong, my aws version is awscli (1.18.69) and fixed it by sudo python3 -m pip install awscli==1.18.105

just so stranged, i closed my computer yesterday normally, and got these err....

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