openziti / ziti

The parent project for OpenZiti. Here you will find the executables for a fully zero trust, application embedded, programmable network @OpenZiti
https://openziti.io
Apache License 2.0
2.68k stars 153 forks source link

reflect server: "service {service} not found in ZT" #165

Closed qrkourier closed 3 years ago

qrkourier commented 4 years ago

I created an identity and a service and wish to host the service with Reflect. I've enrolled the identity "kentest" for service "kentest", but Reflect server can not "see" the service.

❯ reflect server --identity ~/Downloads/kentest.json --serviceName kentest --verbose
INFO    attempting to authenticate
DEBUG   logged in as kentest/3pYyg34GR                apiSession=zs9pkqVGg
DEBUG   using apiSession apiSession token 438efa33-5afd-4948-ac7a-dd43d49de8f2
DEBUG   started
PANIC   service 'kentest' not found in ZT
panic: (*logrus.Entry) (0x9f6ce0,0xc0000204d0)

goroutine 1 [running]:
github.com/sirupsen/logrus.Entry.log(0xc0000200e0, 0xc00009fef0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
        /home/kbingham/gopath/src/github.com/sirupsen/logrus/entry.go:255 +0x313
github.com/sirupsen/logrus.(*Entry).Log(0xc000020700, 0x0, 0xc0001e3ce8, 0x1, 0x1)
        /home/kbingham/gopath/src/github.com/sirupsen/logrus/entry.go:283 +0xeb
github.com/sirupsen/logrus.(*Entry).Panic(0xc000020700, 0xc0001e3ce8, 0x1, 0x1)
        /home/kbingham/gopath/src/github.com/sirupsen/logrus/entry.go:321 +0x55
github.com/openziti/sdk-golang/example/reflect/cmd.Server(0xc000188700, 0x7fff2d4fe8d7, 0x7)
        /home/kbingham/gopath/src/github.com/openziti/sdk-golang/example/reflect/cmd/server.go:16 +0x14e
main.main.func2(0xc0000ef340, 0xc000094280, 0x0, 0x5)
        /home/kbingham/gopath/src/github.com/openziti/sdk-golang/example/reflect/main.go:41 +0x75
github.com/spf13/cobra.(*Command).execute(0xc0000ef340, 0xc000094230, 0x5, 0x5, 0xc0000ef340, 0xc000094230)
        /home/kbingham/gopath/src/github.com/spf13/cobra/command.go:846 +0x29d
github.com/spf13/cobra.(*Command).ExecuteC(0xe61b40, 0xc0000dff68, 0x2, 0x2)
        /home/kbingham/gopath/src/github.com/spf13/cobra/command.go:950 +0x349
github.com/spf13/cobra.(*Command).Execute(...)
        /home/kbingham/gopath/src/github.com/spf13/cobra/command.go:887
main.main()
        /home/kbingham/gopath/src/github.com/openziti/sdk-golang/example/reflect/main.go:54 +0x431

❯ ziti edge list services 'name="kentest"'
id: Wcrkzq4GR    name: kentest    terminator strategy: smartrouting    role attributes: ["kentest"]
results: 1-1 of 1

❯ ziti edge version
Version     : v0.15.2
GIT revision: 2d886ff19c7a
Build Date  : 2020-07-21 15:16:47
Runtime     : go1.14.6
{
  "data": [
    {
      "_links": {
        "configs": {
          "href": "./services/Wcrkzq4GR/configs"
        },
        "self": {
          "href": "./services/Wcrkzq4GR"
        },
        "service-edge-router-policies": {
          "href": "./services/Wcrkzq4GR/service-edge-router-policies"
        },
        "service-policies": {
          "href": "./services/Wcrkzq4GR/service-policies"
        },
        "terminators": {
          "href": "./services/Wcrkzq4GR/terminators"
        }
      },
      "createdAt": "2020-08-03T22:59:07.779Z",
      "id": "Wcrkzq4GR",
      "tags": {
        "mopServiceId": "2b85cabc-01ff-45cc-8530-053d33569f71",
        "networkId": "e534d99b-d64b-4a89-a450-c7ab229e2a1d"
      },
      "updatedAt": "2020-08-03T22:59:07.779Z",
      "config": {},
      "configs": [
        "-K9zk3VMg",
        "iK9kkqVMg"
      ],
      "name": "kentest",
      "permissions": [
        "Bind",
        "Dial"
      ],
      "roleAttributes": [
        "kentest"
      ],
      "terminatorStrategy": "smartrouting"
    }
  ],
  "meta": {
    "filterableFields": [
      "terminatorStrategy",
      "id",
      "createdAt",
      "updatedAt",
      "name"
    ],
    "pagination": {
      "limit": 10,
      "offset": 0,
      "totalCount": 1
    }
  }
}
plorenz commented 4 years ago

Can you run policy-advisor and make sure your identity has access to the service, please?

plorenz commented 3 years ago

@qrkourier Let me know if this is still an issue and we can re-open and discuss