opentofu/opentofu · error

Invalid text tfplugin6.StringKind %v

Error message

Invalid text tfplugin6.StringKind %v

What it means

Error "Invalid text tfplugin6.StringKind %v" thrown in opentofu/opentofu.

Source

Thrown at internal/plugin6/convert/function.go:32

	"github.com/zclconf/go-cty/cty"
)

func ProtoToCtyType(in []byte) cty.Type {
	var out cty.Type
	if err := json.Unmarshal(in, &out); err != nil {
		panic(err)
	}
	return out
}

func ProtoToTextFormatting(proto tfplugin6.StringKind) providers.TextFormatting {
	switch proto {
	case tfplugin6.StringKind_PLAIN:
		return providers.TextFormattingPlain
	case tfplugin6.StringKind_MARKDOWN:
		return providers.TextFormattingMarkdown
	default:
		panic(fmt.Sprintf("Invalid text tfplugin6.StringKind %v", proto))
	}
}

func ProtoToFunctionParameterSpec(proto *tfplugin6.Function_Parameter) providers.FunctionParameterSpec {
	return providers.FunctionParameterSpec{
		Name:               proto.Name,
		Type:               ProtoToCtyType(proto.Type),
		AllowNullValue:     proto.AllowNullValue,
		AllowUnknownValues: proto.AllowUnknownValues,
		Description:        proto.Description,
		DescriptionFormat:  ProtoToTextFormatting(proto.DescriptionKind),
	}
}

func ProtoToFunctionSpec(proto *tfplugin6.Function) providers.FunctionSpec {
	params := make([]providers.FunctionParameterSpec, len(proto.Parameters))
	for i, param := range proto.Parameters {
		params[i] = ProtoToFunctionParameterSpec(param)

View on GitHub (pinned to 3561785c48)

When it happens

Trigger: Thrown at internal/plugin6/convert/function.go:32 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of opentofu/opentofu@3561785c48 (2026-08-15). Data as JSON: /api/errors/dc4e9077358fdc5b. Report an issue: GitHub.