How-to guide Debug dependency wiring
Debug a missing dependency
Find the unresolved build argument and wire it to the intended package instance.
A package declares required dependencies through the arguments to its build functions. When Kix cannot resolve one of those arguments, evaluation stops before any manifests are deployed.
Read the missing argument
Section titled “Read the missing argument”Run the cluster checks:
❱ kix check 06-service-dep
error: tutorial-06/gateway: dependency 'backend' was not found for namespace 'tutorial-06'. Add an instance with that name or alias, or set deps.backend explicitly.
(exit code: 1) The diagnostic identifies backend as the unresolved build argument and
names the consuming instance’s namespace. Start with that argument name, not
the Kubernetes resources the package would have rendered.
Check the package declaration
Section titled “Check the package declaration”Find the build entry that accepts the missing argument:
build = { backend, ... }: { # Resources that read backend.out values.};An argument without a default is required. An argument such as
backend ? null is optional and does not cause this error when no provider is
available.
Check the available instances
Section titled “Check the available instances”Kix first looks for an eligible instance with the same name or alias in the consumer’s namespace. Check the cluster definition for spelling changes and for an instance that was removed or moved.
If the intended provider has another name or lives in another namespace, wire it explicitly:
instances.apps.gateway = { package = packages.gateway; deps.backend = ref.platform.api;};The key after deps must match the build argument. The reference selects the
provider by namespace and instance name.
Run the checks again after correcting the name or wiring:
❱ kix check 06-service-dep
TOOL RESULT DETAILS
eval pass 15 manifests evaluated
scorecard pass 0 errors, 8 warnings, 1 info If Kix reports that the argument matches multiple instances instead, add the
same kind of explicit deps entry to the consumer, naming the provider it
should use. See
Use aliases and default aliases
for how names and aliases collide.