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

Database error when running migration 050100Date20230515083001 for app polls Column "oc_polls_options"."poll_option_hash" is NotNull #3067

Closed
5 of 12 tasks
p-sims opened this issue Sep 11, 2023 · 7 comments · Fixed by #3069
Labels
Milestone

Comments

@p-sims
Copy link

p-sims commented Sep 11, 2023

⚠️ This issue respects the following points: ⚠️

  • This is a bug, not a question or a configuration/webserver/proxy issue.
  • This issue is not already reported on Github (I've searched it).
  • I agree to follow Nextcloud's Code of Conduct.

What went wrong, what did you observe?

Issue #2884 seems to have re-appear in a slightly different form...

I've just updated from NC24 to NC25.0.10:

Polls was working fine before hand.
The update seemed to disable polls which I didn't spot at first.
I just when to re-enable it and prehaps wrongly updated polls to 5.3.0 first.
I then when to enable it and it now produces this error:

Database error when running migration 050100Date20230515083001 for app polls Column "oc_polls_options"."poll_option_hash" is NotNull, but has empty string or null as default.

Screenshot 2023-09-08 at 12 32 33

From looking at discussion above this looks like similar problem relating to poll_option_hash. My guess is that the migration fix added to 5.0.5 added as result of discussion above is failing because neither hash is present or column is null...

These are Nextcloud error log enteries:
Screenshot 2023-09-08 at 13 02 50

Just logged into the database, and it would appear that 'poll_option_hash' column doesn't exist...
https://user-images.githubusercontent.com/64636731/266703706-679b5df2-d671-45dc-91cc-81997b206a17.png
https://user-images.githubusercontent.com/64636731/266703714-f79c25da-a5c9-4d52-b769-2aaf38521e02.png

What did you expect, how polls should behave instead?

When you try and re-enable poll after updating from Nextcloud 24 to 25, the migration process should run to completion and polls should end up enabled.

What steps does it need to replay this bug?

Difficult to say whether this would be re-produced with fresh install of nextcloud 24, install of polls (version from release of NC24?) and then update to NC25, upgrade polls and try to enable polls...

However these were circumstances in which I can re-reproduce issue:

  1. Established NC24 install with poll running (probably a 2022 version) which varies polls created and used.
  2. Upgrade to NC 25.0.10
  3. Upgrade polls to 5.3.0
  4. Try to re-enable polls and it will repeatedly fail as stated above.

Installation method

Installed/updated from the appstore (Apps section of your site)

Installation type

Updated from a minor version within same major version (i.e. 4.0.0 to 4.1.1)

Affected polls version

Upgrade to 5.3.0

Which browser did you use, when experiencing the bug?

  • Firefox
  • Chrome
  • Chromium/Chromium based (i.e. Edge)
  • Safari
  • Other/Don't know

Other browser

No response

Add your browser log here

N/A

Additional client environment information

No response

NC version

Nextcloud 25 (Nextcloud Hub 3)

Other Nextcloud version

25.0.10

PHP engine version

PHP 8.1

Other PHP version

No response

Database engine

MariaDB

Database Engine version or other Database

10.5.22

Which user-backends are you using?

  • Default user-backend (database)
  • LDAP/ Active Directory
  • SSO - SAML
  • Other/Don't know

Add your nextcloud server log here

![Screenshot 2023-09-08 at 13 02 50](https://github.com/nextcloud/polls/assets/64636731/a1a9d863-4e74-437b-8f68-469e73e5acea)

Additional environment informations

No response

Configuration report

{
    "system": {
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "chiltern.org.uk",
            "cloud.chiltern.org.uk",
            "engineering.chiltern.org.uk"
        ],
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "overwritehost": "cloud.chiltern.org.uk",
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "overwrite.cli.url": "https:\/\/cloud.chiltern.org.uk\/",
        "dbtype": "mysql",
        "version": "25.0.10.1",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "htaccess.RewriteBase": "\/",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_smtpauthtype": "LOGIN",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "theme": "",
        "loglevel": 0,
        "ldapIgnoreNamingRules": false,
        "ldapProviderFactory": "\\OCA\\User_LDAP\\LDAPProviderFactory",
                "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "mail_smtpsecure": "tls",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "mysql.utf8mb4": true,
        "appstore.timeout": 3000,
        "enabledPreviewProviders": [
            "OC\\Preview\\PNG",
            "OC\\Preview\\JPEG",
            "OC\\Preview\\GIF",
            "OC\\Preview\\HEIC",
            "OC\\Preview\\BMP",
            "OC\\Preview\\XBitmap",
            "OC\\Preview\\MP3",
            "OC\\Preview\\TXT",
            "OC\\Preview\\MarkDown",
            "OC\\Preview\\PDF"
        ],
        "mail_sendmailmode": "smtp",
        "data-fingerprint": "487437d5ebb2ba9b975908f33a4ab435",
        "default_phone_region": "GB",
        "app_install_overwrite": [
            "richdocuments"
        ]
    }
}

List of activated Apps

Enabled:
  - activity: 2.17.0
  - admin_audit: 1.15.0
  - announcementcenter: 6.6.2
  - bruteforcesettings: 2.5.0
  - circles: 25.0.0
  - cloud_federation_api: 1.8.0
  - cms_pico: 1.0.21
  - comments: 1.15.0
  - contactsinteraction: 1.6.0
  - dashboard: 7.5.0
  - dav: 1.24.0
  - deck: 1.8.5
  - federatedfilesharing: 1.15.0
  - federation: 1.15.0
  - files: 1.20.1
  - files_external: 1.17.0
  - files_pdfviewer: 2.6.0
  - files_rightclick: 1.4.0
  - files_sharing: 1.17.0
  - files_trashbin: 1.15.0
  - files_versions: 1.18.0
  - fileslibreofficeedit: 1.1.0
  - firstrunwizard: 2.14.0
  - forms: 3.3.1
  - logreader: 2.10.0
  - lookup_server_connector: 1.13.0
  - nextcloud_announcements: 1.14.0
  - notifications: 2.13.1
  - oauth2: 1.13.1
  - password_policy: 1.15.0
  - photos: 2.0.1
  - privacy: 1.9.0
  - provisioning_api: 1.15.0
  - quota_warning: 1.17.0
  - recommendations: 1.4.0
  - related_resources: 1.0.4
  - serverinfo: 1.15.0
  - settings: 1.7.0
  - sharebymail: 1.15.0
  - spreed: 15.0.7
  - support: 1.8.0
  - survey_client: 1.13.0
  - systemtags: 1.15.0
  - tasks: 0.15.0
  - text: 3.6.0
  - theming: 2.0.1
  - twofactor_backupcodes: 1.14.0
  - updatenotification: 1.15.0
  - user_status: 1.5.0
  - viewer: 1.9.0
  - weather_status: 1.5.0
  - workflow_media_converter: 1.8.4
  - workflowengine: 2.7.0
Disabled:
  - duplicatefinder: 0.0.15
  - encryption
  - files_accesscontrol: 1.14.1
  - files_automatedtagging: 1.14.2
  - files_retention: 1.14.1
  - groupfolders: 13.1.5
  - listman: 20.2.2
  - onlyoffice: 7.9.0
  - polls: 3.8.4
  - ransomware_protection: 1.14.0
  - registration: 2.2.0
  - suspicious_login
  - twofactor_totp
  - user_ldap: 1.8.1

Nextcloud Signing status

No errors have been found.

Additional Information

As suggested by @dartcafe I've tried running polls:db:rebuild but apparently command isn't know in the name space...

Screenshot 2023-09-11 at 09 18 06

@dartcafe
Copy link
Collaborator

Yes, unfortunately polls must be enabled for that. Comming from 3.8.4 is a huge step. But I got behind that:

The default for option_hash is set to an empty string which obviously also forbidden when null is not allowed. I guess we have to set NotNull = false.

@p-sims
Copy link
Author

p-sims commented Sep 14, 2023

Many Thanks @dartcafe - I can confirm updating to 5.3.2 and then enabling polls app resolve my problem.

@dartcafe
Copy link
Collaborator

Good news. And thank you for that very detailed report. That helped a lot! I wish everybody reports that good.

@bastianlstrube
Copy link

Hi p-sims and dartcafe.
I have a NC web interface stuck on this failing update:
Screenshot 01
Screenshot 02

I've looked through this thread and can't seem to figure what the solution is.
Never updated apps through command line. Is that what is needed?

@farao
Copy link

farao commented Sep 18, 2023

@bastianlstrube (here again for others having this problem) yes, if you have console access to the server that the nextcloud is installed on you can use the occ script in the nextcloud folder to update only the polls app (which is blocking the update) and afterwards continue with the update. On my server this was (run in the nextcloud folder):

sudo -u www-data ./occ app:update polls
sudo -u www-data php updater/updater.phar

@Martin-bl
Copy link

Martin-bl commented Feb 12, 2024

I got the exact same issue Database error when running migration 050100Date20230515083001 for app polls Column "oc_polls_options"."owner" is NotNull, but has empty string or null as default.
But in another situation :

  • Polls was not installed
  • I tried to install it and it failed with this error above
  • If I do php occ app:list |grep polls I got : - polls: 5.4.3 (installed 1.4.3)
  • I understand that Polls was installed long time ago and removed. I cannot manage to resolve it with sudo -u www-data ./occ app:update polls as mentioned
  • I removed the app : ./occ app:remove polls
  • I dropped tables from polls' app :
DROP TABLE "oc_polls_log";
DROP TABLE "oc_polls_notif";
DROP TABLE "oc_polls_options";
DROP TABLE "oc_polls_polls";
DROP TABLE "oc_polls_share";
DROP TABLE "oc_polls_votes";
  • I install the app again :
./occ app:install polls
polls 5.4.3 installed
polls enabled

it works

Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants