{"record":{"id":"2dbfdc13f4846bfb","repo":"openimsdk/open-im-server","slug":"jpush-push-failed-v","errorCode":null,"errorMessage":"jpush push failed %v","messagePattern":"jpush push failed (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/push/offlinepush/jpush/push.go","lineNumber":104,"sourceCode":"\treturn j.request(ctx, pushObj, &resp, 5)\n}\n\nfunc (j *JPush) request(ctx context.Context, po body.PushObj, resp *map[string]any, timeout int) error {\n\terr := j.httpClient.PostReturn(\n\t\tctx,\n\t\tj.pushConf.JPush.PushURL,\n\t\tmap[string]string{\n\t\t\t\"Authorization\": j.getAuthorization(j.pushConf.JPush.AppKey, j.pushConf.JPush.MasterSecret),\n\t\t},\n\t\tpo,\n\t\tresp,\n\t\ttimeout,\n\t)\n\tif err != nil {\n\t\treturn err\n\t}\n\tif (*resp)[\"sendno\"] != \"0\" {\n\t\treturn fmt.Errorf(\"jpush push failed %v\", resp)\n\t}\n\treturn nil\n}\n","sourceCodeStart":86,"sourceCodeEnd":108,"githubUrl":"https://github.com/openimsdk/open-im-server/blob/175a7bb0673eca18e9d1b10bff4f728da6b1b513/internal/push/offlinepush/jpush/push.go#L86-L108","documentation":"After sending a push to JPush, request() checks the response's 'sendno' field; JPush signals acceptance with sendno==0. Any other value (or a non-zero sendno in the response map) is treated as a failed push and wrapped as 'jpush push failed %v' with the whole response map for debugging. It means JPush rejected or did not accept the push request.","triggerScenarios":"JPush HTTP request completes but the JSON response's sendno is not \"0\" — invalid app key/master secret, bad registration_id, payload exceeding limits, or JPush-side rejection.","commonSituations":"Expired or wrong JPush appkey/mastersecret in push config; pushing to a device whose registration_id is stale; message body too large; JPush service degradation.","solutions":["Log/inspect the full resp map in the error to see JPush's error field and code","Verify appkey and master secret in the JPush push config","Refresh the device registration_id before pushing","Add retry with backoff for transient JPush rejections"],"exampleFix":"// before\nresp sendno: \"1003\" -> 'jpush push failed map[error:...msg invalid regid]'\n// after\nregID := refreshJPushRegID(ctx, userID); client.Push(ctx, regID, msg)","handlingStrategy":"try-catch","validationCode":"if jpushCfg.AppKey == \"\" || jpushCfg.MasterSecret == \"\" {\n\treturn errors.New(\"jpush credentials not configured\")\n}\nif regID == \"\" { return errors.New(\"missing jpush registration_id\") }","typeGuard":null,"tryCatchPattern":"if err := client.Push(ctx, regID, msg); err != nil {\n\tif strings.Contains(err.Error(), \"jpush push failed\") {\n\t\tlog.ZWarn(ctx, \"jpush rejected push, inspect resp in error\", err)\n\t\t// backoff and retry once for transient errors\n\t}\n\treturn err\n}","preventionTips":["Verify appkey/mastersecret after any JPush dashboard change","Refresh registration_ids when devices re-register","Keep payloads under JPush size limits","Add retry with backoff for transient failures"],"tags":["push-notifications","jpush","third-party-api"],"backgroundTag":"push-provider-error","analyzedSha":"175a7bb0673eca18e9d1b10bff4f728da6b1b513","analyzedAt":"2026-09-04T16:52:56.821Z","contentChangedAt":"2026-09-04T16:52:56.821Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}