# Error processing mqtt message

**URL:** <https://community.openhab.org/t/error-processing-mqtt-message/32916>\
**Category:** Beginners\
**Tags:** mqtt, mqtt-binding\
**Created:** [August 7, 2017, 1:27pm UTC](https://community.openhab.org/t/error-processing-mqtt-message/32916 "2017-08-07T13:27:50Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![jasperhb](https://community.openhab.org/letter_avatar_proxy/v4/letter/j/a587f6/32.png) [@jasperhb](https://community.openhab.org/u/jasperhb)\
**Post date:** [August 7, 2017, 1:27pm UTC](https://community.openhab.org/t/error-processing-mqtt-message/32916/1 "2017-08-07T13:27:51Z")

</div>

I set up MQTT 3-4 weeks ago. It worked fine.

Then we went on vacation and as we got back I am now seening errors. I have changed nothing in the interim period, and everything worked for days before we went away.

I get the following error everytime a message is received from MQTT. Why do I get these error and more importantly, how do I fix this?

> 2017-08-07 15:20:31.403 [ERROR] [.mqtt.internal.MqttMessageSubscriber] - Error processing MQTT message.  
> org.openhab.core.transform.TransformationException: An error occurred while opening file.  
> at org.openhab.core.transform.TransformationHelper$TransformationServiceDelegate.transform(TransformationHelper.java:62)[195:org.openhab.core.compat1x:2.1.0]  
> at org.openhab.binding.mqtt.internal.MqttMessageSubscriber.processMessage(MqttMessageSubscriber.java:138)[190:org.openhab.binding.mqtt:1.10.0]  
> at org.openhab.io.transport.mqtt.internal.MqttBrokerConnection.messageArrived(MqttBrokerConnection.java:556)[197:org.openhab.io.transport.mqtt:1.10.0]  
> at org.eclipse.paho.client.mqttv3.internal.CommsCallback.deliverMessage(CommsCallback.java:475)[197:org.openhab.io.transport.mqtt:1.10.0]  
> at org.eclipse.paho.client.mqttv3.internal.CommsCallback.handleMessage(CommsCallback.java:379)[197:org.openhab.io.transport.mqtt:1.10.0]  
> at org.eclipse.paho.client.mqttv3.internal.CommsCallback.run(CommsCallback.java:183)[197:org.openhab.io.transport.mqtt:1.10.0]  
> at java.lang.Thread.run(Thread.java:748)[:1.8.0\_144]

---

<div class="post-metadata">

**Author:** ![Dim](https://community.openhab.org/user_avatar/community.openhab.org/dim/32/4568_2.png) [@Dim](https://community.openhab.org/u/Dim)\
**Post date:** [August 7, 2017, 2:44pm UTC](https://community.openhab.org/t/error-processing-mqtt-message/32916/2 "2017-08-07T14:44:17Z")

</div>

![image](https://community-openhab-org.s3-eu-central-1.amazonaws.com/original/2X/9/97d41672739e85926a2f42fdb83a578229e7dec2.jpg)

> [@Beginner's Guide for Topic Creation](https://community.openhab.org/t/beginners-guide-for-topic-creation/32238):
>
> Dear All, Lately I have read a lot of the beginner’s issues posted here and I found out that we lose a lot of time finding out the real problems that people are trying to solve using this forum. @rlkoshak, @Udo_Hartmann, @Dim, @rossko57, @sihui, @ThomDietrich and many others (sorry for not mentioning you all) lose a lot of time just finding out step by step what the problem really is (sometimes I have the feeling that we are pulling teeth out of the topic’s creator’s mouth). We lose this time…

---

<div class="post-metadata">

**Author:** ![jasperhb](https://community.openhab.org/letter_avatar_proxy/v4/letter/j/a587f6/32.png) [@jasperhb](https://community.openhab.org/u/jasperhb)\
**Post date:** [August 7, 2017, 11:00pm UTC](https://community.openhab.org/t/error-processing-mqtt-message/32916/3 "2017-08-07T23:00:12Z")

</div>

That is funny 🙂

Anyhow the config is super simple:

> mqtt:iotbroker.url=tcp://localhost:1883  
> mqtt:iottbroker.qos=1

The Mosquitto service is running on the same RPi as OpenHAB.

Also, if I read the error correctly (which I very well might not) then it’s not a mqtt config issue, rather it is an issue related to processing the message specifically related to “Opening the file” - whatever that means?

What frustrates me is that I changed NOTHING. All I did was to update OpenHAB using:

a) `sudo openhabian-config`  
b) `01 | Upgrade System : Upgrade all installed software packages to their newest version`.

I was sort of hoping that someone could tell me what changed/broke with the latest updates?

---

<div class="post-metadata">

**Author:** ![namraccr](https://community.openhab.org/user_avatar/community.openhab.org/namraccr/32/36484_2.png) [@namraccr](https://community.openhab.org/u/namraccr)\
**Post date:** [August 7, 2017, 11:34pm UTC](https://community.openhab.org/t/error-processing-mqtt-message/32916/4 "2017-08-07T23:34:37Z")

</div>

Item configs and debug log would be helpful.

> [@jasperhb](#):
>
> org.openhab.core.transform.TransformationException: An error occurred while opening file.  
> at org.openhab.core.transform.TransformationHelper$TransformationServiceDelegate.transform(TransformationHelper.java:62)[

This would appear to indicate there’s a transform in place and the failure is in opening the file for the transform.

---

<div class="post-metadata">

**Author:** ![David\_Graeff](https://community.openhab.org/user_avatar/community.openhab.org/david_graeff/32/61322_2.png) [@David\_Graeff](https://community.openhab.org/u/David_Graeff)\
**Post date:** [August 8, 2017, 2:05am UTC](https://community.openhab.org/t/error-processing-mqtt-message/32916/5 "2017-08-08T02:05:39Z")

</div>

Because it worked for weeks, personally I thing your Operating system ran out of file descriptors. The limit on linux per user is usually something like 65k. But imagine you receive two messages each minute: 3 weeks = 21 days = 504 hours = 30240 minutes and bam you are our of file descriptors.

This assumes that there is a serious bug in the used transformation that does not free used file descriptors (which is easy, you just need to forget the `.close()` call).

It might be another cause, check it with this command to count open file descriptors:  
`lsof | wc -l`

Cheers,  
David

---

<div class="post-metadata">

**Author:** ![chimera](https://community.openhab.org/letter_avatar_proxy/v4/letter/c/8e8cbc/32.png) [@chimera](https://community.openhab.org/u/chimera)\
**Post date:** [August 8, 2017, 2:54am UTC](https://community.openhab.org/t/error-processing-mqtt-message/32916/6 "2017-08-08T02:54:36Z")

</div>

…and I assume you’ve tried the obvious… reboot? Same occurs after that?

---

<div class="post-metadata">

**Author:** ![Max\_G](https://community.openhab.org/user_avatar/community.openhab.org/max_g/32/64598_2.png) [@Max\_G](https://community.openhab.org/u/Max_G)\
**Post date:** [August 8, 2017, 8:58am UTC](https://community.openhab.org/t/error-processing-mqtt-message/32916/7 "2017-08-08T08:58:19Z")

</div>

Reboot: Not a good idea – yes, it is easy, but provides no chance in hell to find the root cause.

> [@David\_Graeff](#):
>
> It might be another cause, check it with this command to count open file descriptors:  
> lsof | wc -l

Is more like it… my rPi is running for 46 days and has 41000 open file descriptors… will check weekly to see, whether I need to be concerned. However, OH is only 400, and mosquitto some 20.
