Unexpected exception while processing MQTT message

0

Hi I am getting the below error in greengrass.log (in core) each time I run the basic_discovery.py from a client device. The messages arrive and I can check them in MQTT tester but I need to see when

2023-12-20T21:14:50.501Z [ERROR] (nioEventLoopGroup-3-2) io.moquette.broker.NewNettyMQTTHandler: Unexpected exception while processing MQTT message. Closing Netty channel. CId=private_laptop. {}
java.io.IOException: Connection reset by peer
        at java.base/sun.nio.ch.FileDispatcherImpl.read0(Native Method)
        at java.base/sun.nio.ch.SocketDispatcher.read(SocketDispatcher.java:39)
        at java.base/sun.nio.ch.IOUtil.readIntoNativeBuffer(IOUtil.java:276)
        at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:233)
        at java.base/sun.nio.ch.IOUtil.read(IOUtil.java:223)
        at java.base/sun.nio.ch.SocketChannelImpl.read(SocketChannelImpl.java:356)
        at io.netty.buffer.PooledByteBuf.setBytes(PooledByteBuf.java:256)
        at io.netty.buffer.AbstractByteBuf.writeBytes(AbstractByteBuf.java:1132)
        at io.netty.channel.socket.nio.NioSocketChannel.doReadBytes(NioSocketChannel.java:357)
        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:151)
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:788)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:724)
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:650)
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:562)
        at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
        at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.base/java.lang.Thread.run(Thread.java:829)

Here are all my versions and environment setup: GG version: 2.12.1 Nucleus: 2.12.1 aws.greengrass.clientdevices.Auth 2.4.5 and configured as follows:

{
	"deviceGroups": {
		"formatVersion": "2021-03-05",
		"definitions": {
			"MyDeviceGroup": {
				"selectionRule": "thingName: private_laptop",
				"policyName": "MyClientDevicePolicy"
			}
		},
		"policies": {
			"MyClientDevicePolicy": {
				"AllowConnect": {
					"statementDescription": "Allow client devices to connect.",
					"operations": [
						"mqtt:connect"
					],
					"resources": [
						"*"
					]
				},
				"AllowPublish": {
					"statementDescription": "Allow client devices to publish to all topics.",
					"operations": [
						"mqtt:publish"
					],
					"resources": [
						"*"
					]
				},
				"AllowSubscribe": {
					"statementDescription": "Allow client devices to subscribe to all topics.",
					"operations": [
						"mqtt:subscribe"
					],
					"resources": [
						"*"
					]
				}
			}
		}
	}
}

MQTT 3.1.1 broker is used with default config MQTT bridge is configured as follows:

{
	"mqttTopicMapping": {
		"HelloWorldIotCoreMapping": {
			"topic": "clients/+/hello/world",
			"source": "LocalMqtt",
			"target": "IotCore"
		}
	}
}
  • IP detector is used with default config.
  • Client device is associated with the core device
  • Both client and core are added to the same thing group - Thing group has a policy to allow all iot* and greengrass::* for all resources (GreengrassV2IoTThingPolicy)
  • The core device is a Raspberry pi 3 B+ and the client device is Windows laptop
  • Core has a lot of free memory
  • 8883 port is opened on the core Any idea what can be the reason for this error?
Shiko
gefragt vor 5 Monaten248 Aufrufe
1 Antwort
0

Hi,

To be clear "The messages arrive", so everything is working?

"Connection reset by peer" means that the client disconnected without sending any disconnect packet. This is not a problem.

If functionality is working as expected, then there's nothing wrong from what I can tell.

Cheers,

Michael

AWS
EXPERTE
beantwortet vor 5 Monaten
profile picture
EXPERTE
überprüft vor 5 Monaten

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen