{"record":{"id":"aa3c956cb392835d","repo":"larksuite/cli","slug":"remote-meta-unexpected-msg-q","errorCode":null,"errorMessage":"remote meta: unexpected msg %q","messagePattern":"remote meta: unexpected msg %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/registry/remote.go","lineNumber":212,"sourceCode":"\t}\n\tdefer resp.Body.Close()\n\n\tif resp.StatusCode != http.StatusOK {\n\t\treturn nil, nil, &httpError{StatusCode: resp.StatusCode}\n\t}\n\n\tbody, err := io.ReadAll(io.LimitReader(resp.Body, maxResponseSize))\n\tif err != nil {\n\t\treturn nil, nil, err\n\t}\n\n\t// Parse the envelope response\n\tvar envelope remoteResponse\n\tif err := json.Unmarshal(body, &envelope); err != nil {\n\t\treturn nil, nil, err\n\t}\n\tif envelope.Msg != \"succeeded\" {\n\t\treturn nil, nil, fmt.Errorf(\"remote meta: unexpected msg %q\", envelope.Msg)\n\t}\n\n\tvar parsed MergedRegistry\n\tif len(envelope.Data) > 0 {\n\t\tif err := json.Unmarshal(envelope.Data, &parsed); err != nil {\n\t\t\treturn nil, nil, fmt.Errorf(\"remote meta: parse data: %w\", err)\n\t\t}\n\t}\n\n\t// If data.services is nil, the version is up-to-date (not modified)\n\tif parsed.Services == nil {\n\t\treturn nil, nil, nil\n\t}\n\n\t// Cache the data portion verbatim (see remoteResponse for why not a typed\n\t// re-marshal).\n\treturn envelope.Data, &parsed, nil\n}","sourceCodeStart":194,"sourceCodeEnd":230,"githubUrl":"https://github.com/larksuite/cli/blob/7fd6ef3c07182257ce776cdc5a614e122d5bd4b3/internal/registry/remote.go#L194-L230","documentation":"fetchRemoteMerged fetches the remote metadata registry wrapped in an envelope response. When the envelope decodes but its Msg field is not \"succeeded\", the fetch fails with this error. It indicates the remote metadata service reported a non-success status rather than returning registry data.","triggerScenarios":"Any remote meta sync path (doSyncFetch, doBackgroundRefresh, TestFetchRemoteMerged_*) where the HTTP body is a valid envelope whose msg is not \"succeeded\" — e.g. the endpoint returned an error/status message.","commonSituations":"Remote metadata service degraded or rejecting the request inside a 200 envelope; API gateway/proxy altering the response; pointing the CLI at a non-production endpoint that answers with a different msg value.","solutions":["Inspect the quoted msg in the error to see what the remote service returned, then address that upstream status.","Retry later or trigger a manual refresh — transient service issues usually clear up.","Verify the metadata endpoint URL / network path (proxy, VPN, custom endpoint config) points at the real metadata service.","Fall back to the cached or bundled registry metadata (internal/registry/meta_data.json) if available."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"merged, _, err := fetchRemoteMerged(ctx, client)\nif err != nil {\n\tif strings.HasPrefix(err.Error(), \"remote meta: unexpected msg\") {\n\t\t// log the msg, back off and retry, then fall back to cached meta\n\t\treturn loadCachedRegistry()\n\t}\n\treturn err\n}","preventionTips":["Monitor the metadata endpoint's availability and msg responses.","Always keep a valid cached/bundled meta_data.json as fallback.","Check proxy/VPN settings when unexpected msg values appear consistently."],"tags":["network","remote-meta","envelope"],"backgroundTag":"remote-meta-unexpected-response","analyzedSha":"7fd6ef3c07182257ce776cdc5a614e122d5bd4b3","analyzedAt":"2026-09-04T21:17:44.649Z","contentChangedAt":"2026-09-04T21:17:44.649Z","schemaVersion":2},"datasetVersion":"2026-09-12T02:17:10.037Z"}