Skip to content

Python: AttributeError: 'NoneType' object has no attribute 'cancelled' #23290

@justinvp

Description

@justinvp

What version of gRPC and what language are you using?

Python grpcio package version 1.30.0

What operating system (Linux, Windows,...) and version?

macOS 10.14.6

What runtime / compiler are you using (e.g. python version or version of gcc)

$ venv/bin/python --version
Python 3.7.7

What did you do?

The problem happens when creating a vanilla Pulumi Python program:

$ mkdir emptypytest && cd emptypytest
$ pulumi new python

...

Successfully installed dill-0.3.2 grpcio-1.30.0 protobuf-3.12.2 pulumi-2.4.0 six-1.15.0
Finished installing dependencies

Your new project is ready to go! ✨

To perform an initial deployment, run 'pulumi up'

What did you expect to see?

$ pulumi up

Previewing update (dev):
     Type                 Name             Plan       
 +   pulumi:pulumi:Stack  emptypytest-dev  create     
 
Resources:
    + 1 to create

What did you see instead?

$ pulumi up

Previewing update (dev):
     Type                 Name             Plan       Info
 +   pulumi:pulumi:Stack  emptypytest-dev  create     8 messages
 
Diagnostics:
  pulumi:pulumi:Stack (emptypytest-dev):
    Exception ignored in: <function _ChannelCallState.__del__ at 0x1062d8290>
    Traceback (most recent call last):
      File "/Users/user/Desktop/emptypytest/venv/lib/python3.7/site-packages/grpc/_channel.py", line 1126, in __del__
    AttributeError: 'NoneType' object has no attribute 'cancelled'
    Exception ignored in: <function _ChannelCallState.__del__ at 0x1062d8290>
    Traceback (most recent call last):
      File "/Users/user/Desktop/emptypytest/venv/lib/python3.7/site-packages/grpc/_channel.py", line 1126, in __del__
    AttributeError: 'NoneType' object has no attribute 'cancelled'

After downgrading and pinning to grpcio 1.29.0, the error no longer happens:

$ venv/bin/pip uninstall grpcio
$ venv/bin/pip install grpcio==1.29.0
$ pulumi up

Previewing update (dev):
     Type                 Name             Plan       
 +   pulumi:pulumi:Stack  emptypytest-dev  create     
 
Resources:
    + 1 to create

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions