onaio / kaznet-web

a tasking application built on top of Onadata
Apache License 2.0
4 stars 1 forks source link

Fixing errors in forms. #342

Closed FrankApiyo closed 5 years ago

FrankApiyo commented 5 years ago

When task_fetch_projects is run. all the metadata fields for the xforms are set correctly. After a few minutes though. They are reset to incorrect values.

FrankApiyo commented 5 years ago

I've determined that this is not caused by another task that runs after these json fields have been set correctly. This is because the unwanted resetting happens 2 to 3 minutes after the fields are set correctly. No task runs that often.

Further after stopping all the tasks. I am certain that this is not caused by a different task.

FrankApiyo commented 5 years ago

I copied the local_settings.py file from the kaznet-stage server to my local settings file and I've concluded that this problem is only isolated to the staging server so this issue is not in the code base

FrankApiyo commented 5 years ago

The Solution

It turns out that there was an older version of Kaznet on the server - connected to the same Kaznet database as the Kaznet stage web app, which ran the same periodic task and updated the Kaznet database. Crucially, since it was older code, it did not do any form validations and thus when it updated the Kaznet form metadata, it wiped/deleted the form validation metadata.We stopped this old Kaznet service, and deleted the old code

https://onaio.slack.com/archives/C763KH5PF/p1568191504001300