Skip to content

[Bug]: illegal IP address string passed to inet_aton during discovery process #765

@araujof

Description

@araujof

🐞 Bug Summary

All discovery tests fail with the following error when local ipv6 address are discovered:

E   OSError: illegal IP address string passed to inet_aton

mcpgateway/federation/discovery.py:180: OSError
```

---

### 🧩 Affected Component
Select the area of the project impacted:

- [ ] `mcpgateway` - API
- [ ] `mcpgateway` - UI (admin panel)
- [ ] `mcpgateway.wrapper` - stdio wrapper
- [x] Federation or Transports
- [ ] CLI, Makefiles, or shell scripts
- [ ] Container setup (Docker/Podman/Compose)
- [ ] Other (explain below)

---

### 🔁 Steps to Reproduce

1. Environment with local ipv6 interfaces
2. run `make test`
3. All discovery tests should fail

---

### 🤔 Expected Behavior
What should have happened instead?
The local address discovery should filter out invalid addresses. 

---

### 🧠 Environment Info
You can retrieve most of this from the `/version` endpoint.

| Key | Value |
|-----|-------|
| Version or commit | `main@2ff0179` |
| Runtime | `Python 3.11` |
| Platform / OS | `macOS` |
| Container | `none (Rancher installed in the machine)` |

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions