{"record":{"id":"b23a3c8b515d4e38","repo":"hyperledger/fabric","slug":"instance-has-not-yet-been-built-cannot-be-started","errorCode":null,"errorMessage":"instance has not yet been built, cannot be started","messagePattern":"instance has not yet been built, cannot be started","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/container/container.go","lineNumber":52,"sourceCode":"\tBuild(ccid string, metadata []byte, codePackageStream io.Reader) (Instance, error)\n}\n\n//go:generate counterfeiter -o mock/instance.go --fake-name Instance . Instance\n\n// Instance represents a built chaincode instance, because of the docker legacy, calling this a\n// built 'container' would be very misleading, and going forward with the external launcher\n// 'image' also seemed inappropriate.  So, the vague 'Instance' is used here.\ntype Instance interface {\n\tStart(peerConnection *ccintf.PeerConnection) error\n\tChaincodeServerInfo() (*ccintf.ChaincodeServerInfo, error)\n\tStop() error\n\tWait() (int, error)\n}\n\ntype UninitializedInstance struct{}\n\nfunc (UninitializedInstance) Start(peerConnection *ccintf.PeerConnection) error {\n\treturn errors.Errorf(\"instance has not yet been built, cannot be started\")\n}\n\nfunc (UninitializedInstance) ChaincodeServerInfo() (*ccintf.ChaincodeServerInfo, error) {\n\treturn nil, errors.Errorf(\"instance has not yet been built, cannot get chaincode server info\")\n}\n\nfunc (UninitializedInstance) Stop() error {\n\treturn errors.Errorf(\"instance has not yet been built, cannot be stopped\")\n}\n\nfunc (UninitializedInstance) Wait() (int, error) {\n\treturn 0, errors.Errorf(\"instance has not yet been built, cannot wait\")\n}\n\n//go:generate counterfeiter -o mock/package_provider.go --fake-name PackageProvider . PackageProvider\n\n// PackageProvider gets chaincode packages from the filesystem.\ntype PackageProvider interface {","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/core/container/container.go#L34-L70","documentation":"Returned by container Instance.Start when Start is called on an instance whose Build step never completed (or was not invoked). The runtime contract requires build-then-start; starting an unbuilt instance is rejected by this guard.","triggerScenarios":"Thrown at core/container/container.go:52 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Call Build successfully before calling Start","Check the Build error path — the failed build was likely swallowed","For external builders, verify the build script exited 0"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2736b63f8fd5932511d56fe68b7039d15977f7f6","analyzedAt":"2026-09-04T08:52:36.465Z","contentChangedAt":"2026-09-04T08:52:36.465Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}