Title
#fleet
j

Jason

01/28/2022, 1:37 PM
Hm, I know I've done this before -- but I'm getting a 500 when trying to
fleetctl apply -f
1:38 PM
it lists
fleetctl get options > options.yaml
1:38 PM
when it should be
fleetctl get config > <filename>
Lucas Rodriguez

Lucas Rodriguez

01/28/2022, 2:03 PM
Hi! Could you share us the full output when running
fleetctl apply -f
?
2:07 PM
Also this page - https://github.com/kolide/fleet/blob/master/docs/cli/setup-guide.md needs a small fix
That's the old repository: https://github.com/kolide/fleet#fleet-is-retired This is the official fleet repository: https://github.com/fleetdm/fleet
2:08 PM
Apart from the docs in Github, we have: https://fleetdm.com/docs
j

Jason

01/28/2022, 2:10 PM
oh ha - sorry about that. Google messed me up there 🙂
2:10 PM
❯ ./fleetctl apply -f ./fleetconfig.yml
applying fleet config: apply config received status 500 forbidden: forbidden
2:11 PM
Thanks @Lucas Rodriguez!
Lucas Rodriguez

Lucas Rodriguez

01/28/2022, 2:11 PM
Also, please share fleetctl's version. If you get a 500 you could check
fleet serve
logs.
j

Jason

01/28/2022, 2:12 PM
 ./fleetctl --version
fleetctl - version 4.9.0
  branch: 	HEAD
  revision: 	3018ad0fb45f7f6422b3d12e6a9f4e17d1079420
  build date: 	2022-01-22
  build user: 	runner
  go version: 	go1.17.2
Lucas Rodriguez

Lucas Rodriguez

01/28/2022, 2:15 PM
OK, let us know if you can get
fleet serve
logs that correspond to the 500 (anything with
level=error
)
j

Jason

01/28/2022, 2:37 PM
Ok will do
Lucas Rodriguez

Lucas Rodriguez

01/28/2022, 2:39 PM
forbidden
generally means the user you are logged in as in
fleetctl
is not authorized to apply the config. But the server logs should tell us what's really going on.
j

Jason

01/28/2022, 2:58 PM
hi @Lucas Rodriguez - I've got this
2:58 PM
{
  "component": "http",
  "err": "forbidden",
  "internal": "Missing authorization check",
  "level": "info",
  "path": "/api/v1/fleet/config",
  "ts": "2022-01-28T14:10:40.330143989Z"
}
3:00 PM
my config for fleetctl is using an API token and not username/pw - if that helps
Lucas Rodriguez

Lucas Rodriguez

01/28/2022, 3:02 PM
OK, by grabbing the token from the UI and editing
~/.fleet/config
?
3:03 PM
Also, what's the
Role
of the account? (under "My Account")
3:03 PM
Are you able get config?
fleetctl get config
j

Jason

01/28/2022, 3:08 PM
correct on the config file
3:08 PM
My role is "Admin"
3:09 PM
yes, I can
get config
- that's how I grabbed the config to edit, now trying to upload the revised version
Lucas Rodriguez

Lucas Rodriguez

01/28/2022, 3:17 PM
OK, could you share the config you are trying to apply? (please do redact any sensitive information) We'll be trying to reproduce on our end.
j

Jason

