Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error receiving message "End of message byte (<LF>) not detected" #1

Closed
nicko1977 opened this issue May 31, 2019 · 4 comments
Closed

Comments

@nicko1977
Copy link

hello

i'm trying this template on my Mirth server, i follow the readme, but when i launch a discovery, i have this error in Mirth server log :

ERROR (com.mirth.connect.connectors.tcp.TcpReceiver:739): Error receiving message (TCP Listener "Source" on channel ae0b7d75-5ce1-484b-afe0-aff6fa412073).
com.mirth.connect.model.transmission.framemode.FrameStreamHandlerException: End of message byte () not detected. Last byte received:

Zabbix 4.2
Mirth 3.4.1

@joshuagordondba
Copy link

I am getting the same exact error on version 4.4. I dug into this thinking the Header had changed but it appears to be exactly the same. I really wish I had a quick way to get mirth monitoring working.
Here is the error if it helps.
[2020-04-13 06:20:49,254] ERROR (com.mirth.connect.connectors.tcp.TcpReceiver:746): Error receiving message (TCP Listener "Source" on channel ae0b7d75-5ce1-484b-afe0-aff6fa412073).
com.mirth.connect.model.transmission.framemode.FrameStreamHandlerException: End of message byte () not detected. Last byte received: l

Zabbix 4.4
Mirth 3.8.1

@cboyer
Copy link
Owner

cboyer commented Apr 23, 2020

Zabbix headers seem to be different in 3.X and 4.X branches:
Zabbix 3.4 header, Zabbix 4.0 header

Current implementation uses the 3.X header.
We can compare zabbix_get send data with versions 3.X and 4.X (with the key agent.version) while sniffing network.

I don't understand why Mirth TCPListener is involved in this problem.
I need to setup a recent Mirth server and a Zabbix 4.X appliance to properly dig this problem.

@cboyer
Copy link
Owner

cboyer commented Apr 26, 2020

Test environment:
Mirth 3.9.0 and Mirthix 1.1.1

zabbix_get v3.0.30 request (./zabbix_get -s 127.0.0.1 -k agent.version):

0x0000:  0000 0000 0000 0000 0000 0000 0800 4500  ..............E.
0x0010:  0042 d2fc 4000 4006 69b7 7f00 0001 7f00  .B..@[email protected].......
0x0020:  0001 9126 2742 29b2 e54d 925c abda 8018  ...&'B)..M.\....
0x0030:  0200 fe36 0000 0101 080a 95f3 8cdc 95f3  ...6............
0x0040:  8cdc 6167 656e 742e 7665 7273 696f 6e0a  ..agent.version.

Mirth response:

0x0000:  0000 0000 0000 0000 0000 0000 0800 4500  ..............E.
0x0010:  004f c6df 4000 4006 75c7 7f00 0001 7f00  .O..@[email protected].......
0x0020:  0001 2742 9126 925c abda 29b2 e55b 8018  ..'B.&.\..)..[..
0x0030:  0200 fe43 0000 0101 080a 95f3 8cef 95f3  ...C............
0x0040:  8cdc 5a42 5844 010e 0000 0000 0000 004d  ..ZBXD.........M
0x0050:  6972 7468 6978 2031 2e31 2e31 0a         irthix.1.1.1.

Everything works as expected, note the final 0x0A in request which is needed by Mirth to detect the end of the message.


zabbix_get v4.4.7 request (returns error on stdout):

./zabbix_get -s 127.0.0.1 -k agent.version
zabbix_get [36830]: Check access restrictions in Zabbix agent configuration
0x0000:  0000 0000 0000 0000 0000 0000 0800 4500  ..............E.
0x0010:  004e b030 4000 4006 8c77 7f00 0001 7f00  .N.0@[email protected]......
0x0020:  0001 913e 2742 5acd 6950 6c9a d459 8018  ...>'BZ.iPl..Y..
0x0030:  0200 fe42 0000 0101 080a 95f8 995f 95f8  ...B........._..
0x0040:  995f 5a42 5844 010d 0000 0000 0000 0061  ._ZBXD.........a
0x0050:  6765 6e74 2e76 6572 7369 6f6e            gent.version

2 problems here:

  • We don't have a final 0x0A in request with 4.X version of Zabbix
  • Header is not the same: 3.X version doesn't have header in request whereas 4.X request does (ZBXD + 1 byte for flag + 4 bytes for data length + 4 bytes reserved for protocol extensions = 13 bytes before the key value agent.version, according to documentation).
    Data length in header replace final 0x0A because we know where the request ends.

There is no Mirth response because the final 0x0A is missing and throw:

ERROR  (com.mirth.connect.connectors.tcp.TcpReceiver:746): Error receiving message (TCP Listener "Source" on channel ae0b7d75-5ce1-484b-afe0-aff6fa412073).
com.mirth.connect.model.transmission.framemode.FrameStreamHandlerException: End of message byte (<LF>) not detected. Last byte received: n

Conclusion: Mirthix 1.1.1 is not compatible with Zabbix 4.X.
We need to implement Zabbix 4.X request's header in Mirthix.

@cboyer
Copy link
Owner

cboyer commented Apr 29, 2020

Zabbix version 4 is now supported with Mirthix 2.0.0.
Tested with Zabbix 4.4.7/3.4.12 and Mirth 3.9.0/3.2.1.
Just update Mirthix channel, no need to update Zabbix template.

@cboyer cboyer closed this as completed Apr 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants