Potential issue with export module when reimporting V1 for a existing ID form


We had a critical issue yesterday on our standalone production server. It was impossible to generate exports whatever the form and we have lost an entire day of data collection (fortunately, we have detected the issue the day after !).

After investigating in the log files and in the database, I think we have detected a conception issue in the application Headquarters and the management of the database.

Here is below our scenario :

  • we have a form with the ID “myform” in production in a version V2.
  • we have an other form with the ID “myform_test” in our Designer account.
  • we want to migrate this form into production to replace the existing v2 to a new V3. To do that, we copy the form “myform_test” into a new one with the ID “myform”. Then, in the headquarters, we import the mask of this form and delete the obsolete one. The new form is versionned V1 because it has certainly an other internal ID.

I think this is a problem if the ID is the same and if the structure of the form has been modified (new variables, types, …). When we take a look at the PostgreSQL database, we see a schema with tables names myform$1, myform$1-v and myform$1-e. These tables keep the format of the historic V1 version of this form and is not modified with the new metadata.

The log files indicate that a field is missing each time we launch an export. I know we DON’T HAVE TO MODIFY THE DATABASE, but adding manually new fields in the tables directly in PostgreSQL, we have could made the export module work again and we could access ans export our lost data.

I am not sure to be clear in my exmplanations but I think this is potentially very dangerous for production environments and it could be useful for developers to take a look on this point.

Best regards

Thank you for letting us know.
The latest version of the product now deletes export data in case of deletion of questionnaire and extra check was introduced to avoid questionnaire impot with the same name to avoid potential collisions.