{"record":{"id":"1b2193332ce26b96","repo":"pulumi/pulumi","slug":"failed-to-start-loader-server-w","errorCode":null,"errorMessage":"failed to start loader server: %w","messagePattern":"failed to start loader server: %w","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"pkg/resource/deploy/source_eval.go","lineNumber":263,"sourceCode":"\t)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to start resource monitor: %w\", err)\n\t}\n\n\t// Also start up a schema loader and a provider mapper for the language runtime to use to fetch\n\t// schema and mapping information.\n\tloaderRegistration := schema.LoaderRegistration(\n\t\tschema.NewLoaderServer(schema.NewPluginLoader(src.plugctx)))\n\n\tmapper, err := newRunMapper(ctx, src.plugctx)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create provider mapper: %w\", err)\n\t}\n\tmapperRegistration := pconvert.MapperRegistration(pconvert.NewMapperServer(mapper))\n\n\tloaderServer, err := plugin.NewServer(src.plugctx, loaderRegistration, mapperRegistration)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to start loader server: %w\", err)\n\t}\n\n\t// Create a new iterator with appropriate channels, and gear up to go!\n\titer := &evalSourceIterator{\n\t\tloaderServer:    loaderServer,\n\t\tmon:             mon,\n\t\tsrc:             src,\n\t\tregChan:         regChan,\n\t\tregOutChan:      regOutChan,\n\t\tregReadChan:     regReadChan,\n\t\tfinChan:         finChan,\n\t\tprogramComplete: programComplete,\n\t\tpanicErrs:       src.panicErrs,\n\t}\n\n\t// Now invoke Run in a goroutine.  All subsequent resource creation events will come in over the gRPC channel,\n\t// and we will pump them through the channel.  If the Run call ultimately fails, we need to propagate the error.\n\titer.forkRun(config, configSecretKeys)","sourceCodeStart":245,"sourceCodeEnd":281,"githubUrl":"https://github.com/pulumi/pulumi/blob/793f7b2e160db4321fb7fb6b0607461e01cb251e/pkg/resource/deploy/source_eval.go#L245-L281","documentation":"The loader server is a gRPC server exposing the schema loader and provider mapper to the language host. `plugin.NewServer` failure is wrapped as `failed to start loader server` in `evalSource.Iterate`. This means the engine could not start the local gRPC service the program uses to fetch provider schemas and mapping info.","triggerScenarios":"`pulumi up`/`preview` when `plugin.NewServer(src.plugctx, loaderRegistration, mapperRegistration)` fails — usually gRPC server/socket startup failure within the plugin context.","commonSituations":"Resource exhaustion or restricted networking preventing local listeners; corrupted plugin infrastructure; unusual sandboxed CI environments.","solutions":["Re-run with `--logtostderr -v=9` for the wrapped root cause","Reinstall plugins (`pulumi plugin rm --all`, then retry) and/or reinstall the CLI","Check that the environment allows binding local sockets/ports and has free resources","Retry the deployment; transient startup failures may clear"],"exampleFix":"// before\npulumi up\n// after\npulumi plugin rm --all && pulumi up","handlingStrategy":"retry","validationCode":"// shell: confirm environment permits local listeners\npulumi preview --logtostderr -v=3 --dry-run > /dev/null 2>&1 || echo 'engine startup problem'","typeGuard":null,"tryCatchPattern":"// TS automation API\ntry {\n  await stack.up();\n} catch (err) {\n  if (String(err).includes(\"failed to start loader server\")) {\n    // transient local gRPC startup failure: retry once\n    return stack.up();\n  }\n  throw err;\n}","preventionTips":["Avoid sandbox/SELinux policies that block local socket binds for the pulumi process","Keep engine and plugin binaries consistent versions","Retry deployments in CI once on transient engine startup failures"],"tags":["grpc","plugin","loader","engine"],"backgroundTag":"grpc-server-start-failed","analyzedSha":"793f7b2e160db4321fb7fb6b0607461e01cb251e","analyzedAt":"2026-08-31T09:36:43.099Z","schemaVersion":2},"datasetVersion":"2026-09-01T08:17:40.651Z"}