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

[Bug]: Descriptors cannot be created directly. #4356

Closed
1 task done
xingyaoww opened this issue Oct 13, 2024 · 5 comments · Fixed by #4325
Closed
1 task done

[Bug]: Descriptors cannot be created directly. #4356

xingyaoww opened this issue Oct 13, 2024 · 5 comments · Fixed by #4325
Labels
bug Something isn't working

Comments

@xingyaoww
Copy link
Contributor

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Describe the bug and reproduction steps

Some protobuf error related to chromaDB:

(openhands-ai-py3.12) (base) xingyaow@xingyao-develop:~/OpenHands$ evaluation/swe_bench/scripts/eval_infer_remote.sh /home/xingyaow/OpenHands/evaluation/evaluation_outputs/outputs/swe-bench-lite/CodeActAgent/valida
te-staging/output.jsonl 16                                                                                                                                                                                            
DATASET not specified, use default princeton-nlp/SWE-bench_Lite                                                                                                                                                       
SPLIT not specified, use default test                                                                                                                                                                                 
... Evaluating on /home/xingyaow/OpenHands/evaluation/evaluation_outputs/outputs/swe-bench-lite/CodeActAgent/validate-staging/output.jsonl ...                                                                        
2024-10-13 05:04:38,283 - datasets - INFO - PyTorch version 2.2.2 available.                                                                                                                                          
2024-10-13 05:04:39,042 - httpx - INFO - HTTP Request: GET https://raw.githubusercontent.com/BerriAI/litellm/main/model_prices_and_context_window.json "HTTP/1.1 200 OK"                                              
2024-10-13 05:04:41,673 - root - ERROR -   File "/home/xingyaow/OpenHands/evaluation/swe_bench/eval_infer.py", line 14, in <module>                                                                                   
    from evaluation.swe_bench.run_infer import get_instance_docker_image                                                                                                                                              
  File "/home/xingyaow/OpenHands/evaluation/swe_bench/run_infer.py", line 11, in <module>                                                                                                                             
    import openhands.agenthub                                                                                                                                                                                         
  File "/home/xingyaow/OpenHands/openhands/agenthub/__init__.py", line 3, in <module>                                                                                                                                 
    from openhands.agenthub.micro.agent import MicroAgent                                                                                                                                                             
  File "/home/xingyaow/OpenHands/openhands/agenthub/micro/agent.py", line 5, in <module>                                                                                                                              
    from openhands.controller.agent import Agent                                                                                                                                                                      
  File "/home/xingyaow/OpenHands/openhands/controller/__init__.py", line 1, in <module>                                                                                                                               
    from openhands.controller.agent_controller import AgentController                                                                                                                                                 
  File "/home/xingyaow/OpenHands/openhands/controller/agent_controller.py", line 7, in <module>                                                                                                                       
    from openhands.controller.state.state import State, TrafficControlState
  File "/home/xingyaow/OpenHands/openhands/controller/state/state.py", line 15, in <module>
    from openhands.memory.history import ShortTermHistory
  File "/home/xingyaow/OpenHands/openhands/memory/__init__.py", line 3, in <module>                                                                                                                           [68/646]
    from openhands.memory.memory import LongTermMemory
  File "/home/xingyaow/OpenHands/openhands/memory/memory.py", line 16, in <module>
    import chromadb
  File "/home/xingyaow/.cache/pypoetry/virtualenvs/openhands-ai-A46bY4LY-py3.12/lib/python3.12/site-packages/chromadb/__init__.py", line 6, in <module>
    from chromadb.auth.token_authn import TokenTransportHeader
  File "/home/xingyaow/.cache/pypoetry/virtualenvs/openhands-ai-A46bY4LY-py3.12/lib/python3.12/site-packages/chromadb/auth/token_authn/__init__.py", line 24, in <module>
    from chromadb.telemetry.opentelemetry import (
  File "/home/xingyaow/.cache/pypoetry/virtualenvs/openhands-ai-A46bY4LY-py3.12/lib/python3.12/site-packages/chromadb/telemetry/opentelemetry/__init__.py", line 12, in <module>
    from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter
  File "/home/xingyaow/.cache/pypoetry/virtualenvs/openhands-ai-A46bY4LY-py3.12/lib/python3.12/site-packages/opentelemetry/exporter/otlp/proto/grpc/trace_exporter/__init__.py", line 22, in <module>
    from opentelemetry.exporter.otlp.proto.grpc.exporter import (
  File "/home/xingyaow/.cache/pypoetry/virtualenvs/openhands-ai-A46bY4LY-py3.12/lib/python3.12/site-packages/opentelemetry/exporter/otlp/proto/grpc/exporter.py", line 39, in <module>
    from opentelemetry.proto.common.v1.common_pb2 import (
  File "/home/xingyaow/.cache/pypoetry/virtualenvs/openhands-ai-A46bY4LY-py3.12/lib/python3.12/site-packages/opentelemetry/proto/common/v1/common_pb2.py", line 36, in <module>
    _descriptor.FieldDescriptor(
  File "/home/xingyaow/.cache/pypoetry/virtualenvs/openhands-ai-A46bY4LY-py3.12/lib/python3.12/site-packages/google/protobuf/descriptor.py", line 621, in __new__
    _message.Message._CheckCalledFromGeneratedFile()

2024-10-13 05:04:41,673 - root - ERROR - <class 'TypeError'>: Descriptors cannot be created directly.
If this call came from a _pb2.py file, your generated code is out of date and must be regenerated with protoc >= 3.19.0.
If you cannot immediately regenerate your protos, some other possible workarounds are:
 1. Downgrade the protobuf package to 3.20.x or lower.
 2. Set PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=python (but this will use pure-Python parsing and will be much slower).

More information: https://developers.google.com/protocol-buffers/docs/news/2022-05-06#python-updates

OpenHands Installation

Development workflow

OpenHands Version

PR #4334 after merge from main

Operating System

Linux

Logs, Errors, Screenshots, and Additional Context

No response

@xingyaoww xingyaoww added the bug Something isn't working label Oct 13, 2024
@diwu-sf
Copy link

diwu-sf commented Oct 13, 2024

Try adding these to pyproject.toml and then reinstall for downgrade:

opentelemetry-api = "1.25.0"
opentelemetry-exporter-otlp-proto-grpc = "1.25.0"

@xingyaoww
Copy link
Contributor Author

Thanks @diwu-sf ! chroma-core/chroma#2571 (comment) also suggest a similar thing - i can confirm it is working for me. Will put up a PR soon

@xingyaoww
Copy link
Contributor Author

xingyaoww commented Oct 13, 2024

cc @enyst - maybe we should figure a way to enable memory tests in CI, which will likely caught this bug

@enyst
Copy link
Collaborator

enyst commented Oct 13, 2024

I put up a PR for this a couple of days ago: #4325

@enyst
Copy link
Collaborator

enyst commented Oct 13, 2024

@xingyaoww This was also reported a few days ago by amanape in slack and it was fixed by reverting protobuf latest dependabot upgrade; it includes an opentelemetry pin just in case. Please see the links here:

The memory tests is a good point, maybe they would have caught this. An optional workflow might do, I'll try.

Although this is weird: as early as last week a human in the loop - yours truly - did notice the suspicious dependabot upgrade. But on my local, I saw no bad results initially myself. 😅

Anyway, dependabot deserves suspicion on llama and chroma-related things!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
3 participants