Polls upgrade error

  • Nextcloud Server version:
    • 30.0.13
  • Operating system and version:
    • Ubuntu 20.04
  • Web server and version:
    • Apache 2.4.41
  • Reverse proxy and version:
    • none
  • PHP version:
    • 8.2
  • Is this the first time you’ve seen this error?:
    • yes
  • When did this problem seem to first start?
    • 2025-08-22
  • Installation method
    • AIO
  • Are you using CloudfIare, mod_security, or similar?
    • no

Summary of the issue you are facing:

When I upgraded Polls to 8.3.2 Nextcloud stopped working with this error message on every page:

Exception: Database error when running migration 080301Date20250822182903 for app polls An exception occurred while executing a query: SQLSTATE[01000]: Warning: 1265 Data truncated for column ‘group_id’ at row 1

I disabled polls from command line and the error message disappeared.

Steps to replicate it:

upgrade polls

Log entries

Nextcloud

{"reqId":"sDHzekL3lpMQ6J2OKGvZ","level":3,"time":"2025-08-22T18:31:09+00:00","remoteAddr":"111.222.33.44","user":"--","app":"no app in context","method":"GET","url":"/core/ajax/update.php?requesttoken=y7gdAXdKG7bpdLEHmzXT55aqBhAScMv%2BPn9hobDWSHg%3D%3AgMhQYhsDfvC%2FP9I0rl6DsNTmfl9GEuDPRD5Y%2BNPuBDo%3D","message":"Database error when running migration 080301Date20250822182903 for app polls\nAn exception occurred while executing a query: SQLSTATE[01000]: Warning: 1265 Data truncated for column 'group_id' at row 1","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36","version":"30.0.13.1","exception":{"Exception":"Exception","Message":"Database error when running migration 080301Date20250822182903 for app polls\nAn exception occurred while executing a query: SQLSTATE[01000]: Warning: 1265 Data truncated for column 'group_id' at row 1","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/legacy/OC_App.php","line":736,"function":"migrate","class":"OC\\DB\\MigrationService","type":"->"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":323,"function":"updateApp","class":"OC_App","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":234,"function":"doAppUpgrade","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":98,"function":"doUpgrade","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/core/ajax/update.php","line":168,"function":"upgrade","class":"OC\\Updater","type":"->"}],"File":"/var/www/nextcloud/lib/private/DB/MigrationService.php","Line":400,"Previous":{"Exception":"Doctrine\\DBAL\\Exception\\DriverException","Message":"An exception occurred while executing a query: SQLSTATE[01000]: Warning: 1265 Data truncated for column 'group_id' at row 1","Code":1265,"Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1976,"function":"convert","class":"Doctrine\\DBAL\\Driver\\API\\MySQL\\ExceptionConverter","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1918,"function":"handleDriverException","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1218,"function":"convertExceptionDuringQuery","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php","line":292,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":462,"function":"executeStatement","class":"Doctrine\\DBAL\\Connections\\PrimaryReadReplicaConnection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Migrator.php","line":142,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Migrator.php","line":47,"function":"applySchema","class":"OC\\DB\\Migrator","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":791,"function":"migrate","class":"OC\\DB\\Migrator","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/MigrationService.php","line":516,"function":"migrateToSchema","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/MigrationService.php","line":396,"function":"executeStep","class":"OC\\DB\\MigrationService","type":"->"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_App.php","line":736,"function":"migrate","class":"OC\\DB\\MigrationService","type":"->"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":323,"function":"updateApp","class":"OC_App","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":234,"function":"doAppUpgrade","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":98,"function":"doUpgrade","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/core/ajax/update.php","line":168,"function":"upgrade","class":"OC\\Updater","type":"->"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/API/MySQL/ExceptionConverter.php","Line":118,"Previous":{"Exception":"Doctrine\\DBAL\\Driver\\PDO\\Exception","Message":"SQLSTATE[01000]: Warning: 1265 Data truncated for column 'group_id' at row 1","Code":1265,"Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Connection.php","line":39,"function":"new","class":"Doctrine\\DBAL\\Driver\\PDO\\Exception","type":"::"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1216,"function":"exec","class":"Doctrine\\DBAL\\Driver\\PDO\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php","line":292,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":462,"function":"executeStatement","class":"Doctrine\\DBAL\\Connections\\PrimaryReadReplicaConnection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Migrator.php","line":142,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Migrator.php","line":47,"function":"applySchema","class":"OC\\DB\\Migrator","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":791,"function":"migrate","class":"OC\\DB\\Migrator","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/MigrationService.php","line":516,"function":"migrateToSchema","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/MigrationService.php","line":396,"function":"executeStep","class":"OC\\DB\\MigrationService","type":"->"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_App.php","line":736,"function":"migrate","class":"OC\\DB\\MigrationService","type":"->"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":323,"function":"updateApp","class":"OC_App","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":234,"function":"doAppUpgrade","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":98,"function":"doUpgrade","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/core/ajax/update.php","line":168,"function":"upgrade","class":"OC\\Updater","type":"->"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Exception.php","Line":24,"Previous":{"Exception":"PDOException","Message":"SQLSTATE[01000]: Warning: 1265 Data truncated for column 'group_id' at row 1","Code":"01000","Trace":[{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Connection.php","line":33,"function":"exec","class":"PDO","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connection.php","line":1216,"function":"exec","class":"Doctrine\\DBAL\\Driver\\PDO\\Connection","type":"->"},{"file":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php","line":292,"function":"executeStatement","class":"Doctrine\\DBAL\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":462,"function":"executeStatement","class":"Doctrine\\DBAL\\Connections\\PrimaryReadReplicaConnection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Migrator.php","line":142,"function":"executeStatement","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Migrator.php","line":47,"function":"applySchema","class":"OC\\DB\\Migrator","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/Connection.php","line":791,"function":"migrate","class":"OC\\DB\\Migrator","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/MigrationService.php","line":516,"function":"migrateToSchema","class":"OC\\DB\\Connection","type":"->"},{"file":"/var/www/nextcloud/lib/private/DB/MigrationService.php","line":396,"function":"executeStep","class":"OC\\DB\\MigrationService","type":"->"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_App.php","line":736,"function":"migrate","class":"OC\\DB\\MigrationService","type":"->"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":323,"function":"updateApp","class":"OC_App","type":"::","args":["*** sensitive parameters replaced ***"]},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":234,"function":"doAppUpgrade","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/lib/private/Updater.php","line":98,"function":"doUpgrade","class":"OC\\Updater","type":"->"},{"file":"/var/www/nextcloud/core/ajax/update.php","line":168,"function":"upgrade","class":"OC\\Updater","type":"->"}],"File":"/var/www/nextcloud/3rdparty/doctrine/dbal/src/Driver/PDO/Connection.php","Line":33}}},"message":"Database error when running migration 080301Date20250822182903 for app polls\nAn exception occurred while executing a query: SQLSTATE[01000]: Warning: 1265 Data truncated for column 'group_id' at row 1","exception":{},"CustomMessage":"Database error when running migration 080301Date20250822182903 for app polls\nAn exception occurred while executing a query: SQLSTATE[01000]: Warning: 1265 Data truncated for column 'group_id' at row 1"}}
{"reqId":"sDHzekL3lpMQ6J2OKGvZ","level":3,"time":"2025-08-22T18:31:09+00:00","remoteAddr":"11.22.33.44","user":"--","app":"updater","method":"GET","url":"/core/ajax/update.php?requesttoken=y7gdAXdKG7bpdLEHmzXT55aqBhAScMv%2BPn9hobDWSHg%3D%3AgMhQYhsDfvC%2FP9I0rl6DsNTmfl9GEuDPRD5Y%2BNPuBDo%3D","message":"\\OC\\Updater::failure: Exception: Database error when running migration 080301Date20250822182903 for app polls\nAn exception occurred while executing a query: SQLSTATE[01000]: Warning: 1265 Data truncated for column 'group_id' at row 1","userAgent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/139.0.0.0 Safari/537.36","version":"30.0.13.1","data":{"app":"updater"}}

Configuration

Nextcloud


{
    "system": {
        "debug": false,
        "simpleSignUpLink.shown": false,
        "app.mail.verify-tls-peer": true,
        "app.mail.imap.timeout": 60,
        "app.mail.smtp.timeout": 8,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "cloud.blabla.net",
            "collabora.blabla.net",
            "more.blabla.net",
            "program.blabla.net"
        ],
        "richdocuments.collabora_url": "https:\/\/127.0.0.1",
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "default_phone_region": "CH",
        "default_language": "de",
        "default_locale": "de_CH",
        "trashbin_retention_obligation": "90, auto",
        "dbtype": "mysql",
        "version": "30.0.13.1",
        "overwrite.cli.url": "https:\/\/cloud.blabla.net",
        "overwriteprotocol": "https",
        "overwritehost": "cloud.blabla.net",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "maintenance": false,
        "maintenance_window_start": 1,
        "theme": "",
        "loglevel": 2,
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "sharing.interal_shares_accepted": true,
        "integrity.check.disabled": false,
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 6379,
            "timeout": 3,
            "dbindex": 1
        },
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "app_install_overwrite": [
            "ojsxc",
            "files_ebookreader",
            "epubreader"
        ],
        "updater.release.channel": "stable",
        "htaccess.RewriteBase": "\/",
        "mail_smtpsecure": "tls",
        "enforce_theme": "",
        "richdocuments.collabora_wss_url": "wss:\/\/127.0.0.1:9980"
    }
}

Apps

Enabled:

  • activity: 3.0.0
  • admin_audit: 1.20.0
  • app_api: 4.0.6
  • approval: 2.4.0
  • bruteforcesettings: 3.0.0
  • calendar: 5.3.9
  • cloud_federation_api: 1.13.0
  • comments: 1.20.1
  • dashboard: 7.10.0
  • dav: 1.31.1
  • deck: 1.14.6
  • federatedfilesharing: 1.20.0
  • federation: 1.20.0
  • files: 2.2.0
  • files_accesscontrol: 1.20.1
  • files_antivirus: 5.6.5
  • files_downloadlimit: 3.0.0
  • files_fulltextsearch: 31.0.0
  • files_pdfviewer: 3.0.0
  • files_reminders: 1.3.0
  • files_sharing: 1.22.0
  • files_trashbin: 1.20.1
  • files_versions: 1.23.0
  • files_zip: 2.1.0
  • forms: 5.1.2
  • fulltextsearch: 30.0.1
  • fulltextsearch_elasticsearch: 30.0.1
  • impersonate: 1.17.1
  • login_notes: 1.6.1
  • lookup_server_connector: 1.18.0
  • notifications: 3.0.0
  • oauth2: 1.18.1
  • password_policy: 2.0.0
  • provisioning_api: 1.20.0
  • quicknotes: 0.8.30
  • quota_warning: 1.21.0
  • recommendations: 3.0.0
  • related_resources: 1.5.0
  • richdocuments: 8.5.10
  • richdocumentscode: 25.4.403
  • settings: 1.13.0
  • text: 4.1.0
  • theming: 2.6.0
  • twofactor_backupcodes: 1.19.0
  • updatenotification: 1.20.0
  • user_status: 1.10.0
  • viewer: 3.0.0
  • weather_status: 1.10.0
  • webhook_listeners: 1.1.0-dev
  • welcome: 1.3.0
  • workflowengine: 2.12.0

Disabled:

  • apporder: 0.15.0 (installed 0.15.0)
  • breezedark: 29.0.0 (installed 29.0.0)
  • circles: 30.0.0 (installed 23.1.2)
  • contactsinteraction: 1.11.0 (installed 1.0.0)
  • documentserver_community: 0.2.0 (installed 0.2.0)
  • encryption: 2.18.0
  • epubreader: 1.4.7 (installed 1.4.7)
  • epubviewer: 1.8.0 (installed 1.8.0)
  • files_external: 1.22.0 (installed 1.10.0)
  • files_rightclick: 0.15.1 (installed 1.6.0)
  • firstrunwizard: 3.0.0 (installed 2.8.0)
  • logreader: 3.0.0 (installed 2.9.0)
  • nextcloud_announcements: 2.0.0 (installed 1.8.0)
  • photos: 3.0.2 (installed 1.1.0)
  • polls: 8.3.2 (installed 8.2.2)
  • privacy: 2.0.0 (installed 1.3.0)
  • serverinfo: 2.0.0 (installed 1.13.0)
  • sharebymail: 1.20.0 (installed 1.9.0)
  • support: 2.0.0 (installed 1.2.1)
  • survey_client: 2.0.0 (installed 1.7.0)
  • suspicious_login: 8.0.0
  • systemtags: 1.20.0 (installed 1.14.0)
  • tasks: 0.16.1 (installed 0.16.1)
  • twofactor_nextcloud_notification: 4.0.0
  • twofactor_totp: 12.0.0-dev
  • user_ldap: 1.21.0
1 Like

Cross-post: The problem was reported as GitHub issue nextcloud/polls#4227 already.

2 Likes

This error is under investigation and will be fixed Sunday or Monday.

2 Likes

I think this is solved with v8.3.3. If yes, please accept this as solution.

2 Likes

Rene, thank you very much for your efforts and the quick improved version! :grinning_face:

Unfortunately this did not solve it on my end:

occ app:update polls
polls new version available: 8.3.6
Error: Database error when running migration 080303Date20250824090101 for app polls
An exception occurred while executing a query: SQLSTATE[42P01]: Undefined table: 7 ERROR:  relation "oc_polls_groups_polls" does not exist
LINE 1: DELETE FROM "oc_polls_groups_polls" WHERE ("poll_id" NOT IN ...
                    ^
polls couldn't be updated

Update tried from polls 7.4.3 on NC 30.0.11
Thanks so much in advance, Rene! And thanks for all your great work!!

upgrade error: disable the app, update Nextcloud, re-enable Polls, and run the database migrations. If it still fails, purge and reinstall the app. Make sure to back up your data first

I have the exact same issue with PostgreSQL as DBMS on NC 30.0.6, maybe I should upgrade the instance to 30.0.14 first? In any case, I tried the steps suggested by @Joe_Hartzel, but I still got the same migration error when trying to reinstall Polls via occ, although I kept the data when I first removed the app.
Many thanks of course for working on this issue.

1 Like

If I’m not mistaken, purging all the data will lead to the data being purged. If I’m reimporting the data afterwards, wouldn’t it still be in the tables that should have been migrated during the migration, thus laying the base for possible malfunctions in the future?

There was another bug if updating from 7.x to 8.x. This was fixed by version 8.3.8. Sorry for these situation.

1 Like

occ polls:db:purge wipes polls completely from the database by executing the steps announced by the command after calling it.

Usually the app will be disabled then.

After calling occ app:enable polls the database gets recreated. If you import an old backup call occ polls:db:recreate immediately after the backup. This command sets the tables and it’s records into a valid state.

1 Like

Addendum: You do not need to purge Polls. If the app is enabled, just call occ polls:db:rebuild.

In any case, I suggest to install v8.3.8 first.

For more fun with the 8.3.x migration follow the thread on github

And of course, apologize for this situation. :folded_hands:

2 Likes

@dartcafe Is there a known problem about the indices that should be added by occ db:add-missing-indices? Every time I run the command I get the following message:

I already tried to run the rebuild command, but still get the same message. I’m already on latest 8.3.8

Thanks so much for all your work! :heart::heart: I’ll try tonight and give feedback!

1 Like

That’s new to me.

first run

  • occ polls:index:remove:optional (or call occ polls:db:rebuild) and then
  • occ db:add-missing-indices.

If the error appears again, please let me know.

As you can see in the first lines of my screenshot, that’s what I did before… Should I open an issue on Github?

Have you tried occ polls:index:remove:optional?

And yes. Github is better than here.

Same error, will create a new issue later :slight_smile:

1 Like

Thank you very much @dartcafe, upgrading from 7.x to 8.3.6 first, then to 8.3.8, worked very well, no issues encountered. Thanks again

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.