Skip to content

GET /relays/{device_id} returns HTTP 404 for an existing relay #7938

Description

@StevenCellist

Summary

The API fails to resolve the info needed for the GET request, see https://www.thethingsindustries.com/docs/api/reference/http/routes/#nsapplications{end_device_ids.application_ids.application_id}relays{end_device_ids.device_id}-get. It consistently returns HTTP 404 errors, "relay_not_found".

Steps to Reproduce

  1. Create a device named lorawan-relay in an application named some-app.

  2. POST to the endpoint /relays with the following body:

{
  "end_device_ids": {
    "device_id": "lorawan-relay",
    "application_ids": { "application_id": "some-app" }
  },
  "settings": {
    "serving": {
      "default_channel_index": 0,
      "cad_periodicity": "RELAY_CAD_PERIODICITY_1_SECOND",
      "second_channel": {
        "frequency": "869525000",
        "data_rate_index": "DATA_RATE_3",
        "ack_offset": "RELAY_SECOND_CH_ACK_OFFSET_200"
      },
      "limits": {
        "reset_behavior": "RELAY_RESET_LIMIT_COUNTER_RELOAD_RATE",
        "overall":         { "bucket_size": "RELAY_LIMIT_BUCKET_SIZE_4", "reload_rate": 8 },
        "uplink_messages": { "bucket_size": "RELAY_LIMIT_BUCKET_SIZE_2", "reload_rate": 4 },
        "join_requests":   { "bucket_size": "RELAY_LIMIT_BUCKET_SIZE_1", "reload_rate": 2 },
        "notifications":   { "bucket_size": "RELAY_LIMIT_BUCKET_SIZE_1", "reload_rate": 2 }
      }
    }
  }
}

This returns HTTP200 on the first go and HTTP409 on a subsequent request with the following body, showing that it really exists:

{
    "code": 6,
    "message": "error:pkg/networkserver:relay_already_exists (relay already exists)",
    "details": [
        {
            "@type": "type.googleapis.com/ttn.lorawan.v3.ErrorDetails",
            "namespace": "pkg/networkserver",
            "name": "relay_already_exists",
            "message_format": "relay already exists",
            "correlation_id": "9eec9d7f1d6141488bf0122fe355fc70",
            "code": 6
        }
    ]
}
  1. GET to the endpoint /relays/lorawan-relay with the following body:
{
  "end_device_ids": {
    "device_id": "lorawan-relay",
    "application_ids": { "application_id": "some-app" }
  }
}

This returns HTTP404 with the following body:

{
    "code": 5,
    "message": "error:pkg/networkserver:relay_not_found (relay not found)",
    "details": [
        {
            "@type": "type.googleapis.com/ttn.lorawan.v3.ErrorDetails",
            "namespace": "pkg/networkserver",
            "name": "relay_not_found",
            "message_format": "relay not found",
            "correlation_id": "920f7731bcf24b2c91297cd49270e04d",
            "code": 5
        }
    ]
}

Current Result

See above - the API doesn't support the Relay GET command. I am able to delete it however using the DELETE command, showing the the path /relays/{device_id} in itself is fine.

Expected Result

The API should return info such as listed in the API examples.

Relevant Logs

URL

No response

Deployment

The Things Stack Sandbox

The Things Stack Version

3.36.1

Client Name and Version

PostMan

Other Information

No response

Proposed Fix

No response

Contributing

  • I can help by doing more research.
  • I can help by implementing a fix after the proposal above is approved.
  • I can help by testing the fix before it's released.

Validation

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs/triageWe still need to triage this

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions