cf-drain-cli
cf-drain-cli copied to clipboard
Failed to fetch tokens from UAA: Unexpected status code: 401
Hello there,
I'm using cf-drain-cli
v2.0.0 and I have an issue with cf drain-space
command. It doesn't work for me because of 401 Unauthorized error:
$ cf drain-space syslog://logstash-0.logstash.elk.svc.cluster.local:5000 --drain-name my-space-drain
Downloading latest space drain from github...
Done downloading space drain from github.
Creating app my-space-drain in org foo / space bar as admin...
OK
Creating route my-space-drain.example.com...
OK
Binding my-space-drain.example.com to my-space-drain...
OK
Uploading my-space-drain...
Uploading app files from: /tmp/space_drain013638272
Uploading 5.1M, 1 files
Done uploading
OK
Starting app my-space-drain in org foo / space bar as admin...
2019/12/27 09:58:19 uploader-started
2019/12/27 09:58:19 droplet info: https://cc-uploader-cc-uploader.scf.svc.cluster.local:9091/v1/droplet/ced4177b-57be-478d-bd2e-335c1775dc39?cc-droplet-upload-uri=https://api.scf.svc.cluster.local:9023/internal/v4/droplets/ced4177b-57be-478d-bd2e-335c1775dc39/upload /out/droplet.tgz
2019/12/27 09:58:21 uploader-done
0 of 1 instances running, 1 starting
0 of 1 instances running, 1 crashed
$
$ kubectl get pods -n eirini
NAME READY STATUS RESTARTS AGE
cf-demo-bar-ab2f79d86b-0 1/1 Running 0 6d17h
my-space-drain-bar-593961f8e0-0 0/1 CrashLoopBackOff 5 4m8s
$
$ cf apps
Getting apps in org foo / space bar as admin...
OK
name requested state instances memory disk urls
cf-demo started 1/1 768M 1G cf-demo-shy-sable-vc.example.com
my-space-drain started 0/1 1G 1G my-space-drain.example.com
$
$ cf logs my-space-drain
Retrieving logs for app my-space-drain in org foo / space bar as admin...
2019-12-27T10:11:04.00+0000 [APP/PROC/WEB/0] OUT ARGS: [/lifecycle/launch]
2019-12-27T10:11:04.00+0000 [APP/PROC/WEB/0] OUT 2019/12/27 10:11:03 starting space drain...
2019-12-27T10:11:04.00+0000 [APP/PROC/WEB/0] OUT 2019/12/27 10:11:04 Failed to fetch tokens from UAA: Unexpected status code: 401
2019-12-27T10:11:05.12+0000 [API/0] OUT Process has crashed with type: "web"
2019-12-27T10:11:05.14+0000 [API/0] OUT App instance exited with guid fe22830f-90a9-4881-a240-c2dbcd45e270 payload: {"instance"=>"my-space-drain-bar-593961f8e0-0", "index"=>0, "cell_id"=>"", "reason"=>"Error", "exit_status"=>1, "exit_description"=>"Error", "crash_count"=>4, "crash_timestamp"=>3, "version"=>"60db6a07-d4fc-4d48-ae6d-e4432354432a"}
2019-12-27T10:11:10.01+0000 [API/0] OUT Process has crashed with type: "web"
2019-12-27T10:11:10.02+0000 [API/0] OUT App instance exited with guid fe22830f-90a9-4881-a240-c2dbcd45e270 payload: {"instance"=>"my-space-drain-bar-593961f8e0-0", "index"=>0, "cell_id"=>"", "reason"=>"CrashLoopBackOff", "exit_status"=>1, "exit_description"=>"Error", "crash_count"=>4, "crash_timestamp"=>3, "version"=>"60db6a07-d4fc-4d48-ae6d-e4432354432a"}
[...]
How can I debug the reason? I'm pretty sure that the credentials are OK.
We have created an issue in Pivotal Tracker to manage this:
https://www.pivotaltracker.com/story/show/170471935
The labels on this github issue will be updated when the story is started.
I can see that you use "cf" for CLIENT_ID
env variable by default. But I don't have that user under my Suse CF installation. I have only "admin" user/client here. So my question is: how should I create "cf" client?