Describe the bug
Upgrading to polls 0.91 leads to a NotNullConstraintViolationException.
To Reproduce
I upgraded a test instance without problem. When I tried to upgrade a hosted instance the following error occured:
Doctrine\DBAL\Exception\NotNullConstraintViolationException: An exception occurred while executing 'INSERT INTO `oc_polls_votes` (`poll_id`, `user_id`, `vote_option_id`, `vote_option_text`, `vote_answer`) VALUES(?, ?, ?, ?, ?)' with params ["1", "Layma", null, "2018-05-29 14:30:00", "maybe"]: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'vote_option_id' cannot be null
Doctrine\DBAL\Exception\NotNullConstraintViolationException: An exception occurred while executing 'INSERT INTO `oc_polls_votes` (`poll_id`, `user_id`, `vote_option_id`, `vote_option_text`, `vote_answer`) VALUES(?, ?, ?, ?, ?)' with params ["1", "Layma", null, "2018-05-29 14:30:00", "maybe"]: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'vote_option_id' cannot be null
I'm afraid that I can't inquire further but I don't have access to this managed machine.
Expected behavior
Upgrading without problems.
Polls version? (see apps page)
0.8.3 auf 0.9.3
Fresh installation or update from a prior version (from which one)?
Update from prior version: 0.8.3
How did you install this version?(Appstore or describe installation)
I installed it via the web interface.
Nextcloud or ownCloud?
Nextcloud
Which Version?
14.0.3
Confirmed on 14.0.4 Upgrade from 0.8.3 to 0.9.3.
Renders the whole NC instance unusable.
Can you send me the polls_* tables? [email protected]
Seems that there are some corrupt entries in the old tables.
If there is no important data, you can
I had this error on one of my instances, but could not reproduce them.
I could reproduce this exeption. It is indeed an orphaned vote, which breaks the migration. Currently, I am testing a change to the migration. Stay tuned.
@v1r0x can we release a new version quickly with this patch?
@dartcafe I'm probably pretty busy during the holidays, but should have some free time on the 35c3 馃槈
@v1r0x I am in the last tests. Seems I could repair the migration.
Added a migration step before the initial migration and check if a prior migration failed. Worked in my instances. See #456 and 0.9.4 release
@lars-becker @bpcurse Can you confirm the migration is working now?
@lars-becker @bpcurse Can you confirm the migration is working now?
Sorry, I can't test it before the holidays are over. My local installation upgraded without problems. The instance with the problem is a hosted solution. I requested a dump, but haven't gotten one so far. Will give you feedback when I had a chance to test it; which will take a few days. Sorry.
@dartcafe @v1r0x
I have disabled polls and maintenance mode via php occ command after the update from 0.8.3 to 0.9.3 to make the instance work again. After updating the disabled app from 0.9.3 to 0.9.4 and activating it again, it works :smiley:
Thank you very much for the quick fix!
Addendum: The Update from 0.9.3 to 0.9.4 and reenabling the app was made via the NC Web GUI. After the update polls showed only the (correct) background colours of the voting fields without x, ? or the checkmark symbols. A simple browser restart solved this issue.
@bpcurse Thanks for taking time amd support and sorry for the inconvenience.
@lars-becker The new version 0.9.4 should work. Also 0.9.5 should do the job, but this version is not published in the app store at the moment. Thanks for reporting the issue.
I'm back from the holidays and can confirm that the problem was fixed in 0.94/0.95. Thanks for the quick fix and a happy new year!