{"record":{"id":"becce2b69207981d","repo":"portainer/portainer","slug":"no-nodes-available","errorCode":null,"errorMessage":"no nodes available","messagePattern":"no nodes available","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"api/stacks/deployments/deployer_remote.go","lineNumber":375,"sourceCode":"\t}\n\n\tinfo, err := cli.Info(ctx)\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"unable to get agent info\")\n\t}\n\n\tif isNotInASwarm(&info) {\n\t\treturn cli, nil\n\t}\n\tdefer logs.CloseAndLogErr(cli)\n\n\tnodes, err := cli.NodeList(ctx, types.NodeListOptions{})\n\tif err != nil {\n\t\treturn nil, errors.Wrap(err, \"unable to list nodes\")\n\t}\n\n\tif len(nodes) == 0 {\n\t\treturn nil, errors.New(\"no nodes available\")\n\t}\n\n\tvar managerNode swarm.Node\n\tfor _, node := range nodes {\n\t\tif node.ManagerStatus != nil && node.ManagerStatus.Leader {\n\t\t\tmanagerNode = node\n\t\t\tbreak\n\t\t}\n\t}\n\n\tif managerNode.ID == \"\" {\n\t\treturn nil, errors.New(\"no leader node available\")\n\t}\n\n\treturn d.ClientFactory.CreateClient(endpoint, managerNode.Description.Hostname, &timeout)\n}\n\nfunc (d *stackDeployer) unpackerImageRegistryAuth(unpackerImg string) (string, error) {","sourceCodeStart":357,"sourceCodeEnd":393,"githubUrl":"https://github.com/portainer/portainer/blob/17e74456ff6e794b9d5439ec3fa06922aa18a3f8/api/stacks/deployments/deployer_remote.go#L357-L393","documentation":"Error \"no nodes available\" thrown in portainer/portainer.","triggerScenarios":"Thrown at api/stacks/deployments/deployer_remote.go:375 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"17e74456ff6e794b9d5439ec3fa06922aa18a3f8","analyzedAt":"2026-08-26T23:09:01.915Z","schemaVersion":2},"datasetVersion":"2026-08-27T03:17:27.898Z"}