Skip to content

Method for waiting properly for request completion and handling errors #493

@deliciouslytyped

Description

@deliciouslytyped

I'm not sure whether I should file this here or on the Python SDK.

Does the Diode API provide for waiting for completion of requests? It seems that the SDK submits requests to a queue which is then handled by the reconciler component, but the returned state/error just belongs to the submission, and not to the state of the request completion itself.

For example, it's possible to submit some data to Diode, but the reconciler can fail, and nothing will show up anywhere other than in the reconciler log output.

Here is an example from running the first Python SDK example in the readme, where I have the diode-to-netbox API key misconfigured:

diode-reconciler-1  | {"time":"2026-03-01T05:04:09.095774115Z","level":"DEBUG","msg":"handling ingest request","request":{"stream":"latest","entities":[{"timestamp":{"seconds":1772341449,"nanos":88315000},"Entity":{"Device":{"name":"Device A","device_type":{"manufacturer":{"name":"Manufacturer A"},"model":"Device Type A"},"role":{"name":"Role ABC"},"platform":{"name":"Platform A","manufacturer":{"name":"Manufacturer A"}},"serial":"123456","asset_tag":"123456","site":{"name":"Site ABC"},"status":"active","tags":[{"name":"tag 1"},{"name":"tag 2"}]}}}],"id":"2d4f350a-a7c4-4659-8d5e-0b7fa34dd838","producer_app_name":"my-test-app","producer_app_version":"0.0.1","sdk_name":"diode-sdk-python","sdk_version":"0.0.0"}}
diode-reconciler-1  | {"time":"2026-03-01T05:04:09.095857584Z","level":"DEBUG","msg":"cache miss - fetching default branch from NetBox plugin"}
diode-reconciler-1  | {"time":"2026-03-01T05:04:09.106549992Z","level":"DEBUG","msg":"cache miss - fetching default branch from NetBox plugin"}
diode-reconciler-1  | {"time":"2026-03-01T05:04:09.155861979Z","level":"WARN","msg":"failed to fetch default branch from NetBox plugin","error":"Get \"http://netbox/api/plugins/diode/default-branch/\": oauth2: \"invalid_client\" \"Client authentication failed (e.g., unknown client, no client authentication included, or unsupported authentication method).\""}
diode-reconciler-1  | {"time":"2026-03-01T05:04:09.158746644Z","level":"DEBUG","msg":"ingested duplicate ingestion log","id":1,"externalID":"992ce2fc-774a-44c2-878c-b31a9b771ff6"}
diode-reconciler-1  | {"time":"2026-03-01T05:04:09.208543036Z","level":"ERROR","msg":"error generating changeset","error":"Post \"http://netbox/api/plugins/diode/generate-diff/\": oauth2: \"invalid_client\" \"Client authentication failed (e.g., unknown client, no client authentication included, or unsupported authentication method).\""}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions