Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Polls upgrade leads to NotNullConstraintViolationException #453

Closed
lars-becker opened this issue Dec 21, 2018 · 14 comments
Closed

Polls upgrade leads to NotNullConstraintViolationException #453

lars-becker opened this issue Dec 21, 2018 · 14 comments
Labels
Milestone

Comments

@lars-becker
Copy link

What is going wrong?

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.

Information about your polls installation

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.

Information about your Instance of Nextcloud/ownCloud

Nextcloud or ownCloud?
Nextcloud

Which Version?
14.0.3

@bpcurse
Copy link

bpcurse commented Dec 21, 2018

Confirmed on 14.0.4 Upgrade from 0.8.3 to 0.9.3.
Renders the whole NC instance unusable.

@dartcafe
Copy link
Collaborator

dartcafe commented Dec 21, 2018

Can you send me the polls_* tables? [email protected]
Seems that there are some corrupt entries in the old tables.

@dartcafe
Copy link
Collaborator

If there is no important data, you can

  • disable the polls app
  • delete polls_* tables, if you have access to the database.

I had this error on one of my instances, but could not reproduce them.

@dartcafe
Copy link
Collaborator

dartcafe commented Dec 22, 2018

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?

@v1r0x
Copy link
Collaborator

v1r0x commented Dec 22, 2018

@dartcafe I'm probably pretty busy during the holidays, but should have some free time on the 35c3 😉

@dartcafe
Copy link
Collaborator

@v1r0x I am in the last tests. Seems I could repair the migration.

@dartcafe dartcafe added the bug label Dec 22, 2018
@dartcafe dartcafe added this to the 0.9.4 milestone Dec 22, 2018
@dartcafe
Copy link
Collaborator

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

@dartcafe
Copy link
Collaborator

@lars-becker @bpcurse Can you confirm the migration is working now?

@lars-becker
Copy link
Author

@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.

@bpcurse
Copy link

bpcurse commented Dec 22, 2018

@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 😃
Thank you very much for the quick fix!

@bpcurse
Copy link

bpcurse commented Dec 22, 2018

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.

@dartcafe
Copy link
Collaborator

@bpcurse Thanks for taking time amd support and sorry for the inconvenience.

@dartcafe
Copy link
Collaborator

@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.

@lars-becker
Copy link
Author

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants