fetchai / uAgents

A fast and lightweight framework for creating decentralized agents with ease.
Apache License 2.0
995 stars 241 forks source link

[dispenser]: Failed to send envelope: invalid state #542

Closed MehulG closed 4 weeks ago

MehulG commented 1 month ago

Prerequisites

Category

Bug (unexpected behavior)

Expected Behavior

We are encountering errors related to the dispenser in the agent logs. The error occurs when agents attempt to interact but fail to resolve the destination endpoint. Could you help us understand this error better?

Observed Behavior

dispenser error in agent logs. Error from user is understood in this scenario pertaining to lack of agent registration on almanac contract.

To Reproduce

No response

Version

v0.15.2

Environment Details (Optional)

python = "^3.9.19"
uagents = { version = "0.15.2", python = ">=3.9.19,<3.13" }
googleapis-common-protos= "1.61.0"
isort = "^5.12.0"
black = "^23.1.0"
python-dotenv = "^1.0.0"
tortoise-orm = "^0.19.3"
pygame = "^2.2.0"
requests = "^2.28.2"
cosmpy = "0.9.2"
fastapi = "0.115.0"
certifi = "^2023.5.7"
fluent-logger = "^0.10.0"

Failure Logs (Optional)

10/7/2024, 11:06:40 AM ERROR: [ user]: Unable to resolve destination endpoint

10/7/2024, 11:06:35 AM ERROR: [ user]: Unable to resolve destination endpoint

10/7/2024, 11:06:32 AM ERROR: [ user]: Unable to resolve destination endpoint

10/7/2024, 11:06:29 AM INFO: [ user]: Current Queue Size = 2

10/7/2024, 11:06:29 AM INFO: [ user]: Order added successfully

10/7/2024, 11:06:29 AM INFO: [ user]: Create Event Captured = 4A02AB3B1453CE2E7B9D902313E20277E3C31E50F7B665EB20FE05E832F89358

10/7/2024, 11:06:23 AM ERROR: [dispenser]: Failed to send envelope: invalid state

10/7/2024, 11:06:23 AM ERROR: [dispenser]: Failed to send envelope: invalid state

10/7/2024, 11:06:23 AM ERROR: [dispenser]: Failed to send envelope: invalid state

10/7/2024, 11:06:10 AM ERROR: [ user]: Timeout waiting for dispense response

10/7/2024, 11:05:40 AM ERROR: [ user]: Timeout waiting for dispense response

10/7/2024, 11:05:10 AM ERROR: [ user]: Timeout waiting for dispense response

10/7/2024, 11:04:26 AM ERROR: [ user]: Unable to resolve destination endpoint

10/7/2024, 11:04:25 AM ERROR: [ user]: Unable to resolve destination endpoint

10/7/2024, 11:04:23 AM ERROR: [ user]: Unable to resolve destination endpoint

10/7/2024, 11:04:01 AM ERROR: [ user]: Unable to resolve destination endpoint

10/7/2024, 11:03:58 AM ERROR: [dispenser]: Failed to send envelope: invalid state

10/7/2024, 11:03:42 AM ERROR: [ user]: Timeout waiting for dispense response

Additional Information (Optional)

No response

Archento commented 1 month ago

Thank you for raising this issue.

As I see it there are multiple errors in your current scenario and without the code or at least a minimal reproducible example I'm afraid we can't help you. Please provide more details so that we can evaluate the origin of the error.

In general: if the user agent is unable to resolve the destination endpoint it may have a cascading effect on your agent logic. From the log you've provided I can see that nothing is being sent which makes sense since no endpoint could be resolved and the phrase invalid state hints at an unresolved future (which again makes sense since the agent couldn't send the message).

If your question in general is about the verbosity of the agent logs then I propose rephrase this or open another issue.

Archento commented 4 weeks ago

Closing this issue as there hasn't been a follow up and I've yet to see a minimal reproducible example. Please open another issue if this problem persists and be sure to focus on how to reproduce this.