routeros/api-protocol
A reply on the native-API connection was not valid API framing, so centrs stopped reading it. Every command waiting on that connection fails. A command that was already sent may or may not have run.
Typical triggers
- A byte that cannot start a word length (
0xF8or higher) where a word should begin (code). That is a corrupt stream, or a peer that is not the RouterOS API.
Pointing --via native-api at the wrong service usually
fails differently. On CHR 7.25.1, the HTTP (www),
api-ssl and SSH ports each closed the connection, which
centrs reports as transport/connection-closed.
Fix
- Check the port: the
apiservice is TCP 8728 andapi-ssl(TLS) is 8729 by default (/ip service print). A CDBapi-port=or--portcan point it elsewhere. - Remove anything on the path that rewrites TCP payloads, such as a proxy.
If this looks wrong
If the port is the router's api service and the error
repeats, it is a centrs decoder bug. Open an issue with the command, the
--json envelope, the RouterOS version and
centrs --version. Remove passwords
(--password, --cdb-password) and other secrets
from both first.
Related
transport/connection-closedinternal/native-api-length: centrs tried to send a word too long to encode.