tonymet / gcloud-lite

GNU General Public License v3.0
35 stars 0 forks source link

Crashes with AttributeError: module 'google._upb._message' has no attribute 'MessageMapContainer' #3

Closed mmoya closed 1 month ago

mmoya commented 1 month ago

Running gcloud is failing with the following error:

  ...
  File "/home/mmoya/archpkg/google-cloud-cli-lite/pkg/google-cloud-cli-lite/opt/google-cloud-cli/lib/googlecloudsdk/core/resource/resource_projector.py", line 433, in _Project
    import proto  # pylint: disable=g-import-not-at-top
    ^^^^^^^^^^^^
  File "/home/mmoya/archpkg/google-cloud-cli-lite/pkg/google-cloud-cli-lite/opt/google-cloud-cli/lib/third_party/proto/__init__.py", line 15, in <module>
    from .enums import Enum
  File "/home/mmoya/archpkg/google-cloud-cli-lite/pkg/google-cloud-cli-lite/opt/google-cloud-cli/lib/third_party/proto/enums.py", line 19, in <module>
    from proto import _file_info
  File "/home/mmoya/archpkg/google-cloud-cli-lite/pkg/google-cloud-cli-lite/opt/google-cloud-cli/lib/third_party/proto/_file_info.py", line 24, in <module>
    from proto.marshal.rules.message import MessageRule
  File "/home/mmoya/archpkg/google-cloud-cli-lite/pkg/google-cloud-cli-lite/opt/google-cloud-cli/lib/third_party/proto/marshal/__init__.py", line 15, in <module>
    from .marshal import Marshal
  File "/home/mmoya/archpkg/google-cloud-cli-lite/pkg/google-cloud-cli-lite/opt/google-cloud-cli/lib/third_party/proto/marshal/marshal.py", line 25, in <module>
    from proto.marshal import compat
  File "/home/mmoya/archpkg/google-cloud-cli-lite/pkg/google-cloud-cli-lite/opt/google-cloud-cli/lib/third_party/proto/marshal/compat.py", line 43, in <module>
    map_composite_types += (_message.MessageMapContainer,)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'google._upb._message' has no attribute 'MessageMapContainer'

I haven't looked deep enough but I'm willing to help with debugging. They're some recommendations of installing python-proto-plus>=1.24 as a fix.

I've tested it locallly, installing python-proto-plus==1.24 and the problem persists. From the backtrace it seems this distribution has proto vendored so installing anything is useless.

Would like to raise the issue to see if anyone else is able to reproduce.

Thanks

tonymet commented 1 month ago

thanks for the report. can you share what environment you are running on ? Seems like the .tgz distro on arch linux? Also share the command line arguments and I'll help to repro .

mmoya commented 1 month ago

Hi @tonymet

I really needed gcloud working for $WORK thus debugging capability time was pragmatically limited. First thing I did was to install stock gcloud and it exposed the same problem.

Then I started to remove "suspicious" packages until it worked, bruteforcing basically. These packages were uninstalled:

[ALPM] removed python-proto-plus (1.24.0-1)
[ALPM] removed python-google-api-core (2.18.0-2)
[ALPM] removed python-google-auth (2.30.0-1)
[ALPM] removed python-oauth2client (4.1.3-10)
[ALPM] removed python-httplib2 (0.22.0-5)
[ALPM] removed python-pyparsing (3.1.2-2)
[ALPM] removed python-rsa (4.9-4)
[ALPM] removed python-pyasn1-modules (0.3.0-2)
[ALPM] removed python-pyasn1 (0.5.1-1)
[ALPM] removed python-cachetools (5.3.2-3)
[ALPM] removed python-googleapis-common-protos (1.63.0-2)

[ALPM] removed crun (1.15-1)
[ALPM] removed yajl (2.1.0-6)
[ALPM] removed catt (0.12.12-1)
[ALPM] removed yt-dlp (2024.07.09-1)
[ALPM] removed criu (3.19-1)
[ALPM] removed python-pychromecast (14.0.1-1)
[ALPM] removed python-protobuf (27.2-1)
[ALPM] removed python-casttube (0.2.1-4)

the second batch was reverse dependencies of python-protobuf, I think it's the culprit.

After that I was able to build google-cloud-cli-lite 483.0.0 and the build itself was an indicator that I got out of the dependency hell. I installed the new package and call it a day.

Closing because it's something very environment specific.

Thanks

tonymet commented 1 month ago

thanks for reporting this issue and following up.