Hi all,
Since I've been using LimeSurvey, I've run into a problem where on occasion, when a response is submitted, two database entries appear in the survey_xxxxxx database. They each have the same token, but a different seed. The first one will have all null answers/datetime/etc, the other contains the correct actual submitted information.
Background:
- I run a backend system that uses the API to add invites. In the past I had this issue also when directly adding invites in the database.
- This has occurred from V3.x onwards in several versions, up to now when I have updated everything to 4.3.18 (200928). I had several instances installed, all exhibited this behaviour from time to time, with no appearent pattern to it (different invited users, etc)
- The webserver logs show no errors
- Using MySQL, PHP 7.4 now, but the issue arose from PHP7.0.x onwards. All required and recommended modules are installed/enabled.
- SQL Servertype: MariaDB, 10.3.23-MariaDB-log-cll-lve - MariaDB Server, Protocol v10
- Have used Installatron install packages, and now manually installed packages, still the same result
The problem is, that when using Limesurvey, it reads the first entry from the database which usually is the null entry. So the respondent seems in the result to not have submitted any answers. When in fact, when I delete the null entry, the correct answers appear. Same behaviour when I read the results by token using the API.
It's difficult to troubleshoot, and even difficult to detect. I've now written a PHP script that detects double token entries to alert me, so I can keep track of it. Of about 80-100 invites per day, about 1 will have such a problem. It's not always the same respondent.
I'm looking for ways to find more information. I've found the option to increase debugging, but I read everywhere this will output to the screen? I don't want that for my users, can it be logged to file as well? I'm sure it can, but I haven't found it (I really did try -- sorry about that!).
Any possible other options I could try to improve database queries or the likes? To prevent this?