DataDog / dd-trace-py

Datadog Python APM Client
https://ddtrace.readthedocs.io/
Other
510 stars 400 forks source link

DD Agent GlusterFS check returns python errors #8940

Open ksvavars opened 3 months ago

ksvavars commented 3 months ago

Same for different DD agent versions, tested last with 7.52

sudo /opt/datadog-agent/embedded/sbin/gstatus -a

2024-04-10 13:26:04,606 WARNING [ddtrace.internal.packages] [packages.py:115] [dd.service=gstatus dd.env= dd.version= dd.trace_id=0 dd.span_id=0] - Unable to build package file mapping, please report this to [https://github.com/DataDog/dd-trace-py/issues](https://eur01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2FDataDog%2Fdd-trace-py%2Fissues&data=05%7C02%7Cksvavars%40vis.is%7Ceaef06b8e5244bebe26808dc5a0cb758%7C122d11df021246a08de7725373bc2a51%7C0%7C0%7C638484257872162921%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=%2BL7fKwRtQghWsfuRvupY3yBtZu6jC%2Fw7dNKJqZxc0Wg%3D&reserved=0)
Traceback (most recent call last):

File "/opt/datadog/apm/library/python/ddtrace_pkgs/site-packages-ddtrace-py3.9-manylinux2014/ddtrace/internal/utils/cache.py", line 124, in _

retval, exc = f.__callonce_result__ # type: ignore[attr-defined]

AttributeError: 'function' object has no attribute '__callonce_result__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/opt/datadog/apm/library/python/ddtrace_pkgs/site-packages-ddtrace-py3.9-manylinux2014/ddtrace/internal/packages.py", line 106, in _package_file_mapping

_path = fspath(f.locate())

TypeError: expected str, bytes or os.PathLike object, not Path

Traceback (most recent call last):

File "/opt/datadog-agent/embedded/sbin/gstatus/glustercli/cli/parsers.py", line 218, in parse_volume_info

File "/opt/datadog-agent/embedded/sbin/gstatus/glustercli/cli/parsers.py", line 137, in _parse_a_vol

AttributeError: 'NoneType' object has no attribute 'text'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):

File "/usr/lib64/python3.9/runpy.py", line 197, in _run_module_as_main

return _run_code(code, main_globals, None,

File "/usr/lib64/python3.9/runpy.py", line 87, in _run_code

exec(code, run_globals)

File "/opt/datadog-agent/embedded/sbin/gstatus/__main__.py", line 74, in <module>

File "/opt/datadog-agent/embedded/sbin/gstatus/__main__.py", line 70, in main

File "/opt/datadog-agent/embedded/sbin/gstatus/glusterlib/cluster.py", line 36, in gather_data

File "/opt/datadog-agent/embedded/sbin/gstatus/glustercli/cli/volume.py", line 188, in status_detail

File "/opt/datadog-agent/embedded/sbin/gstatus/glustercli/cli/volume.py", line 152, in info

File "/opt/datadog-agent/embedded/sbin/gstatus/glustercli/cli/parsers.py", line 220, in parse

Regards, Kári

Summary of problem

Which version of dd-trace-py are you using?

Which version of pip are you using?

Which libraries and their versions are you using?

`pip freeze`

How can we reproduce your problem?

What is the result that you get?

What is the result that you expected?

emmettbutler commented 3 months ago

Thanks for the report, @ksvavars. It looks somewhat similar to #8068.

What version of dd-trace-py are you using when you see this error?

ksvavars commented 3 months ago

Thanks for the report, @ksvavars. It looks somewhat similar to #8068.

What version of dd-trace-py are you using when you see this error?

Not sure, just have datadog agent installed on the machine with glusterfs mount and activated gluster fs configuration/check.

AxelWal commented 2 months ago

We have the same Error on multiple Servers. attrs==23.2.0 bcrypt==3.1.7 bytecode==0.15.1 cattrs==23.2.3 certifi==2020.6.20 chardet==4.0.0 cryptography==3.3.2 ddsketch==3.0.1 ddtrace==2.8.3 Deprecated==1.2.14 devscripts==2.21.3+deb11u1 distro==1.5.0 envier==0.5.1 exceptiongroup==1.2.1 httplib2==0.18.1 idna==2.10 importlib-metadata==7.0.0 iotop==0.6 lxml==4.6.3 opentelemetry-api==1.24.0 paramiko==2.7.2 pexpect==4.8.0 prometheus-client==0.18.0 protobuf==5.26.1 psutil==5.8.0 psycopg2==2.8.6 pycurl==7.43.0.6 pyinotify==0.9.6 PyNaCl==1.4.0 PySimpleSOAP==1.16.2 python-apt==2.2.1 python-debian==0.1.39 python-debianbts==3.1.0 reportbug==7.10.3+deb11u1 requests==2.25.1 six==1.16.0 sqlparse==0.5.0 ssh-import-id==5.10 termcolor==1.1.0 typing-extensions==4.11.0 urllib3==1.26.5 wrapt==1.16.0 xmltodict==0.13.0 zipp==3.18.1 On java Programms we also get error messages from dd-trace. it injects in everything. trace agent is disabled, but the messages are still there.

Dpkg -l ii datadog-agent 1:7.53.0-1 amd64 Datadog Monitoring Agent ii datadog-apm-inject 0.13.0-1 amd64 Datadog APM library injection ii datadog-apm-library-dotnet 2.51.0-1 amd64 Datadog APM client library for .NET ii datadog-apm-library-java 1.33.0-1 amd64 Datadog APM client library for Java ii datadog-apm-library-js 5.12.0-1 amd64 Datadog APM client library for Javascript ii datadog-apm-library-python 2.8.3-1 amd64 Datadog APM client library for python ii datadog-apm-library-ruby 1.22.0-1 amd64 Datadog APM client library for Ruby ii datadog-signing-keys 1:1.3.1-1 all Datadog Signing Keys

The Result is expected is no borring error messages that are produced through the datadog-agent before installing we did not had this issues.

AxelWal commented 2 months ago

apt remove datadog-apm-library-python seemes to solve the problem :)