agent-lightning icon indicating copy to clipboard operation
agent-lightning copied to clipboard

[BUG] Error uploading logfile: POST request failed: HTTPConnectionPool(host='localhost', port=`RANDOM PORT`)

Open IsaacGHX opened this issue 5 months ago • 2 comments

An error happens when we execute:

import os
from agentlightning import Trainer, DevTaskLoader, LLM
from calc_agent import CalcAgent


def dev_task_loader() -> DevTaskLoader:
    return DevTaskLoader(
        tasks=[
            {
                "question": "What is 2 + 2?",
                "result": "4",
            },
            {
                "question": "What is 3 * 5?",
                "result": "15",
            },
            {
                "question": "What is the square root of 16?",
                "result": "4",
            },
        ],
        resources={
            "main_llm": LLM(
                endpoint="https://api.openai.com/v1", model="gpt-4.1-nano", sampling_parameters={"temperature": 0.7}
            ),
        },
    )


if __name__ == "__main__":
    Trainer(n_workers=1, dev=True, max_tasks=2).fit(CalcAgent(), "http://localhost:9998/", dev_task_loader())

port can be different.

🖇 AgentOps: [agentops.InternalSpanProcessor] Error uploading logfile: POST request failed: HTTPConnectionPool(host='localhost', port=57781): Max retries exceeded with url: /v4/logs/upload/ (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f0e63557d60>: Failed to establish a new connection: [Errno 111] Connection refused'))

🖇 AgentOps: Session Replay for default.session trace: http://localhost:57781/notavailable/sessions?trace_id=6cb23a64f31ca07dd09b8dc042c7b539

openai version is 1.99.9

IsaacGHX avatar Aug 13 '25 14:08 IsaacGHX

The error can be safely ignored. We might address this in future.

ultmaster avatar Aug 13 '25 16:08 ultmaster

#30

mydmdm avatar Aug 25 '25 09:08 mydmdm