{"record":{"id":"e9ce0c768e497d18","repo":"GoogleContainerTools/skaffold","slug":"container-q-has-no-command-line","errorCode":null,"errorMessage":"container %q has no command-line","messagePattern":"container %q has no command-line","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/skaffold/debug/transform_go.go","lineNumber":131,"sourceCode":"func (t dlvTransformer) Apply(adapter types.ContainerAdapter, config ImageConfiguration, portAlloc PortAllocator, overrideProtocols []string) (types.ContainerDebugConfiguration, string, error) {\n\tcontainer := adapter.GetContainer()\n\tlog.Entry(context.TODO()).Infof(\"Configuring %q for Go/Delve debugging\", container.Name)\n\n\t// try to find existing `dlv` command\n\tspec := retrieveDlvSpec(config)\n\n\tif spec == nil {\n\t\tnewSpec := newDlvSpec(uint16(portAlloc(defaultDlvPort)))\n\t\tspec = &newSpec\n\t\tswitch {\n\t\tcase len(config.Entrypoint) > 0 && !isEntrypointLauncher(config.Entrypoint):\n\t\t\tcontainer.Command = rewriteDlvCommandLine(config.Entrypoint, *spec, container.Args)\n\n\t\tcase (len(config.Entrypoint) == 0 || isEntrypointLauncher(config.Entrypoint)) && len(config.Arguments) > 0:\n\t\t\tcontainer.Args = rewriteDlvCommandLine(config.Arguments, *spec, container.Args)\n\n\t\tdefault:\n\t\t\treturn types.ContainerDebugConfiguration{}, \"\", fmt.Errorf(\"container %q has no command-line\", container.Name)\n\t\t}\n\t}\n\n\tcontainer.Ports = exposePort(container.Ports, \"dlv\", int32(spec.port))\n\n\treturn types.ContainerDebugConfiguration{\n\t\tRuntime: \"go\",\n\t\tPorts:   map[string]uint32{\"dlv\": uint32(spec.port)},\n\t}, \"go\", nil\n}\n\nfunc retrieveDlvSpec(config ImageConfiguration) *dlvSpec {\n\tif spec := extractDlvSpec(config.Entrypoint); spec != nil {\n\t\treturn spec\n\t}\n\tif spec := extractDlvSpec(config.Arguments); spec != nil {\n\t\treturn spec\n\t}","sourceCodeStart":113,"sourceCodeEnd":149,"githubUrl":"https://github.com/GoogleContainerTools/skaffold/blob/a1189de023efc32d4b8e11f395acc678aa555011/pkg/skaffold/debug/transform_go.go#L113-L149","documentation":"Fires in the Delve (dlv) transformer's Apply when the container being configured for Go debugging has neither an entrypoint nor a command in its image/container spec, so there is no user program for `dlv exec`/connect to target.","triggerScenarios":"Thrown at pkg/skaffold/debug/transform_go.go:131 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Add a command or entrypoint to the container/image so the Go program to debug is identified","Rebuild the image so the builder sets a proper ENTRYPOINT/CMD","Set the command explicitly in the Kubernetes manifest for that container"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a1189de023efc32d4b8e11f395acc678aa555011","analyzedAt":"2026-09-05T12:09:27.064Z","contentChangedAt":"2026-09-05T12:09:27.064Z","schemaVersion":2},"datasetVersion":"2026-09-12T17:17:11.597Z"}