01/28/2022, 3:20 PM
I can tell you exactly what I am doing (it's very simply)
3:21 PM
I just want to change the host decorator
3:21 PM
so I am dumping the config and changing one line
3:21 PM
- SELECT hostname AS hostname FROM system_info;
to
3:21 PM
- SELECT computer_name AS hostname FROM system_info;
Lucas Rodriguez

Lucas Rodriguez

01/28/2022, 3:22 PM
OK, that makes sense. Will open a Github issue. One last thing, can you confirm the version of the fleet server is also 4.9.0?
j

Jason

01/28/2022, 3:22 PM
yes it is
3:22 PM
I will try using a username/pw in a minute to see if that fixes it
Lucas Rodriguez

Lucas Rodriguez

01/28/2022, 3:24 PM
{"component":"http","err":"forbidden","internal":"Missing authorization check","level":"info","path":"/api/v1/fleet/config","ts":"2022-01-28T14:10:40.330143989Z"}
Any other error logs around this? (to add to the Github issue.)
3:27 PM
Also, you mentioned you were admin, are you a global admin? as in:
j

Jason

01/28/2022, 3:27 PM
checking now
Lucas Rodriguez

Lucas Rodriguez

01/28/2022, 3:27 PM
j

Jason

01/28/2022, 3:27 PM
it seems I also cannot create a new user (probably same root case)
3:29 PM
oh nevermind - that one was because of a duplicate email address
Lucas Rodriguez

Lucas Rodriguez

01/28/2022, 3:31 PM
Also, you mentioned you were admin, are you a global admin? as in:
Under "My Account"
3:31 PM
(My mistake, you are probably running Fleet Free, which doesn't have Teams support 🙂
3:32 PM
Here it is: https://github.com/fleetdm/fleet/issues/3913, feel free to add any extra information there.
j

Jason

01/28/2022, 3:32 PM
thx
Lucas Rodriguez

Lucas Rodriguez

01/28/2022, 3:33 PM
Like the error logs surrounding the "Missing authorization check" error.
j

Jason

01/28/2022, 3:33 PM
ok
3:33 PM
also - I created that local user
3:33 PM
(deleted my config file)
3:33 PM
and i can
fleetctl login
3:33 PM
but when I get config - it wants me to log in again
3:33 PM
❯ ./fleetctl get config
Invalid session. Please log in with: fleetctl login
3:34 PM
running fleetctl on an m1 mac, btw
Lucas Rodriguez

Lucas Rodriguez

01/28/2022, 3:34 PM
OK, does
fleetctl login
run successfully?
j

Jason

01/28/2022, 3:36 PM
[+] Fleet login successful and context configured!
Lucas Rodriguez

Lucas Rodriguez

01/28/2022, 3:37 PM
Could this be a mixture of running a local
./fleetctl
vs a system installed
fleetctl
(without
./
)?
j

Jason

01/28/2022, 3:37 PM
oh, I'm running it with ./
3:38 PM
./fleetctl xyz
Lucas Rodriguez

Lucas Rodriguez

01/28/2022, 3:38 PM
Ack
j

Jason

01/28/2022, 3:38 PM
I should try it with linux maybe
3:38 PM
m1 strangeness maybe ? haven't run into it yet, but thats not to say it couldn't happen
Lucas Rodriguez

Lucas Rodriguez

01/28/2022, 3:38 PM
Could be, added that to the issue.
3:39 PM
You could inspect the
~/.fleet/config
file and check if the content makes sense.
3:40 PM
(that's what
fleetctl
uses/sets)
3:40 PM
E.g. in my test case:
contexts:
  default:
    address: <https://localhost:8080>
    email: <mailto:lucas@fleetdm.com|lucas@fleetdm.com>
    token: [...]
j

Jason

01/28/2022, 3:51 PM
yeah, I checked that too - seems fine
3:52 PM
rootca is blank, but it's a publicly trusted cert
Lucas Rodriguez

Lucas Rodriguez

01/28/2022, 5:21 PM
OK, feel free to post any updates on the linked issue.
Noah Talerman

Noah Talerman

02/02/2022, 2:36 PM
Hey @Jason, were you able to resolve this issue?
j

Jason

02/02/2022, 10:07 PM
hi @Noah Talerman - I have not.... I've been stuck on another "on fire" thing and have not had a chance.
Lucas Rodriguez

Lucas Rodriguez

02/04/2022, 6:05 PM
@Jason Whenever possible, please attach the
config.yml
you were trying to apply here or in https://github.com/fleetdm/fleet/issues/3913 (with sensitive fields redacted). We cannot seem to reproduce 😕 /cc @Reed Haynes
j

Jason

02/04/2022, 6:30 PM
Thanks Lucas - I am going to try once more and get back to you. It's possible it was our WAF, I will investigate.