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

Connection Timeout Error with telemetry.crewai.com #254

Open
leeeex opened this issue Feb 18, 2024 · 20 comments
Open

Connection Timeout Error with telemetry.crewai.com #254

leeeex opened this issue Feb 18, 2024 · 20 comments

Comments

@leeeex
Copy link

leeeex commented Feb 18, 2024

Hello ,
I hope this message finds you well. I am reaching out to report an issue that I encountered while using your project.
Description: I encountered a ConnectTimeout error when attempting to connect to telemetry.crewai.com on port 4318. The error message is as follows:

requests.exceptions.ConnectTimeout: HTTPConnectionPool(host='telemetry.crewai.com', port=4318): Max retries exceeded with url: /v1/traces (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f34caf38280>, 'Connection to telemetry.crewai.com timed out. (connect timeout=10)')

@Mirgiacomo
Copy link

Mirgiacomo commented Feb 20, 2024

Follow, same error:

raise MaxRetryError(_pool, url, reason) from reason # type: ignore[arg-type].

WARN urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='telemetry.crewai.com', port=4318): Max retries exceeded with url: /v1/traces (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x1378487c0>, 'Connection to telemetry.crewai.com timed out. (connect timeout=10)')).

@ansunsujoe
Copy link

Related, but I am not able to run CrewAI due to the fact that it hits telemetry.crewai.com which I can't access through my company's proxy. It would be nice if the user could choose to optionally disable telemetry.

@lm150
Copy link

lm150 commented Feb 23, 2024

Please fix this. I'm in the same situation as telemetry.crewai.com is blocked for my company as well.

@slaughters85j
Copy link

slaughters85j commented Feb 27, 2024

I cant even hit it in my local environment with telnet.

% telnet telemetry.crewai.com 4318
Trying 10.0.0.1...
telnet: connect to address 10.0.0.1: Connection refused
Trying fd6e:6c73:b178:1::1...
telnet: connect to address fd6e:6c73:b178:1::1: Connection refused
telnet: Unable to connect to remote host

I also get this about a hundred times during runtime:

requests.exceptions.ConnectTimeout: HTTPConnectionPool(host='telemetry.crewai.com', port=4318): Max retries exceeded with url: /v1/traces (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x7f34caf38280>, 'Connection to telemetry.crewai.com timed out. (connect timeout=10)')

@chrissonntag
Copy link

I agree to the previous speaker. Their must be a setting to turn those requests off. You can leave them on by default but allow disabling them for good. In best case it'd be a env var so that we do not need to do it over and over again.

@eleqtrizit
Copy link

I want to add to this.

@heyfixit
Copy link
Contributor

heyfixit commented Mar 1, 2024

it's not pretty, but a tiny bit of monkey patching might get ya there. Mind the typo on crewai.telemtry at the moment (have a PR to fix that one: #295 ).

from crewai.telemtry import Telemetry

def noop(*args, **kwargs):
    # with open("./logfile.txt", "a") as f:
    #     f.write("Telemetry method called and noop'd\n")
    pass


for attr in dir(Telemetry):
    if callable(getattr(Telemetry, attr)) and not attr.startswith("__"):
        setattr(Telemetry, attr, noop)

@psikosen
Copy link

Bump, still is happening on my side, has a fix been pushed to pip ?

@vipulnath
Copy link

I am also facing the same issue even after this.

@chrissonntag
Copy link

Issue #241 has been closed without any comments. We can assume at this point that there is no interest what so ever to implement a flag to turn of the telemetry calls.

@psikosen
Copy link

Yup np, I notice the issue doesn't happen while using Ollama, only while using lmstudio. So it's fine to close.

@eleqtrizit
Copy link

eleqtrizit commented Mar 19, 2024

It's not fine to close. It happens when the telemetry url is being blocked by a firewall. What you're using has nothing to do with the whether it is OK or not.

It does look like there is a new flag, 'telemetry' for the crew to disable.

@pudimKBM
Copy link

Hey i have a fix for this you can just disable the telemetry calls on the tool usage class and in the crew class

Like below
C:/User/.../your-env/site-packages/crewai/crew.py
C:/User/.../your-env/site-packages/crewai/tools/tool_usage.py

You can comment all the telemetry related stuff and should work fine again

@mabry1985
Copy link

bumped, this is an issue still and needs to be resolved. Add an opt out completely option.

@gardner
Copy link

gardner commented Mar 30, 2024

I just published a pypi package from my opt-out branch: https://pypi.org/project/crewai-clean/

You need to set CREWAI_TELEMETRY_OPT_OUT=True in your environment.

Please test it out and leave a comment on #402

gardner added a commit to gardner/crewAI that referenced this issue May 8, 2024
@alexjst
Copy link

alexjst commented May 14, 2024

I just hit the same problem. I disabled telemetry with one line change to the file "<python_lib_dir>/site-packages/crewai/telemetry/telemetry.py" shown as diff below:

- self.ready = True
+ self.ready = False

Indeed, crewai should probably provide an option to allow clients to opt out of telemetry. In my case, the company's security policy wouldn't allow this without legal process and approval.

@Yamijalaa
Copy link

I faced the same issue as above. Please help me in resolving this:

requests.exceptions.ConnectTimeout: HTTPConnectionPool(host='telemetry.crewai.com', port=4318): Max retries exceeded with url: /v1/traces (Caused by ConnectTimeoutError(<urllib3.connection.HTTPConnection object at 0x000002311B65F310>, 'Connection to telemetry.crewai.com timed out. (connect timeout=10)'))

@gardner
Copy link

gardner commented May 16, 2024

@Yamijalaa

Set the env var OTEL_SDK_DISABLED=true

import os
from crewai import Agent, Task, Crew, Process
from crewai_tools import SerperDevTool

os.environ["OTEL_SDK_DISABLED"] = "true"

@johnisanerd
Copy link

@gardner , I did this as well, just slightly differently:

OTEL_SDK_DISABLED = "true"

I get the following message over and over, but the failures were making the output completely unreadable.

2024-05-22 21:49:28,225 - 8099684480 - __init__.py-__init__:1198 - WARNING: SDK is disabled.

@gardner
Copy link

gardner commented May 25, 2024

@johnisanerd that warning looks like it come from the Open Telemetry Python SDK here.

If you add this to your /etc/hosts file:

127.0.0.1	telemetry.crewai.com

You will not see connection errors.

To test if OTEL_SDK_DISABLED has an effect:

If you then run without OTEL_SDK_DISABLED being set, you will see the connection errors. This indicates the underlying OpenTelemetry SDK is succesfully disabled when setting OTEL_SDK_DISABLED = "true"

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