No errors in ODK - but error in deploying on Kobo

I am able to open the questionnaire in ODK but when trying on Kobo it doesnt work. It says: unable to deploy
your form cannot be deployed because it contains errors:

duplicate key value violates unique constraint “logger_xform_user_id_45289a11b89d131b_uniq” DETAIL: Key (user_id, id_string)=(545002, aHDF8hDsUkWCUtpBjCdtkg) already exists.

1 Like

@arteseflorinda, maybe validate your XLSForm through the online validator first.

As I said in the title of the post, the form as no errors in ODK. It works perfectly on ODK.

Which server are you using, please?
Do you use external files in the form?

1 Like

sever: the one for organization - kc.humanitarianresponseinfo
external file yes, because I copied and pasted some list names from another file

The same excel file works perfectly on ODK:

The problem is not related to the connection, as my connection works perfectly and I am able to do other tasks with my internet

Could you share your form (anomysed) here, to facilitate support, please?

You could try to locate the problem, by stripping down the form temporarily. For ex. you may first try only the part referencing the external file. And you may exclude parts by renaming XLSForm columns to invalud names, e.g. XXconstraint, XXrelevant.

1 Like

@arteseflorinda, maybe you could share your XLSForm with the community so that the community can help you identify the issue for you.

@arteseflorinda Have you found a solution ?

I’m currently facing (nearly) the same issues when deploying multiple surveys. Example of errors 400 I’m getting :

duplicate key value violates unique constraint “odk_logger_xform_id_string_21739285f0b06be_uniq” DETAIL: Key (id_string, user_id)=(aM4WWKwos6NoqnrRtxqS3f, 37662) already exists.
duplicate key value violates unique constraint “odk_logger_xform_id_string_21739285f0b06be_uniq” DETAIL: Key (id_string, user_id)=(aBkAiexXCNR5GzY7iFUXeG, 37662) already exists.

My guess is that it’s not due to the xlsform itself.
Because, I’m able to clone the issued survey and then the deployement works on this cloned survey.
My guess is that it’s more due to some database unique constraints on the logs of the deployement which triggers this issue, probably because there was a previous log with the same id.
I don’t know how the id_string of a survey is generated and if it’s possible that a previously deleted form could have this same id_string.

So to recap of my guess :

  1. A form A is created with (id_string = aHDF8hDsUkWCUtpBjCdtkg)
  2. Form A is deployed. (the log with the (user_id, id_string) (545002, aHDF8hDsUkWCUtpBjCdtkg) is created)
  3. The form A is deleted (but not the logs associated)
  4. A new form B is created, but has the same id_string than deleted form A (aHDF8hDsUkWCUtpBjCdtkg) (why ? I don’t know…)
  5. Deployement fails, because the log unique constraint fails because it has the same (user_id, id_string)

Question is, how is the form id_string generated ? Is it random or is it created based on some specific values (user_id, form_name, …) ? This would probably help us circumvent this error, in order to create random id_strings.
If you have this information it would be highly appreciated.

Thank you for your support ! and for this tool!

Welcome to the community, @pl_duthoit! Have you had a chance to validate your XLSForm through this online validator to see if there are any syntax issues?

i can deploy

1 Like