cuddly-actor-99406
04/30/2021, 2:41 AMpulumi up
now throws with a not very useful stack trace. It's throwing from pulumi.runtime.rpc.serialize_property
. I put in some debug print statements and I think it is k8s.yaml.ConfigFile
which is the resource involved. It looks like it might be related to something in the upgrade notes "*snake_case/camelCase Key Translation Fixes in Provider Python SDKs*". Can anyone help?cuddly-actor-99406
04/30/2021, 2:50 AMred-match-15116
04/30/2021, 2:51 AMcuddly-actor-99406
04/30/2021, 2:56 AMFile "/myproject/venv/lib/python3.9/site-packages/pulumi/runtime/resource.py", line 438, in do_register
resolver = await prepare_resource(res, ty, custom, remote, props, opts, typ)
File "/myproject/venv/lib/python3.9/site-packages/pulumi/runtime/resource.py", line 120, in prepare_resource
provider_urn = await provider.urn.future()
File "/myproject/venv/lib/python3.9/site-packages/pulumi/runtime/resource.py", line 438, in do_register
resolver = await prepare_resource(res, ty, custom, remote, props, opts, typ)
File "/myproject/venv/lib/python3.9/site-packages/pulumi/runtime/resource.py", line 120, in prepare_resource
provider_urn = await provider.urn.future()
File "/myproject/venv/lib/python3.9/site-packages/pulumi/runtime/resource.py", line 438, in do_register
resolver = await prepare_resource(res, ty, custom, remote, props, opts, typ)
File "/myproject/venv/lib/python3.9/site-packages/pulumi/runtime/resource.py", line 120, in prepare_resource
provider_urn = await provider.urn.future()
File "/myproject/venv/lib/python3.9/site-packages/pulumi/output.py", line 116, in get_value
val = await self._future
File "/myproject/venv/lib/python3.9/site-packages/pulumi/output.py", line 116, in get_value
val = await self._future
File "/myproject/venv/lib/python3.9/site-packages/pulumi/output.py", line 116, in get_value
val = await self._future
[Previous line repeated 30 more times]
File "/myproject/venv/lib/python3.9/site-packages/pulumi/runtime/rpc_manager.py", line 67, in rpc_wrapper
result = await rpc
File "/myproject/venv/lib/python3.9/site-packages/pulumi/output.py", line 91, in is_value_known
return await is_known and not contains_unknowns(await future)
File "/myproject/venv/lib/python3.9/site-packages/pulumi/output.py", line 91, in is_value_known
return await is_known and not contains_unknowns(await future)
File "/myproject/venv/lib/python3.9/site-packages/pulumi/output.py", line 91, in is_value_known
return await is_known and not contains_unknowns(await future)
[Previous line repeated 6 more times]
File "/myproject/venv/lib/python3.9/site-packages/pulumi/runtime/resource.py", line 438, in do_register
resolver = await prepare_resource(res, ty, custom, remote, props, opts, typ)
File "/myproject/venv/lib/python3.9/site-packages/pulumi/runtime/resource.py", line 100, in prepare_resource
serialized_props = await rpc.serialize_properties(props, property_dependencies_resources, translate, typ)
File "/myproject/venv/lib/python3.9/site-packages/pulumi/runtime/rpc.py", line 121, in serialize_properties
result = await serialize_property(v, deps, input_transformer, get_type(k))
File "/myproject/venv/lib/python3.9/site-packages/pulumi/runtime/rpc.py", line 256, in serialize_property
value = await serialize_property(output.future(), deps, input_transformer, typ)
File "/myproject/venv/lib/python3.9/site-packages/pulumi/runtime/rpc.py", line 243, in serialize_property
return await serialize_property(future_return, deps, input_transformer, typ)
File "/myproject/venv/lib/python3.9/site-packages/pulumi/runtime/rpc.py", line 308, in serialize_property
raise AssertionError(f"Unexpected type. Expected 'dict' got '{typ}'")
AssertionError: Unexpected type. Expected 'dict' got '<class 'str'>'
error: an unhandled error occurred: Program exited with non-zero exit code: 1
red-match-15116
04/30/2021, 3:05 AMcuddly-actor-99406
04/30/2021, 4:47 AM--- k8s.Provider('k8s-provider', kubeconfig=cluster.kubeconfig, suppress_deprecation_warnings=True)
+++ k8s.Provider('k8s-provider', kubeconfig=cluster.kubeconfig.apply(lambda i: str(i)), suppress_deprecation_warnings=True)
That's a breaking change from 2.x without a useful error message. It now requires an explicit cast from "Any" (presumably a dict in this case) to str, which is kinda clumsy.
And I'm narrowing down the ones in k8s that I don't believe are caused by my code. This is standard k8s yaml (running in production) using k8s.yaml.ConfigFile
that is throwing this :
AssertionError: Unexpected type. Expected 'dict' got 'typing.Union[pulumi_kubernetes.apiextensions.v1._inputs.JSONSchemaPropsArgs, typing.Sequence[typing.Any], typing.Awaitable[typing.Union[pulumi_kubernetes.apiextensions.v1._inputs.JSONSchemaPropsArgs, typing.Sequence[typing.Any]]], pulumi.output.Output[~T], NoneType]'
I have no idea how to go about fixing that.red-match-15116
04/30/2021, 4:51 AMcuddly-actor-99406
04/30/2021, 5:06 AMremove_crds_status
code was related, because I am indeed using that workaround. But in addressing this bug, I commented out any transforms, and progressively commented out yaml elements to narrow it down. pulumi processes a lot of yaml before it throws; here is the element path that will throw if uncommented, and succeed if commentedred-match-15116
04/30/2021, 7:12 AMpulumi_kubernetes.apiextensions.v1._inputs.JSONSchemaPropsArgs
. Again, I would encourage you to add your information to that issue because it could help the team fix the bug, help prioritize, etc.cuddly-actor-99406
04/30/2021, 7:47 AM