``` Plan apply failed: Unauthorized ``` what does ...
# general
b
Copy code
Plan apply failed: Unauthorized
what does this mean? it seems to only happen on one stack...? 🤔
w
Is that the full context? What is the name of the stack in question?
b
Copy code
Resources:
    + 19 to create
    ~ 2 to update
    - 1 to delete
    +-47 to replace
    69 changes. 7 unchanged

Do you want to perform this update? yes
Updating (nightly):

     Type                              Name              Status                   Info
     pulumi:pulumi:Stack               cfm-nightly       **failed**               1 error
 +-  └─ kubernetes:extensions:Ingress  dispatch-nightly  **replacing failed**     1 error

Diagnostics:
  pulumi:pulumi:Stack (cfm-nightly):
    error: update failed

  kubernetes:extensions:Ingress (dispatch-nightly):
    error: Plan apply failed: Unauthorized

Resources:
    2 unchanged

Duration: 2s
w
It does not appear that this came from api.pulumi.com, so my guess is that you are having an issue authenticating with your Kubernetes cluster. Is that possible? You may be able to get more info with verbose logs
pulumi up --logtostderr -v=9
.
b
it doesn't seem to be. if i
console.log
the kubeconfig, it works. and using the same code on a different stack, i don't get that error. and i checked to make sure my digitalocean token is the same for both stacks. hmm.
w
Did you try the verbose logs? Is there any detail on what API call is returning the error?
b
i did. it didn't seem to give much information? here's some relevant stuff:
Copy code
I0830 18:18:13.009015   30010 provider_plugin.go:1047] provider received rpc error `Unknown`: `Unauthorized`
...
I0830 18:18:13.354098   30010 step_executor.go:321] StepExecutor worker(2): step delete-replaced on urn:pulumi:nightly::cfm::k8sjs:service:ServiceDeployment$kubernetes:extensions/v1beta1:Ingress::dispatch-nightly failed with an error: Unauthorized
I0830 18:18:13.354147   30010 step_executor.go:321] StepExecutor worker(2): step delete-replaced on urn:pulumi:nightly::cfm::k8sjs:service:ServiceDeployment$kubernetes:extensions/v1beta1:Ingress::dispatch-nightly failed, signalling cancellation
I0830 18:18:13.354187   30010 plan_executor.go:185] planExecutor.Execute(...): context finished: context canceled
...
I0830 18:18:13.356600   30010 provider_plugin.go:933] Provider[digitalocean, 0xc0038d81e0].Invoke(digitalocean:index/getKubernetesCluster:getKubernetesCluster) failed: transport is closing                                                                                      
I0830 18:18:13.370113   30010 langruntime_plugin.go:156] langhost[nodejs].Run(pwd=/home/chuck/le-codes/cfm-pulumi,program=.,...,dryrun=false) failed: err=transport is closing
everything before that seems to be just marshalling/unmarshalling
unless you can think of some keywords to look for in the logs that i might have missed?
w
Are there lines between the first two messages above? Would be useful to see those.
b
i ran it again and
getKubernetesCluster
worked, so now what's between those first two is simply marshall+unmarshall the kubeconfig i get from
getKubernetesCluster
, and these lines:
Copy code
I0830 19:06:35.656583   22895 eventsink.go:60] , obj={"wrappers_":{"1":{"arr_":[],"map_":{"name":{"key":"name","value":[null,null,"cfm-nightly"],"valueWrapper":{"wrappers_":null,"arrayIndexOffset_":-1,"array":[null,null,"cfm-nightly"],"pivot_":1.7976931348623157e+308,"conve
rtedPrimitiveFields_":{}}}},"arrClean":false}},"arrayIndexOffset_":-1,"array":[[]],"pivot_":1.7976931348623157e+308,"convertedPrimitiveFields_":{}}
I0830 19:06:35.656620   22895 eventsink.go:63] eventSink::Debug(<{%reset%}>, obj={"wrappers_":{"1":{"arr_":[],"map_":{"name":{"key":"name","value":[null,null,"cfm-nightly"],"valueWrapper":{"wrappers_":null,"arrayIndexOffset_":-1,"array":[null,null,"cfm-nightly"],"pivot_":1.
7976931348623157e+308,"convertedPrimitiveFields_":{}}}},"arrClean":false}},"arrayIndexOffset_":-1,"array":[[]],"pivot_":1.7976931348623157e+308,"convertedPrimitiveFields_":{}}<{%reset%}>)
I0830 19:06:35.773512   22895 snapshot.go:496] SnapshotManager.markOperationComplete(urn:pulumi:nightly::cfm::k8sjs:service:ServiceDeployment$kubernetes:extensions/v1beta1:Ingress::dispatch-nightly)
I0830 19:06:35.773532   22895 step_executor.go:321] StepExecutor worker(4): step same on urn:pulumi:nightly::cfm::random:index/randomId:RandomId::mongo-suffix retired
I0830 19:06:35.773679   22895 source_eval.go:816] ResourceMonitor.RegisterResource operation finished: t=random:index/randomId:RandomId, urn=urn:pulumi:nightly::cfm::random:index/randomId:RandomId::mongo-suffix, stable=true, #stables=0 #outs=7
oh, and this line:
Copy code
I0830 19:06:35.653467   22895 provider_plugin.go:953] Provider[digitalocean, 0xc00090c000].Invoke(digitalocean:index/getKubernetesCluster:getKubernetesCluster) success (#ret=14,#failures=0) success
it looks like something is just completely foobared with this cluster... it knew about the cluster, but for some reason, doing a
pulumi destroy
, didn't destroy it.
so i manually deleted the cluster from digital ocean, i guess the stack just got into a weird state somehow.
yeah, i think the state file was probably corrupted or something. taking a look at the activity of the stack on app.pulumi.com makes no sense.
for instance, that destroy told me that 10 resources were deleted, but it only shows that 3 resources were deleted