Fail to use Multicast-groups as non global user

Hi there,
I’ve met some strange issue that appears only if I build code from sources.
When I use binaries from web site everythings works.
But when I build app-server from source and login as organization admin user (but not global admin) I can’t access Multicast-group page.

In logs I see error:
lora-app-server[21775]: level=info msg=“finished unary call with code Unauthenticated” error=“rpc error: code = Unauthenticated desc = client must be global admin for unfiltered request” grpc.code=Unauthenticated grpc.method=List grpc.service=api.MulticastGroupService

I used pure github code to build binary without any changes. But this behavior is different from those if I take ready to use binary.

What could be the issue?

p.s. using global admin user everything works

What version are you trying to build and what’s your Go version? Did you make any changes to the API protos?

I believe you may get this behavior when building with a different version of grpc-gateway, such that some parameters won’t get passed because of difference in names (e.g., organizationID versus organization_id) and thus resulting in an authenticated error for an organization admin (whereas a global admin has no problem listing every group). You can confirm this by creating multicast-groups for different organizations then trying to get the list for an organization as a global admin and getting list of all multicast-groups instead of only the organization’s ones. Or you could just check the request in the browser’s inspector (i.e., you should see something like https://your-host/api/multicast-groups?limit=10&organizationID=3) or try it out doing some manual requests.

Anyway, if that’s you issue, enabling Go modules (needs ate least Go 1.11 for experimental support, and is officially supported in Go 1.12) to build should fix this as it’ll use the correct version to compile the protos.

1 Like

Thank you very much, you helped me!
I was building the last current version v2.5.1. using go version 1.11.
Not sure about how clean was my modules and actually go files could be also mixed with 1.10 version.
I’ve checked the behaviour and found that it is exactly as you described - global admin see same all multicast groups in every organization.

I’ve cleaned my go files, removed everything, then installed 1.12 version and it helped!
Then I checked that grpc-gateway is actually v.1.7.0 as it should be based on go.mod file but it worked already and this step is excessive.

Thank you!