How can I debug `pulumi_command.local.Command` ? F...
# python
e
How can I debug
pulumi_command.local.Command
? For some reason, after altering the command and adding an
asset_paths
argument, creating (and updating) this Resource fails all the time. When I run the command outside of Pulumi it works fine and has a zero exit status. I want to find out which exit status is returned then, and if it's a Pulumi-internal error (I suspect so), I want to know which one.
e
Depends what's wrong with it? A combination of checking debug logs and checking the command themselves work when run manually would normally cover it.
e
Where to look in the debug logs? Nowhere I can spot a failure condition around the command.
e
They write to the filesystem by default but probably easier to add
--logtostderr -v10 --logflow
to your pulumi command to see them all
e
I don’t see anything there that’s helpful here
e
Hard to suggest anything more unless you can give more details as to what's wrong.
d
https://github.com/pulumi/pulumi-command/pull/170 Should be easier in the next release?
e
@dry-keyboard-94795 Yes and no. I already manually inspected stdout and stderr. Nothing unusual there. The asset files are also created normally, by the way. @echoing-dinner-19531 The command line is sensitive unfortunately. I will retry without sensitive params.
The logs remain quite sensitive and opaque ... What line/context should I look for @echoing-dinner-19531? What I found and redacted:
Copy code
I0126 12:47:51.111610   15141 registry.go:174] GetProvider(urn:pulumi:k8s-dev::infra::pulumi:providers:command::local::cb70ac4e-d7e6-4adb-8116-0f56aebbb49d)
I0126 12:47:51.111633   15141 provider_plugin.go:636] Provider[command, 0xc000b4d320].Check(urn:pulumi:k8s-dev::infra::command:local:Command::talosctl_gen_config) executing (#olds=2,#news=2
I0126 12:47:51.111645   15141 rpc.go:74] Marshaling property for RPC[Provider[command, 0xc000b4d320].Check(urn:pulumi:k8s-dev::infra::command:local:Command::talosctl_gen_config).olds]: assetPaths={[{controlplane.yaml} {talosconfig} {worker.yaml}]}
I0126 12:47:51.111661   15141 rpc.go:74] Marshaling property for RPC[Provider[command, 0xc000b4d320].Check(urn:pulumi:k8s-dev::infra::command:local:Command::talosctl_gen_config).olds]: create={talosctl gen config k8s-dev-1 <https://localhost:6443> --config-patch @openebs_patch.yml --registry-mirror <http://docker.io|docker.io>=<https://registry.ipv6.docker.com> --with-examples=false --with-docs=false --with-kubespan=true --with-secrets=secrets.yaml }
I0126 12:47:51.111671   15141 rpc.go:74] Marshaling property for RPC[Provider[command, 0xc000b4d320].Check(urn:pulumi:k8s-dev::infra::command:local:Command::talosctl_gen_config).news]: assetPaths={[{controlplane.yaml} {talosconfig} {worker.yaml}]}
I0126 12:47:51.111681   15141 rpc.go:74] Marshaling property for RPC[Provider[command, 0xc000b4d320].Check(urn:pulumi:k8s-dev::infra::command:local:Command::talosctl_gen_config).news]: create={talosctl gen config k8s-dev-1 <https://localhost:6443> --config-patch @openebs_patch.yml --registry-mirror <http://docker.io|docker.io>=<https://registry.ipv6.docker.com> --with-examples=false --with-docs=false --with-kubespan=true --with-secrets=secrets.yaml }
I0126 12:47:51.112117   15141 eventsink.go:78] eventSink::Infoerr(<{%reset%}>I0126 12:47:51.112071   15157 rpc.go:274] Unmarshaling property for RPC[]: assetPaths={[{controlplane.yaml} {talosconfig} {worker.yaml}]}
<{%reset%}>)
I0126 12:47:51.112147   15141 eventsink.go:78] eventSink::Infoerr(<{%reset%}>I0126 12:47:51.112096   15157 rpc.go:274] Unmarshaling property for RPC[]: create={talosctl gen config k8s-dev-1 <https://localhost:6443> --config-patch @openebs_patch.yml --registry-mirror <http://docker.io|docker.io>=<https://registry.ipv6.docker.com> --with-examples=false --with-docs=false --with-kubespan=true --with-secrets=secrets.yaml }
<{%reset%}>)
I0126 12:47:51.112167   15141 eventsink.go:78] eventSink::Infoerr(<{%reset%}>I0126 12:47:51.112104   15157 rpc.go:274] Unmarshaling property for RPC[]: assetPaths={[{controlplane.yaml} {talosconfig} {worker.yaml}]}
<{%reset%}>)
I0126 12:47:51.112176   15141 eventsink.go:78] eventSink::Infoerr(<{%reset%}>I0126 12:47:51.112111   15157 rpc.go:274] Unmarshaling property for RPC[]: create={talosctl gen config k8s-dev-1 <https://localhost:6443> --config-patch @openebs_patch.yml --registry-mirror <http://docker.io|docker.io>=<https://registry.ipv6.docker.com> --with-examples=false --with-docs=false --with-kubespan=true --with-secrets=secrets.yaml }
<{%reset%}>)
I0126 12:47:51.112242   15141 eventsink.go:78] eventSink::Infoerr(<{%reset%}>I0126 12:47:51.112219   15157 rpc.go:74] Marshaling property for RPC[]: assetPaths={[{controlplane.yaml} {talosconfig} {worker.yaml}]}
<{%reset%}>)
I0126 12:47:51.112277   15141 eventsink.go:78] eventSink::Infoerr(<{%reset%}>I0126 12:47:51.112232   15157 rpc.go:74] Marshaling property for RPC[]: create={talosctl gen config k8s-dev-1 <https://localhost:6443> --config-patch @openebs_patch.yml --registry-mirror <http://docker.io|docker.io>=<https://registry.ipv6.docker.com> --with-examples=false --with-docs=false --with-kubespan=true --with-secrets=secrets.yaml }
<{%reset%}>)
e
What line/context should I look for
I don't know because I still don't know what's wrong? Please explain what your expecting to happen, and what's actually happening. As far as I can tell from those log lines everything looks fine, it will run "talosctl gen config k8s-dev-1 https://localhost:6443 --config-patch @openebs_patch.yml --registry-mirror docker.io=https://registry.ipv6.docker.com --with-examples=false --with-docs=false --with-kubespan=true --with-secrets=secrets.yaml" on create and read the controlplane.yaml, talosconfig, and worker.yaml files as assests.
e
Pulumi reports in red in the diff failure to create and to update the Command Resource (see opening post).
e
Are the files listed in the asset_paths list definitely being created? Might be the create is failing because it can't read an expected asset.
e
The files exist and are being created. I also looked into that potential failure mode. I destroyed the stack, deleted all three asset files and ran
pulumi up
. Still, the same error message. That’s why I’m looking to debug this properly.
e
I would suggest raising this at https://github.com/pulumi/pulumi-command/issues. If this works without asset_paths set and fails when it is set it sounds like it's probably a bug in the command provider itself.
e
I added extra commands, "true" and "false" (Unix utilities) with the asset paths. The former succeeds and the latter fails, so in that case there's not a strong connection with the asset paths. The other thing that changed in my source code is that the command line is quite a bit longer now. JSON patches to those asset files are supplied on the command line now. Maybe there's some assumption in the code path that command lines are of a certain max length, smaller than the actual max length,
e
Maybe there's some assumption in the code path that command lines are of a certain max length, smaller than the actual max length,
There's limits set by grpc and protobuf but they are megabytes in size, and I doubt your command line is that big.
e
No, it's not that big. Though it might be fruitful to validate command line length down to the lowest bound
188 Views