Skip to content

127.0.0.1:8080: connect: connection refused #270

@Rayugo

Description

@Rayugo

Diode version

v0.6.0

Deployment type

docker compose

Deployment type version

Docker Compose version v2.34.0

Diode SDK type

diode-sdk-python

Diode SDK version

v0.4.0

Diode NetBox Plugin version

v0.6.0

NetBox version

v4.2.7

Steps to reproduce

The Netbox and Diode are hosted on the same VM (Ubuntu 22.04.03). The steps taken follow the documentation (https://docs.netboxlabs.com/netbox-discovery/agent/get-started/) with most recent version of Netbox (v4.2.7) and all default values. The Netbox installation is the standard one (https://netboxlabs.com/docs/netbox/en/stable/installation/).

configuration.py:

# Expose Prometheus monitoring metrics at the HTTP endpoint '/metrics'
METRICS_ENABLED = False

# Enable installed plugins. Add the name of each plugin to the list.
PLUGINS = [
    "netbox_diode_plugin",
]

PLUGINS_CONFIG = {
    "netbox_diode_plugin": {
        # Auto-provision users for Diode plugin
        "auto_provision_users": True,

        # Diode gRPC target for communication with Diode server
        "diode_target_override": "grpc://localhost:8080/diode",

        # User allowed for Diode to NetBox communication
        "diode_to_netbox_username": "diode-to-netbox",

        # User allowed for NetBox to Diode communication
        "netbox_to_diode_username": "netbox-to-diode",

        # User allowed for data ingestion
        "diode_username": "diode-ingestion",
    },
}

.env:

DIODE_NGINX_PORT=8080
REDIS_PASSWORD=@FmnLoA*VnebyVnZoL.!-.6z
REDIS_HOST=diode-redis
REDIS_PORT=6378
RECONCILER_GRPC_HOST=diode-reconciler
RECONCILER_GRPC_PORT=8081
NETBOX_DIODE_PLUGIN_API_BASE_URL=https://<MY-IP>/api/plugins/diode/
NETBOX_DIODE_PLUGIN_SKIP_TLS_VERIFY=false
DIODE_TO_NETBOX_API_KEY=217c83cc9825d9f0152ca72d7327e81df5fb0345
NETBOX_TO_DIODE_API_KEY=1ecac41983adf9edd262ef8bbd0d28c81cc0c843
DIODE_API_KEY=0689234305aa8cac2501d6d4247388b265325ad8
INGESTER_TO_RECONCILER_API_KEY=sXjJZe6BBzVuovrVyyH4Q3vbceqvDwh2kC3DRpML
LOGGING_LEVEL=DEBUG
SENTRY_DSN=
MIGRATION_ENABLED=true

agent.yaml:

orb:
  config_manager:
    active: local
  backends:
    network_discovery:
    common:
      diode:
        target: grpc://127.0.0.1:8080/diode
        api_key: <my-diode-key>
        agent_name: agent
  policies:
    network_discovery:
      policy_01:
          scope:
            targets:
              - 192.168.0.250

Expected behavior

When running the command;

docker run -v $(pwd):/opt/orb/ -e DIODE_API_KEY=<MY-KEY> netboxlabs/orb-agent:latest run -c /opt/orb/agent.yaml
The connection to the Diode should be sucessfull.

Observed behavior

When running the command;

docker run -v $(pwd):/opt/orb/ -e DIODE_API_KEY=<MY-KEY> netboxlabs/orb-agent:latest run -c /opt/orb/agent.yaml
It gives following error:

{"level":"info","ts":"2025-04-16T12:37:04.909Z","caller":"cmd/main.go:82","msg":"backends loaded","backends":{"common":{"diode":{"agent_name":"agent","api_key":"0689234305aa8cac2501d6d4247388b265325ad8","target":"grpc://localhost:8080/diode"}},"network_discovery":{"host":"localhost","port":"8073"}}}
{"level":"info","ts":"2025-04-16T12:37:04.909Z","caller":"agent/agent.go:144","msg":"agent started","version":"1.2.0","routine":"agentRoutine"}
{"level":"info","ts":"2025-04-16T12:37:04.909Z","caller":"agent/agent.go:80","msg":"registered backends","values":["network_discovery","worker","pktvisor","otel","device_discovery"]}
{"level":"info","ts":"2025-04-16T12:37:04.909Z","caller":"agent/agent.go:81","msg":"requested backends","values":{"common":{"diode":{"agent_name":"agent","api_key":"0689234305aa8cac2501d6d4247388b265325ad8","target":"grpc://localhost:8080/diode"}},"network_discovery":{"host":"localhost","port":"8073"}}}
{"level":"info","ts":"2025-04-16T12:37:04.909Z","caller":"networkdiscovery/network_discovery.go:109","msg":"network-discovery startup","arguments":["--host","localhost","--port","8073","--diode-target","grpc://localhost:8080/diode","--diode-api-key","********","--diode-app-name-prefix","agent"]}
{"level":"info","ts":"2025-04-16T12:37:04.913Z","caller":"networkdiscovery/network_discovery.go:134","msg":"network-discovery stdout","log":"time=2025-04-16T12:37:04.913Z level=INFO msg=\"starting network-discovery server at: localhost:8073\""}
{"level":"info","ts":"2025-04-16T12:37:05.909Z","caller":"networkdiscovery/network_discovery.go:163","msg":"network-discovery process started","pid":22}
{"level":"info","ts":"2025-04-16T12:37:05.911Z","caller":"networkdiscovery/network_discovery.go:169","msg":"network-discovery readiness ok, got version ","network_discovery_version":"0.4.0"}
{"level":"info","ts":"2025-04-16T12:37:05.911Z","caller":"policymgr/manager.go:53","msg":"managing agent policy from core","action":"manage","name":"policy_01","dataset":"f00e0a5e-526a-42fb-aef3-f9804520f648","backend":"network_discovery","id":"e6eb7f0e-8c39-5c6c-a502-44bdb93baae5","version":1}
{"level":"info","ts":"2025-04-16T12:37:05.911Z","caller":"policymgr/manager.go:205","msg":"policy applied successfully","policy_id":"e6eb7f0e-8c39-5c6c-a502-44bdb93baae5","policy_name":"policy_01"}
{"level":"info","ts":"2025-04-16T12:37:05.911Z","caller":"agent/agent.go:161","msg":"heartbeat routine started"}
{"level":"info","ts":"2025-04-16T12:37:06.912Z","caller":"networkdiscovery/network_discovery.go:134","msg":"network-discovery stdout","log":"time=2025-04-16T12:37:06.912Z level=INFO msg=\"running scanner\" targets=[192.168.0.250] policy=policy_01"}
{"level":"info","ts":"2025-04-16T12:37:06.968Z","caller":"networkdiscovery/network_discovery.go:134","msg":"network-discovery stdout","log":"time=2025-04-16T12:37:06.968Z level=ERROR msg=\"error ingesting entities\" error=\"rpc error: code = Unavailable desc = connection error: desc = \\\"transport: Error while dialing: dial tcp 127.0.0.1:8080: connect: connection refused\\\"\" policy=policy_01"}

I've made sure that API keys are correct and that there is no firwall. When logging to the Netbox UI I see that there is Diode plugin installed with Diode target being "grpc://localhost:8080/diode". Ingestion logs are empty.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingstatus: needs triageThis issue is awaiting triage by a maintainer

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions