{"record":{"id":"9740bb96889192c2","repo":"alibaba/canal","slug":"something-goes-wrong-when-doing-authentication","errorCode":null,"errorMessage":"something goes wrong when doing authentication: {}","messagePattern":"something goes wrong when doing authentication: (.+?)","errorType":"exception","errorClass":"ServiceException","httpStatus":null,"severity":"error","filePath":"admin/admin-web/src/main/java/com/alibaba/otter/canal/admin/connector/SimpleAdminConnector.java","lineNumber":107,"sourceCode":"                .setUsername(user != null ? user : \"\")\n                .setPassword(ByteString.copyFromUtf8(newPasswd != null ? newPasswd : \"\"))\n                .setNetReadTimeout(idleTimeout)\n                .setNetWriteTimeout(idleTimeout)\n                .build();\n            writeWithHeader(Packet.newBuilder()\n                .setType(PacketType.CLIENTAUTHENTICATION)\n                .setBody(ca.toByteString())\n                .build()\n                .toByteArray());\n            //\n            Packet ack = Packet.parseFrom(readNextPacket());\n            if (ack.getType() != PacketType.ACK) {\n                throw new CanalClientException(\"unexpected packet type when ack is expected\");\n            }\n\n            Ack ackBody = Ack.parseFrom(ack.getBody());\n            if (ackBody.getCode() > 0) {\n                throw new ServiceException(\"something goes wrong when doing authentication: \" + ackBody.getMessage());\n            }\n\n            connected = true;\n        } catch (IOException | NoSuchAlgorithmException e) {\n            throw new ServiceException(e);\n        }\n    }\n\n    @Override\n    public void disconnect() throws ServiceException {\n        if (!connected) {\n            return;\n        }\n\n        connected = false;\n        if (readableChannel != null) {\n            quietlyClose(readableChannel);\n            readableChannel = null;","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/alibaba/canal/blob/87be50e87686a3e8af08c368d0e1ffd1f59eb04a/admin/admin-web/src/main/java/com/alibaba/otter/canal/admin/connector/SimpleAdminConnector.java#L89-L125","documentation":"Thrown when the auth ACK is correctly typed but ackBody.getCode() > 0, i.e. the server reported an authentication error with a descriptive message. The thrown ServiceException appends the server's message.","triggerScenarios":"CLIENTAUTHENTICATION completed the round-trip and the server returned an ACK with a positive (error) code — wrong username, wrong/scrambled password, or server refusing the client.","commonSituations":"Wrong admin password (scramble411 mismatch); user not registered on the server; password hash seed handling differs between versions; server auth disabled/misconfigured.","solutions":["Set the same canal.adminUser/canal.adminPasswd on both admin-web and canal-server.","Read the appended ackBody.getMessage() text — it carries the exact server-side reason.","Regenerate the password using the documented scramble/encoding step (SecurityUtil.scramble411).","Verify the server's user list config includes this admin user."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n    connector.connect();\n} catch (ServiceException e) {\n    if (e.getMessage().contains(\"doing authentication\")) {\n        // e.getMessage() includes server-side reason; fix credentials\n    }\n    throw e;\n}","preventionTips":["Synchronize canal.adminUser/canal.adminPasswd on admin and server before connecting.","Read the appended server message — it states the exact auth failure reason.","Regenerate the password via the documented scramble416 encoding if hash mismatch is suspected."],"tags":["auth","credentials","canal-admin","network"],"backgroundTag":null,"analyzedSha":"87be50e87686a3e8af08c368d0e1ffd1f59eb04a","analyzedAt":"2026-08-14T04:30:11.918Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}