microsoft/aspire · error

no input with name ' ' was found

Error message

no input with name '%s' was found

What it means

Generated Go ATS wrapper code's Required(name) method looks up an interaction input by name; if Get succeeds but the input is absent (or nil), it returns this error. It exists to distinguish 'the name exists but is empty' from a successful lookup, guaranteeing Required never returns a nil input.

Solutions

  1. Correct the input name string to match a declared input exactly (names are case-sensitive)
  2. Regenerate the Go client from the current AppHost so the inputs struct is in sync with the capability definition
  3. Use Get/Value instead of Required if the input is genuinely optional

Example fix

// before
val, err := inputs.Required("ConenctionString") // typo
// after
val, err := inputs.Required("ConnectionString")
Defensive patterns

Strategy: try-catch

Validate before calling

// Check availability first
if v, err := inputs.Get("ConnectionString"); err != nil || v == nil {
	// handle missing input before calling Required
}

Type guard

func inputExists(inputs *InteractionInputs, name string) bool { v, _ := inputs.Get(name); return v != nil }

Try / catch

val, err := inputs.Required("ConnectionString")
if err != nil {
	return fmt.Errorf("missing required input: %w", err)
}

Prevention

When it happens

Trigger: Calling a generated Required("name") method on the interaction-inputs struct with a name that was never declared among the capability's inputs, or whose lookup returned a nil entry.

Common situations: Typo in the input name, renaming/removing an input on the C# side while the generated Go client is stale, or consuming a required input that is only conditionally defined.

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of microsoft/aspire@25830f84bd (2026-09-16). Data as JSON: /api/errors/0b3aba081fc1abb3. Report an issue: GitHub.

Appendix: source

Thrown at src/Aspire.Hosting.CodeGeneration.Go/AtsGoCodeGenerator.cs:997

        // These delegate to ToArray (a single RPC) and then match locally. Names are compared
        // case-insensitively via strings.EqualFold to mirror StringComparers.InteractionInputName in .NET.
        WriteLine("// Get returns the input with the specified name, or nil if no input matches.");
        WriteLine($"func (s *{implName}) Get(name string) (*InteractionInput, error) {{");
        WriteLine("\tif s.err != nil { return nil, s.err }");
        WriteLine("\tinputs, err := s.ToArray()");
        WriteLine("\tif err != nil { return nil, err }");
        WriteLine("\tfor _, input := range inputs {");
        WriteLine("\t\tif strings.EqualFold(input.Name, name) { return input, nil }");
        WriteLine("\t}");
        WriteLine("\treturn nil, nil");
        WriteLine("}");
        WriteLine();

        WriteLine("// Required returns the input with the specified name, or an error if no input matches.");
        WriteLine($"func (s *{implName}) Required(name string) (*InteractionInput, error) {{");
        WriteLine("\tinput, err := s.Get(name)");
        WriteLine("\tif err != nil { return nil, err }");
        WriteLine("\tif input == nil { return nil, fmt.Errorf(\"no input with name '%s' was found\", name) }");
        WriteLine("\treturn input, nil");
        WriteLine("}");
        WriteLine();

        WriteLine("// Value returns the value of the input with the specified name, or an empty string if no input matches or it has no value.");
        WriteLine($"func (s *{implName}) Value(name string) (string, error) {{");
        WriteLine("\tinput, err := s.Get(name)");
        WriteLine("\tif err != nil { return \"\", err }");
        WriteLine("\tif input == nil || input.Value == nil { return \"\", nil }");
        WriteLine("\treturn *input.Value, nil");
        WriteLine("}");
        WriteLine();

        WriteLine("// RequiredValue returns the value of the input with the specified name, or an error if no input matches.");
        WriteLine($"func (s *{implName}) RequiredValue(name string) (string, error) {{");
        WriteLine("\tinput, err := s.Required(name)");
        WriteLine("\tif err != nil { return \"\", err }");
        WriteLine("\tif input.Value == nil { return \"\", nil }");

View on GitHub (pinned to 25830f84bd)