"The message container is being closed" RRS feed

  • Question

  • Hi,

    We've been working with IoT Hub and using the Node JS sdk to create a client that could listen to that hub for messages and act on them. 

    Our client runs fine, but occasionally we start to see "The message container is being closed" come through the console.  No error seems to be firing.

    We have 4 partitions on our IoTHub, and after we see that message 4 times, we stop receiving any messages.  Again, the client seems happy.  It's just not doing anything any more.

    I'm also not sure about this yet, but it seems that our Network I/O has a bit of a spike from the client to our pub/sub engine after we get one of these messages.  Leaves me to suspect perhaps the other partitions are somehow feeding me old messages from the closed partition?

    Example message:

    <style type="text/css">p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #f5f5f5; background-color: #000000} span.s1 {font-variant-ligatures: no-common-ligatures} </style>

    The message container is being closed (176293). TrackingId:c57ce8a7-f1e6-4e6e-93c9-693b334530cb_B4, SystemTracker:NoSystemTracker, Timestamp:2/2/2017 3:23:46 PM

    Thursday, February 2, 2017 4:37 PM

All replies

  • This message also appears to be related:

    <style type="text/css">p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 10.0px Monaco; color: #f5f5f5; background-color: #000000} span.s1 {font-variant-ligatures: no-common-ligatures} </style>

    The connection was inactive for more than the allowed 240000 milliseconds and is closed by container '82759a614a69425884cc1c94c2705a5f_G11'.

    Thursday, February 2, 2017 5:23 PM
  • Hi Team Leverage,

    I am not familiar with Node and Azure IoT Hub so please don't take this as an answer, just an interpretation or idea as I may be missing the point entirely.  I find the work ligature in the messages frightening actually :). For what it is worth, I did take a look at the docs here https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-node-node-c2d

    It seems like the "messages" might essentially be events rather than something you stream constantly. As the text states a connection was open too long without activity maybe your code should use two models:

    • open connection -> check for messages -> close connection
    • open connection -> send telemetry -> close connection

    These could be done on a time based cycle rather than keeping a streaming style of connection open.  Again, I am only guessing here based on the content of the messages you posted above.




    Thursday, February 2, 2017 10:49 PM
  • Thanks IoTGirl,

    I've considered doing something like that, but the start-up time of the scripts is a bit prohibitive. We're looking for near-real-time data passage in some cases.

    From what I understand, IoTHub is essentially an Event Hub in Azure, and as such (if I understand correctly), opening a connection and just listening for events should be a standard approach.  Indeed, the IoTHub javascript sdk does just that.  

    One mitigation possibility I have considered is just periodically closing and reconnecting, but again I don't really like to have to take on that latency if I don't have to do so.

    Friday, February 3, 2017 5:40 PM
  • Can you specify what version of the Node JS SDK you are on?

    Thanks Roopesh [This posting is provided "AS IS" with no warranties, and confers no rights.] [P.S. If the post answers your question or guides you about what you're looking for, please mark it as answered.]

    Tuesday, February 7, 2017 7:53 PM
  • Hi Roopesh Manda,

    I`ve met the same situation, it comes a several times a day, my log:

    ==== From: MyDeviceID ====
    "Speed": 0,  
    "PowerVoltage": 24.06,  
    "PowerAmpere": 0.01,  
    "timecreated": "Thu Jul 20 2017 17:11:51 GMT+0300 (EEST)"
    ---- properties ----
    Error: The message container is being closed (109199). TrackingId:f1969862-1e38-4d52-9b66-3e299d667d1d_B3, SystemTracker:NoSystemTracker, Timestamp:7/20/2017 2:11:52 PM

    My Node JS SDK version:

    >node -v

    • Edited by YSlipchuk Friday, July 21, 2017 6:07 AM
    Friday, July 21, 2017 6:03 AM
  • Do you have more than one process attempting to connect to Azure at one time?  
    It is my understanding that one device can only have one open connection at one time so that leaves two options:

    1. Have one bit of code manage the connection for the multiply processes

    2. Treat the connection like a mutex so only one process can use it at a time.

    Friday, July 21, 2017 6:38 AM
  • I have just one process that send data to Azure every second.
    Monday, July 24, 2017 6:50 AM
  • It looks like Azure is tracking a number of similar issues on their GitHub. Check out https://github.com/Azure/azure-event-hubs-node/issues/26
    Thursday, August 10, 2017 7:09 PM