brocaar / chirpstack-application-server

ChirpStack Application Server is an open-source LoRaWAN application-server.
https://www.chirpstack.io
MIT License
498 stars 325 forks source link

Cannot send REST request to /api/devices without applicationID #620

Open Zakini opened 3 years ago

Zakini commented 3 years ago

What happened?

GET requests to /api/devices always result in a 500 response with the body:

{
  "error": "subject must be user",
  "code": 2,
  "message": "subject must be user",
  "details": []
}

What did you expect?

A 200 response with a list of devices

Steps to reproduce this issue

Steps:

  1. Send a request to /api/devices with a grpc-metadata-authorization header with a valid API token (no query params, no request body)
  2. Get a 500 response

Your Environment

Component Version
Application Server v3.16
Network Server v3.14

This was raised in #530 in this comment and @brocaar asked for a separate ticket but as far as I can tell that didn't get created. As mentioned in that comment, specifying an applicationID fixes the issue, but the API docs don't mention this param being required.

liangyuanpeng commented 2 years ago

send REST request to /api/devices without applicationID

Work from my side. tested two version.

~ # ./lora-app-server version
3.4.0
~ # ./lora-app-server version
3.3.1