Error when deploy

Hello guys,

I’m trying to deploy an update for one of my solutions and I got this error:

com.servoy.j2db.persistence.RepositoryException: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint “servoy_elements_pkey”

Then I deleted the solutions, restart the server, uploaded again, but I receive the same error. So now I don’t have the solution online and can’t upload.

PLEASE HELP, VERY URGENT !!!

Thanks,
Bogdan.

Weird… but if you are in a hurry you can drop all the repository tables and indexes and start servoy server using the -upgradeRepository flag basically forcing the creation of all the repository objects from scratch. Then you should be able to import again your solution. It’s like killing a mosquito with a gun but if you really are in a hurry…

OK, I’ll try like this.

But I must take care of the users also, because I have to restore them. Tables servoy_user_groups, servoy_user_properties and servoy_users? Shall I restore these ones to what I have now after recreating the repository? I’ll try to let them as they are for now and drop only the others.

I search a lot in that data base and couldn’t figure. It seems that in table servoy_element an new entry is added when deploy, but with same data as another. At least this is what I understand from that error now. It would be nice if I should know exactly what data is about to be duplicated, maybe there is a method uuid in my code, but I search for the new ones that I’ve added with no success.

Thanks for the tip.

I did something else for now. I manage to deploy the previous version which seems to work, at least I will test it. But still, the problem is not solved, because the version exported today from developer can’t be imported to the server due to that key constraint on the table servoy_elements.

Bogdan,

Do yo also get the error when you import the solution in a blank repository (liek Nicola suggests)?
If that happens some duplicate data must be in the export file.

Rob

Hello,

I didn’t had time to create a blank repository. What I did though, I check the uuid codes of the new elements that I’ve added since my previous release and none of them seems to be duplicated in the solution or with the elements existing in the elements table in repository. So it was really confusing.

But then I did something, although it’s not too elegant. I had also the luck that the solution with the problem was a relatively small one. So I remove all code from all forms and globals, saved the files, and then copy it back without the comments that include the uuid codes, which result in generating new uuid codes for the elements. Then it worked without any other problem.

I still didn’t understood the reason, because I didn’t notice any duplicated uuid element code. But since it worked, for now it’s OK.

Thanks,
Bogdan.

udrescu_bogdan:
Hello,

I didn’t had time to create a blank repository. What I did though, I check the uuid codes of the new elements that I’ve added since my previous release and none of them seems to be duplicated in the solution or with the elements existing in the elements table in repository. So it was really confusing.

But then I did something, although it’s not too elegant. I had also the luck that the solution with the problem was a relatively small one. So I remove all code from all forms and globals, saved the files, and then copy it back without the comments that include the uuid codes, which result in generating new uuid codes for the elements. Then it worked without any other problem.

I still didn’t understood the reason, because I didn’t notice any duplicated uuid element code. But since it worked, for now it’s OK.

Thanks,
Bogdan.

Hi!

I am encountering the same error when I import in servoy6

com.servoy.j2db.persistence.RepositoryException: org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "servoy_elements_pkey" Detail: Key (element_id, object_uuid, revision)=(86027, 3B4A5DA5-442C-49BB-9C30-4C7866027684, 1) already exists.

When I click on the Solution Menu my solution is there. But when I do a restart it’s not there anymore.
How did you remove the UUIDs?

Hi Rogel. I think that your problem is that two elememts are sharing the same UUID. Search the UUID that is shown in the error and you will see how many times it is used. Rhat might be because you have copied functions from other solutions, doing that the UUID is not regenerated.
I remember that I had that problem a few weeks ago.
I hope this can help you

jasantana:
Hi Rogel. I think that your problem is that two elememts are sharing the same UUID. Search the UUID that is shown in the error and you will see how many times it is used. Rhat might be because you have copied functions from other solutions, doing that the UUID is not regenerated.
I remember that I had that problem a few weeks ago.
I hope this can help you

Thanks! I saw the duplicate UUIDs and did a quick fix. :) Now I was able to deploy the solution.