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

Broken Pipe Error During Agent Web Update #128

Open
engacs opened this issue Sep 17, 2024 · 1 comment
Open

Broken Pipe Error During Agent Web Update #128

engacs opened this issue Sep 17, 2024 · 1 comment

Comments

@engacs
Copy link

engacs commented Sep 17, 2024

Dear Frappe Agent,

I’m encountering a BrokenPipeError when attempting to update the agent via the web interface in your Frappe Agent repository.

Here’s a snippet of the error:

Data:
{
    "data": {
        "branch": "master",
        "url": "https://github.com/frappe/agent"
    },
    "headers": {
        "Authorization": "bearer [Hidden]",
        "X-Agent-Job-Id": null
    },
    "method": "POST",
    "result": {
        "error": [
            "Traceback (most recent call last):",
            "  File \"/home/frappe/agent/env/lib/python3.10/site-packages/flask/app.py\", line 1949, in full_dispatch_request",
            "    rv = self.dispatch_request()",
            "  File \"/home/frappe/agent/env/lib/python3.10/site-packages/flask/app.py\", line 1935, in dispatch_request",
            "    return self.view_functions[rule.endpoint](**req.view_args)",
            "  File \"/home/frappe/agent/repo/agent/web.py\", line 1135, in update_agent",
            "    )",
            "  File \"/home/frappe/agent/repo/agent/server.py\", line 527, in update_agent_web",
            "    self.execute(\"git reset --hard\", directory=directory)",
            "  File \"/home/frappe/agent/repo/agent/base.py\", line 81, in execute",
            "  File \"/home/frappe/agent/repo/agent/base.py\", line 199, in log",
            "BrokenPipeError: [Errno 32] Broken pipe"
        ]
    },
    "url": "[Hidden for Security]:443/agent/update",
    "user": "Administrator"
}

The error occurs when the application tries to log data via print(json.dumps(data)). Additionally, I’ve verified that the supervisorctl restart command is working correctly, and the server responds with a 500 INTERNAL SERVER ERROR after the request.

Could you please advise on how to resolve this or if there’s any fix available?

Thank you for your support.

@engacs
Copy link
Author

engacs commented Sep 17, 2024

Dear Frappe Agent,

I resolved the agent update issue by running the following on the server CLI:

git config --global --add safe.directory /home/frappe/agent/repo
agent update

This worked fine. However, I still encounter the error when updating through the Manager Press on action update. Could you help with this discrepancy?

Thanks,

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

1 participant