softins / jamulus-php

PHP script to fetch info from Jamulus servers and return as JSON
5 stars 5 forks source link

improper CRC checksums #5

Open mcfnord opened 1 year ago

mcfnord commented 1 year ago

I just noticed a new, occasional error:

"CRC mismatch in received message"

https://github.com/softins/jamulus-php/blob/master/servers.php#L648

Looks like a Jamulus server is producing packets with improper CRC checksums.

The recurrence seems very low, perhaps once every ten minutes.

I'm not sure how to learn more. Maybe logging at a debug level could reveal the server address.

softins commented 1 year ago

Interesting. Either a bug in the server sending, or in the PHP validation. Does it happen with all three back-ends? Do you have any clue which directory list it's in? I could add some debug to my Linode back-end, and/or you could to the SF one.

softins commented 1 year ago

I have updated servers.php with commit https://github.com/softins/jamulus-php/commit/4cde755b69376eb16e2b1bb861af50d23dfca9ec so that most errors are no longer fatal with die(), but instead log the error, including the ip and port number, and continue after discarding the message.

Depending on server configuration, the error log will probably be in /var/log/php-fpm/.

The London Linode back-end is now using this code.

mcfnord commented 1 year ago

Logging it and making it non-fatal are both great moves. Guess I should monitor that log. I only draw from my back-end, so I can't compare results. I logged 43 instances, and tried to determine the directory, but couldn't. The pattern stopped about 12 hours ago, so I'll close this for now.

mcfnord commented 1 year ago

Heads up! I've seen 5 today:

CRC mismatch in received message

Still don't know which directory. Not sure I'm running your latest bits. I have another issue where my log gets a zillion of these:

_[26-Mar-2023 00:07:42] WARNING: [pool www] server reached pm.maxchildren setting (5), consider raising it

... because I do send 7 requests at once.

Maybe if you're bored you can look at your logs for the CRC mismatch origin.

softins commented 1 year ago

Yes, I can see two in the logs on my London Linode back-end:

# fgrep CRC *
www-error.log:[28-Mar-2023 00:19:40 Europe/London] CRC mismatch in received message from 96.32.215.92:39059
www-error.log:[30-Mar-2023 01:30:55 Europe/London] CRC mismatch in received message from 96.32.215.92:47288

That IP is somewhere in Colorado, but at this moment there is no server registered with that IP to any directory.

mcfnord commented 1 year ago

Could also be Georgia. Curious there are two different ports.