{"record":{"id":"99df40da976d45dc","repo":"router-for-me/CLIProxyAPI","slug":"auth-runtime-info-not-found-for-auth-index-s","errorCode":null,"errorMessage":"auth runtime info not found for auth_index %s","messagePattern":"auth runtime info not found for auth_index (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/pluginhost/auth_callbacks.go","lineNumber":111,"sourceCode":"}\n\nfunc (h *Host) callHostAuthGetRuntime(ctx context.Context, request []byte) ([]byte, error) {\n\t_ = ctx\n\tvar req rpcHostAuthGetRequest\n\tif errUnmarshal := json.Unmarshal(request, &req); errUnmarshal != nil {\n\t\treturn nil, fmt.Errorf(\"decode host auth get runtime request: %w\", errUnmarshal)\n\t}\n\tauthIndex := strings.TrimSpace(req.AuthIndex)\n\tif authIndex == \"\" {\n\t\treturn nil, fmt.Errorf(\"auth_index is required\")\n\t}\n\tauth, errGet := h.authByIndex(authIndex)\n\tif errGet != nil {\n\t\treturn nil, errGet\n\t}\n\tentry := h.buildHostAuthFileEntry(auth)\n\tif entry == nil {\n\t\treturn nil, fmt.Errorf(\"auth runtime info not found for auth_index %s\", authIndex)\n\t}\n\treturn marshalRPCResult(pluginapi.HostAuthGetRuntimeResponse{Auth: *entry})\n}\n\nfunc (h *Host) callHostAuthSave(ctx context.Context, request []byte) ([]byte, error) {\n\tvar req pluginapi.HostAuthSaveRequest\n\tif errUnmarshal := json.Unmarshal(request, &req); errUnmarshal != nil {\n\t\treturn nil, fmt.Errorf(\"decode host auth save request: %w\", errUnmarshal)\n\t}\n\tname, rawJSON, errValidate := validateHostAuthSaveRequest(req)\n\tif errValidate != nil {\n\t\treturn nil, errValidate\n\t}\n\tpath, errSave := h.saveAuthFile(ctx, name, rawJSON)\n\tif errSave != nil {\n\t\treturn nil, errSave\n\t}\n\treturn marshalRPCResult(pluginapi.HostAuthSaveResponse{","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/router-for-me/CLIProxyAPI/blob/78f0c4079e3e6273d65d03b5549cffc898703264/internal/pluginhost/auth_callbacks.go#L93-L129","documentation":"authByIndex resolved the auth and the manager returned it, but buildHostAuthFileEntry produced nil for it — the auth exists in the manager yet cannot be mapped to a host auth file entry (e.g. missing file name, unreadable attributes, or an entry shape the builder rejects). The runtime-info call therefore cannot return data.","triggerScenarios":"Calling auth get runtime for an auth whose in-memory record is incomplete — auth loaded partially, file name/ID missing after migration, or a transient state during hot-reload where the auth is listed but its file entry cannot be built.","commonSituations":"Auth store migrated between formats leaving partial records; auth file deleted on disk while still cached in the manager; plugin holding an auth_index across a reload that changed entry shape.","solutions":["Retry after re-listing auth files — if the index disappeared, re-acquire it from a fresh auth.list","Inspect the auth record (file name, ID, attributes) in the auth store for the given index and repair or delete the malformed entry","Re-run OAuth login for that provider to regenerate a complete auth file","If it happens consistently after upgrade, clear the stale auth dir entry and let the host rebuild it"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"entry, err := hostClient.AuthGetRuntime(ctx, req)\nif err != nil && strings.Contains(err.Error(), \"auth runtime info not found\") {\n    files, listErr := hostClient.AuthList(ctx)\n    if listErr == nil && len(files.Files) > 0 {\n        req.AuthIndex = files.Files[0].AuthIndex\n        entry, err = hostClient.AuthGetRuntime(ctx, req)\n    }\n}","preventionTips":["Re-acquire indexes from a fresh list on 'not found' instead of retrying the same index","Keep auth store migrations atomic so manager state never holds partial records","Monitor for buildHostAuthFileEntry nil results as a signal of store drift"],"tags":["plugin","rpc","auth","state-consistency"],"backgroundTag":null,"analyzedSha":"78f0c4079e3e6273d65d03b5549cffc898703264","analyzedAt":"2026-08-15T12:26:37.444Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}