Track logging to database via Php fails

Hello,

I have logging activated according to: https://wiki.mairlist.com/tutorials:other:online_playlist_on_your_website_with_php_mysql

It retrieves the information from to the broadcast machine with MS SQL and writes via Php file the track info into a mysql database on the webmachine. That all goes wel (check: www.classichits106.eu) but after a x period it stops. I know that there are a facts that could go wrong. What I would like to know if there is a event logging for the track logging function that contains info about for example the connection? (Windows eventlog shows only an error an hour earlier and kept working after that)

Since restarting Mairlist solves the problem I wonder if there is a way to (re)start the track logging function manually without ending the broadcast.

Thanks in advance.

So you have set up an HTTP (POST or GET) logging in mAirList, right? No scripting involved on the mAirList side? All logic in the PHP script?

So all that could go wrong is the HTTP call, and if so, there should be an error message in mAirList’s System Log about it.

manual action “http://account:password@www.classichits106.eu/loggingfile.php?artist=No+Doubt&title=Don’t+Speak&externalid=9155” is accepted by the webserver

Thanks Torben. Yes there is a script(forgot about that one). Not needed because all logic is indeed in the php file. I will get rid of that first and restart mAirlist. It can take a day before it stops again. No error in the system log.

Will post the results as soon as possible.

No script running and again it the logging stopped:

PHP code:

$db = mysqli_connect(‘localhost’, ‘account’, password’, ‘website_DB’);

$artist = mysqli_escape_string($db, $_GET[‘artist’]);
$title = mysqli_escape_string($db, $_GET[‘title’]);
$id = mysqli_escape_string($db, $_GET[‘externalid’]);

mysqli_query($db, “INSERT INTO playlistlog (starttime, artist, title, externalid) VALUES (NOW(), ‘$artist’, ‘$title’,’$id’)”);

No error around time 09:45 in Mairlist system log or windows eventlog of both mairlist machine and webserver.

It seems that once it fails it does not try again until Mairlist is restarted.
Is there another way to start the track logging again manually without a restart of Mairlist? This gives me a bit more time to monitor things.

When it happens again, please send a bug report from the About menu - I can check if the logging background thread is stuck, and if so, where it is stuck.

Hi Torben,

Still waiting to see if the problem is permantly solved now.

For those who might have this problem in the future:
In case of an URL based logging: if the playlist logging fails once, it will not longer retry to execute the requested action.

Steps to reproduce:
Machine A: Full mairlist configuration
Machine B: Webserver and second database server(mysql).

The playlistlogging.php that is configured in Mairlist(on Machine A) calls the php on machine B. When the webserver is rebooted or disconnected and the webcall once fails it never tries again.

Solution (until now it seems to work):
Go to the place you activated the base url.
Click on the tab “options”
Unselect the option: Disable when OFF AIR and save the set options.

I am not sure if this meant to work this way, but since I disabled it, the website is working again(or is it just a reset with new settings) :slight_smile:

Still not sure why this would happen. At least in the report you sent, there was no “stuck” background thread or so.

When the request failed for the first time, did you get any error message in the log? Like connection timeout or connection refused etc.?

Hi Torben,

I did not find any reason for this. But the “Disable when OFF AIR” setting adjustment seems to work even after a problem with the webserver. I do not know if there are any side affects but so far everything is working great again!