{"record":{"id":"71391c7e996108fc","repo":"alibaba/canal","slug":"something-goes-wrong-when-doing-authentication-71391c","errorCode":null,"errorMessage":"something goes wrong when doing authentication: ","messagePattern":"something goes wrong when doing authentication: ","errorType":"exception","errorClass":"CanalClientException","httpStatus":null,"severity":"error","filePath":"client/src/main/java/com/alibaba/otter/canal/client/impl/SimpleCanalConnector.java","lineNumber":193,"sourceCode":"                .setUsername(username != null ? username : \"\")\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.getErrorCode() > 0) {\n                throw new CanalClientException(\"something goes wrong when doing authentication: \"\n                                               + ackBody.getErrorMessage());\n            }\n\n            connected = true;\n            return new InetSocketAddress(channel.socket().getLocalAddress(), channel.socket().getLocalPort());\n        } catch (IOException | NoSuchAlgorithmException e) {\n            throw new CanalClientException(e);\n        }\n    }\n\n    private void doDisconnect() throws CanalClientException {\n        if (readableChannel != null) {\n            quietlyClose(readableChannel);\n            readableChannel = null;\n        }\n        if (writableChannel != null) {\n            quietlyClose(writableChannel);\n            writableChannel = null;","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/alibaba/canal/blob/87be50e87686a3e8af08c368d0e1ffd1f59eb04a/client/src/main/java/com/alibaba/otter/canal/client/impl/SimpleCanalConnector.java#L175-L211","documentation":"Error \"something goes wrong when doing authentication: \" thrown in alibaba/canal.","triggerScenarios":"Thrown at client/src/main/java/com/alibaba/otter/canal/client/impl/SimpleCanalConnector.java:193 when the library encounters an invalid state.","commonSituations":"Authentication error. Never log the password, verify credentials and destination before retry, and limit auth retries to avoid account lockout on the server side.","solutions":["Check canal.user/canal.passwd on the client match the canal.adminUser/canal.adminPasswd (or instance auth) configured on the server.","Inspect the server log for the underlying authentication error included after the message.","If using canal admin, confirm the account exists and has permission for the destination."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"87be50e87686a3e8af08c368d0e1ffd1f59eb04a","analyzedAt":"2026-08-14T04:30:11.918Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}