braice / MuMuDVB

A DVB IPTV streaming software
http://mumudvb.braice.net/
GNU General Public License v2.0
219 stars 133 forks source link

Unclosed bracket in state json #318

Closed trifle closed 6 months ago

trifle commented 8 months ago

Hi, I just noticed that we get some json decoding errors on monitor/state.json. The culprit is a missing opening square bracket in the clients list. Here is a snippet containing that region:

        {
             "number": 1535,
             "type": "PCR",
             "language": "---"
             }
        ],
    "clients":      ] #THIS IS INVALID
    },

    {
    "number": 7,

This machine is running MuMuDVB Version 2.1.0_20181020_mumudvb2 which I built from git-master using the default config IIRC.

The error currently shows on two out of multiple tuners but was absent in some previous tests. Perhaps there was a related bugfix earlier that we missed, in that case sorry for the noise here. If I can do anything to help with debugging I'm happy to help.

Regards and thanks for making mumudvb, Pascal

[edit] The version we're running is built from current up-to-date master from git.

braice commented 8 months ago

Hello

Do you have an older version that do not show the bug or is it present in everything you tried ?

Brice

On Wed, Mar 6, 2024 at 4:30 PM Pascal Jürgens @.***> wrote:

Hi, I just noticed that we get some json decoding errors on monitor/state.json. The culprit is a missing opening square bracket in the clients list. Here is a snippet containing that region:

  {
       "number": 1535,
       "type": "PCR",
       "language": "---"
       }
  ],

"clients": ] #THIS IS INVALID },

{ "number": 7,

This machine is running MuMuDVB Version 2.1.0_20181020_mumudvb2 which I built from git-master using the default config IIRC.

The error currently shows on two out of multiple tuners but was absent in some previous tests. Perhaps there was a related bugfix earlier that we missed, in that case sorry for the noise here. If I can do anything to help with debugging I'm happy to help.

Regards and thanks for making mumudvb, Pascal

— Reply to this email directly, view it on GitHub https://github.com/braice/MuMuDVB/issues/318, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACRID4CPVQXTVDJW5LVXZLYW4ZCRAVCNFSM6AAAAABEJI5CW2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGE3TCNZYHAYTGNQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

trifle commented 8 months ago

You mean older versions of the JSON response? I do have a historical archive of those, so I can go back and search for valid examples if it helps. Will report back.

braice commented 8 months ago

I mean does an older version of MuMuDVB is functional relative to this issue ? If it is the case we can git bissect to find when the error was introduced !

On Fri, Mar 8, 2024 at 10:36 AM Pascal Jürgens @.***> wrote:

You mean older versions of the JSON response? I do have a historical archive of those, so I can go back and search for valid examples if it helps. Will report back.

— Reply to this email directly, view it on GitHub https://github.com/braice/MuMuDVB/issues/318#issuecomment-1985361120, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACRID6UEUVV2ABVOCC6QRTYXGBCZAVCNFSM6AAAAABEJI5CW2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOBVGM3DCMJSGA . You are receiving this because you commented.Message ID: @.***>

braice commented 8 months ago

Hello

I have this in the code I see a square bracket opening,

Could you please send me a bit more info so I can check ?

    unicast_reply_write(reply, "\n\t\t],\n\t\"clients\": [\n");
    unicast_send_client_list_js(channels[curr_channel].clients, reply);
    if(channels[curr_channel].num_clients)
        reply->used_body -= 2; // dirty hack to erase the last comma
    else
        unicast_reply_write(reply, "\t\t{}\n");
    unicast_reply_write(reply, "\t\t]\n\t},\n");

On Wed, Mar 6, 2024 at 4:30 PM Pascal Jürgens @.***> wrote:

Hi, I just noticed that we get some json decoding errors on monitor/state.json. The culprit is a missing opening square bracket in the clients list. Here is a snippet containing that region:

  {
       "number": 1535,
       "type": "PCR",
       "language": "---"
       }
  ],

"clients": ] #THIS IS INVALID },

{ "number": 7,

This machine is running MuMuDVB Version 2.1.0_20181020_mumudvb2 which I built from git-master using the default config IIRC.

The error currently shows on two out of multiple tuners but was absent in some previous tests. Perhaps there was a related bugfix earlier that we missed, in that case sorry for the noise here. If I can do anything to help with debugging I'm happy to help.

Regards and thanks for making mumudvb, Pascal

— Reply to this email directly, view it on GitHub https://github.com/braice/MuMuDVB/issues/318, or unsubscribe https://github.com/notifications/unsubscribe-auth/AACRID4CPVQXTVDJW5LVXZLYW4ZCRAVCNFSM6AAAAABEJI5CW2VHI2DSMVQWIX3LMV43ASLTON2WKOZSGE3TCNZYHAYTGNQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

trifle commented 6 months ago

Hi braice, sorry for taking quite some time. The error disappeared after some time, and hasn't come up again. In the absence of a good testing condition, I would simply chalk this up to some station sending non-compliant data (which they surprisingly do quite often).

If I run across the error I can re-open again. Sorry for the noise and thanks for your work!