Skip to content

Polls can't be accessed by the creator of poll #4206

Description

@Youcef-Volya

⚠️ 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?

I create 1 poll and there is 2 polls in the list. The two polls are identical and had the same problems. They have also the same id.
In this case : https:///index.php/apps/polls/vote/295

When I access to the poll with the creator account, I have this :

Image

The poll can be accessed with the public link to vote with no issue.

I try : sudo /snap/bin/nextcloud.occ polls:db:rebuild without success.

After migration I had this issue with archived polls, so I don't pay attention about it.

Error in logs when I click on "Polls" icon :
MultipleObjectsReturnedException

Did not expect more than one result when executing: query "SELECT polls_polls.*, (SELECT MAX(options.timestamp) FROM *PREFIX*polls_options options WHERE (options.poll_id = polls_polls.id) AND (options.deleted = '0')) AS max_date, coalesce(user_shares.type, '') AS user_role, user_shares.locked AS is_current_user_locked, coalesce(user_shares.token, '') AS share_token, group_concat(distinct group_shares.user_id SEPARATOR ",") AS group_shares, group_concat(distinct poll_groups.group_id SEPARATOR ",") AS poll_groups, group_concat(distinct poll_group_shares.type SEPARATOR ",") AS poll_group_user_shares FROM *PREFIX*polls_polls polls_polls LEFT JOIN *PREFIX*polls_share user_shares ON (user_shares.poll_id = polls_polls.id) AND (user_shares.user_id = :dcValue2) AND (user_shares.deleted = '0') LEFT JOIN *PREFIX*polls_share group_shares ON (group_shares.poll_id = polls_polls.id) AND (group_shares.type = 'group') AND (group_shares.deleted = '0') LEFT JOIN *PREFIX*polls_groups_polls poll_groups ON polls_polls.id = poll_groups.poll_id LEFT JOIN *PREFIX*polls_share poll_group_shares ON (poll_group_shares.group_id = poll_groups.group_id) AND (poll_group_shares.deleted = '0') AND (poll_group_shares.user_id = :dcValue2) WHERE polls_polls.id = :dcValue1 GROUP BY polls_polls.id, user_shares.type, user_shares.locked, user_shares.token"

What did you expect, how polls should behave instead?

I expect 1 poll created and I expect to go on poll with the creator account and that I can modify description and that I can follow votes.

What steps does it need to replay this bug?

  1. Migration frpm Polls 7.4.X to Polls 8.1.2
  2. Migration from Nextcloud 30 to Nextcloud 31
  3. Maybe issue came after first vote.

Affected polls version

8.1.4 and 8.2.2

Installation method

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

Installation type

Updated from previous major version (i.e. 7.x.x to 8.x.x)

Can you rule out that any extension you use is involved in the issue?

  • I have checked all browser extension

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

Notifications permissions denied NotificationsApp-B6NN3irW.chunk.mjs:38:61650
Polling interval updated to 30000 NotificationsApp-B6NN3irW.chunk.mjs:38:60945
Started background fetcher as session_keepalive is enabled NotificationsApp-B6NN3irW.chunk.mjs:38:58149
Got notification data, restoring default polling interval. NotificationsApp-B6NN3irW.chunk.mjs:38:59900
XHRGET
https://<server>/index.php/apps/polls/poll/295/poll?time=1754480885089
[HTTP/1.1 500 Internal Server Error 231ms]

	
GET
	https://<server>/index.php/apps/polls/poll/295/poll?time=1754480885089
État
500
Internal Server Error
VersionHTTP/1.1
Transfert3,94 Ko (taille 3,12 Ko)
Politique de référentno-referrer
Résolution DNSSystème

XHRGET
https://<server>/index.php/apps/polls/poll/295/votes?time=1754480885089
[HTTP/1.1 500 Internal Server Error 234ms]

	
GET
	https://<server>/index.php/apps/polls/poll/295/votes?time=1754480885089
État
500
Internal Server Error
VersionHTTP/1.1
Transfert3,94 Ko (taille 3,12 Ko)
Politique de référentno-referrer
Résolution DNSSystème

XHRGET
https://<server>/index.php/apps/polls/poll/295/options?time=1754480885089
[HTTP/1.1 500 Internal Server Error 263ms]

	
GET
	https://<server>/index.php/apps/polls/poll/295/options?time=1754480885089
État
500
Internal Server Error
VersionHTTP/1.1
Transfert3,94 Ko (taille 3,12 Ko)
Politique de référentno-referrer
Résolution DNSSystème

XHRGET
https://<server>/index.php/apps/polls/poll/295/subscription
[HTTP/1.1 500 Internal Server Error 263ms]

	
GET
	https://<server>/index.php/apps/polls/poll/295/subscription
État
500
Internal Server Error
VersionHTTP/1.1
Transfert3,94 Ko (taille 3,12 Ko)
Politique de référentno-referrer
Résolution DNSSystème

[ERROR] polls: Error loading poll 
Object { app: "polls", uid: "admin-logistique", level: 2, error: {…} }
_plugin-vue_export-helper-fbNU8KyH.chunk.mjs:5:434
    log AxiosHeaders.js:23
    error AxiosHeaders.js:56
    load session-rbrGHbUP.chunk.mjs:1034
    I index.mjs:32
    Z Vote-gnvkyw55.chunk.mjs:3
    setup Vote-gnvkyw55.chunk.mjs:3
    qn index.mjs:32
    Pi index.mjs:32
    un index.mjs:32
    __weh index.mjs:32
    Hp index.mjs:32
    Wp index.mjs:32
Uncaught (in promise) 
Object { message: "Request failed with status code 500", name: "AxiosError", code: "ERR_BAD_RESPONSE", config: {…}, request: XMLHttpRequest, response: {…}, status: 500, stack: "", … }
2
[ERROR] polls: Error loding options 
Object { app: "polls", uid: "admin-logistique", level: 2, error: {…}, pollId: "295" }
_plugin-vue_export-helper-fbNU8KyH.chunk.mjs:5:434
    log AxiosHeaders.js:23
    error AxiosHeaders.js:56
    load NcContent-BmXFlXrh.mjs:10
    I index.mjs:32
    Z Vote-gnvkyw55.chunk.mjs:3
    setup Vote-gnvkyw55.chunk.mjs:3
    qn index.mjs:32
    Pi index.mjs:32
    un index.mjs:32
    __weh index.mjs:32
    Hp index.mjs:32
    Wp index.mjs:32
Uncaught (in promise) 
Object { message: "Request failed with status code 500", name: "AxiosError", code: "ERR_BAD_RESPONSE", config: {…}, request: XMLHttpRequest, response: {…}, status: 500, stack: "", … }
2

Additional client environment information

Nextcloud is installed by snap.

NC version

Nextcloud 31

Other Nextcloud version

31.0.7 - snap-id: njObIbGQEaVx1H4nyWxchk1i8opy4h54

PHP engine version

PHP 8.3

Other PHP version

PHP 8.3.23

Database engine

MySQL

Database Engine version or other Database

MySQL 8.0.42

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

{"reqId":"p6oZGr5YzbhIA1ete9KA","level":3,"time":"2025-08-06T11:48:05+00:00","remoteAddr":"<IP_address>","user":"admin-logistique","app":"index","method":"GET","url":"/index.php/apps/polls/poll/295/subscription","message":"Did not expect more than one result when executing: query \"SELECT `polls_polls`.*, (SELECT MAX(`options`.`timestamp`) FROM `*PREFIX*polls_options` `options` WHERE (`options`.`poll_id` = `polls_polls`.`id`) AND (`options`.`deleted` = '0')) AS `max_date`, coalesce(user_shares.type, '') AS user_role, `user_shares`.`locked` AS `is_current_user_locked`, coalesce(user_shares.token, '') AS share_token, group_concat(distinct group_shares.user_id SEPARATOR \",\") AS group_shares, group_concat(distinct poll_groups.group_id SEPARATOR \",\") AS poll_groups, group_concat(distinct poll_group_shares.type SEPARATOR \",\") AS poll_group_user_shares FROM `*PREFIX*polls_polls` `polls_polls` LEFT JOIN `*PREFIX*polls_share` `user_shares` ON (`user_shares`.`poll_id` = `polls_polls`.`id`) AND (`user_shares`.`user_id` = :dcValue2) AND (`user_shares`.`deleted` = '0') LEFT JOIN `*PREFIX*polls_share` `group_shares` ON (`group_shares`.`poll_id` = `polls_polls`.`id`) AND (`group_shares`.`type` = 'group') AND (`group_shares`.`deleted` = '0') LEFT JOIN `*PREFIX*polls_groups_polls` `poll_groups` ON `polls_polls`.`id` = `poll_groups`.`poll_id` LEFT JOIN `*PREFIX*polls_share` `poll_group_shares` ON (`poll_group_shares`.`group_id` = `poll_groups`.`group_id`) AND (`poll_group_shares`.`deleted` = '0') AND (`poll_group_shares`.`user_id` = :dcValue2) WHERE `polls_polls`.`id` = :dcValue1 GROUP BY `polls_polls`.`id`, `user_shares`.`type`, `user_shares`.`locked`, `user_shares`.`token`\"; ","userAgent":"Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:141.0) Gecko/20100101 Firefox/141.0","version":"31.0.7.1","exception":{"Exception":"OCP\\AppFramework\\Db\\MultipleObjectsReturnedException","Message":"Did not expect more than one result when executing: query \"SELECT `polls_polls`.*, (SELECT MAX(`options`.`timestamp`) FROM `*PREFIX*polls_options` `options` WHERE (`options`.`poll_id` = `polls_polls`.`id`) AND (`options`.`deleted` = '0')) AS `max_date`, coalesce(user_shares.type, '') AS user_role, `user_shares`.`locked` AS `is_current_user_locked`, coalesce(user_shares.token, '') AS share_token, group_concat(distinct group_shares.user_id SEPARATOR \",\") AS group_shares, group_concat(distinct poll_groups.group_id SEPARATOR \",\") AS poll_groups, group_concat(distinct poll_group_shares.type SEPARATOR \",\") AS poll_group_user_shares FROM `*PREFIX*polls_polls` `polls_polls` LEFT JOIN `*PREFIX*polls_share` `user_shares` ON (`user_shares`.`poll_id` = `polls_polls`.`id`) AND (`user_shares`.`user_id` = :dcValue2) AND (`user_shares`.`deleted` = '0') LEFT JOIN `*PREFIX*polls_share` `group_shares` ON (`group_shares`.`poll_id` = `polls_polls`.`id`) AND (`group_shares`.`type` = 'group') AND (`group_shares`.`deleted` = '0') LEFT JOIN `*PREFIX*polls_groups_polls` `poll_groups` ON `polls_polls`.`id` = `poll_groups`.`poll_id` LEFT JOIN `*PREFIX*polls_share` `poll_group_shares` ON (`poll_group_shares`.`group_id` = `poll_groups`.`group_id`) AND (`poll_group_shares`.`deleted` = '0') AND (`poll_group_shares`.`user_id` = :dcValue2) WHERE `polls_polls`.`id` = :dcValue1 GROUP BY `polls_polls`.`id`, `user_shares`.`type`, `user_shares`.`locked`, `user_shares`.`token`\"; ","Code":0,"Trace":[{"file":"/snap/nextcloud/49334/htdocs/lib/public/AppFramework/Db/QBMapper.php","line":375,"function":"findOneQuery","class":"OCP\\AppFramework\\Db\\QBMapper","type":"->"},{"file":"/var/snap/nextcloud/49334/nextcloud/extra-apps/polls/lib/Db/PollMapper.php","line":62,"function":"findEntity","class":"OCP\\AppFramework\\Db\\QBMapper","type":"->"},{"file":"/var/snap/nextcloud/49334/nextcloud/extra-apps/polls/lib/Service/SubscriptionService.php","line":30,"function":"get","class":"OCA\\Polls\\Db\\PollMapper","type":"->"},{"file":"/var/snap/nextcloud/49334/nextcloud/extra-apps/polls/lib/Controller/SubscriptionController.php","line":39,"function":"get","class":"OCA\\Polls\\Service\\SubscriptionService","type":"->"},{"file":"/var/snap/nextcloud/49334/nextcloud/extra-apps/polls/lib/Controller/BaseController.php","line":42,"function":"OCA\\Polls\\Controller\\{closure}","class":"OCA\\Polls\\Controller\\SubscriptionController","type":"->","args":["*** sensitive parameters replaced ***"]},{"file":"/var/snap/nextcloud/49334/nextcloud/extra-apps/polls/lib/Controller/SubscriptionController.php","line":38,"function":"response","class":"OCA\\Polls\\Controller\\BaseController","type":"->"},{"file":"/snap/nextcloud/49334/htdocs/lib/private/AppFramework/Http/Dispatcher.php","line":200,"function":"get","class":"OCA\\Polls\\Controller\\SubscriptionController","type":"->"},{"file":"/snap/nextcloud/49334/htdocs/lib/private/AppFramework/Http/Dispatcher.php","line":114,"function":"executeController","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/snap/nextcloud/49334/htdocs/lib/private/AppFramework/App.php","line":161,"function":"dispatch","class":"OC\\AppFramework\\Http\\Dispatcher","type":"->"},{"file":"/snap/nextcloud/49334/htdocs/lib/private/Route/Router.php","line":315,"function":"main","class":"OC\\AppFramework\\App","type":"::"},{"file":"/snap/nextcloud/49334/htdocs/lib/base.php","line":1040,"function":"match","class":"OC\\Route\\Router","type":"->"},{"file":"/snap/nextcloud/49334/htdocs/index.php","line":24,"function":"handleRequest","class":"OC","type":"::"}],"File":"/snap/nextcloud/49334/htdocs/lib/public/AppFramework/Db/QBMapper.php","Line":286,"message":"Did not expect more than one result when executing: query \"SELECT `polls_polls`.*, (SELECT MAX(`options`.`timestamp`) FROM `*PREFIX*polls_options` `options` WHERE (`options`.`poll_id` = `polls_polls`.`id`) AND (`options`.`deleted` = '0')) AS `max_date`, coalesce(user_shares.type, '') AS user_role, `user_shares`.`locked` AS `is_current_user_locked`, coalesce(user_shares.token, '') AS share_token, group_concat(distinct group_shares.user_id SEPARATOR \",\") AS group_shares, group_concat(distinct poll_groups.group_id SEPARATOR \",\") AS poll_groups, group_concat(distinct poll_group_shares.type SEPARATOR \",\") AS poll_group_user_shares FROM `*PREFIX*polls_polls` `polls_polls` LEFT JOIN `*PREFIX*polls_share` `user_shares` ON (`user_shares`.`poll_id` = `polls_polls`.`id`) AND (`user_shares`.`user_id` = :dcValue2) AND (`user_shares`.`deleted` = '0') LEFT JOIN `*PREFIX*polls_share` `group_shares` ON (`group_shares`.`poll_id` = `polls_polls`.`id`) AND (`group_shares`.`type` = 'group') AND (`group_shares`.`deleted` = '0') LEFT JOIN `*PREFIX*polls_groups_polls` `poll_groups` ON `polls_polls`.`id` = `poll_groups`.`poll_id` LEFT JOIN `*PREFIX*polls_share` `poll_group_shares` ON (`poll_group_shares`.`group_id` = `poll_groups`.`group_id`) AND (`poll_group_shares`.`deleted` = '0') AND (`poll_group_shares`.`user_id` = :dcValue2) WHERE `polls_polls`.`id` = :dcValue1 GROUP BY `polls_polls`.`id`, `user_shares`.`type`, `user_shares`.`locked`, `user_shares`.`token`\"; ","exception":{},"CustomMessage":"Did not expect more than one result when executing: query \"SELECT `polls_polls`.*, (SELECT MAX(`options`.`timestamp`) FROM `*PREFIX*polls_options` `options` WHERE (`options`.`poll_id` = `polls_polls`.`id`) AND (`options`.`deleted` = '0')) AS `max_date`, coalesce(user_shares.type, '') AS user_role, `user_shares`.`locked` AS `is_current_user_locked`, coalesce(user_shares.token, '') AS share_token, group_concat(distinct group_shares.user_id SEPARATOR \",\") AS group_shares, group_concat(distinct poll_groups.group_id SEPARATOR \",\") AS poll_groups, group_concat(distinct poll_group_shares.type SEPARATOR \",\") AS poll_group_user_shares FROM `*PREFIX*polls_polls` `polls_polls` LEFT JOIN `*PREFIX*polls_share` `user_shares` ON (`user_shares`.`poll_id` = `polls_polls`.`id`) AND (`user_shares`.`user_id` = :dcValue2) AND (`user_shares`.`deleted` = '0') LEFT JOIN `*PREFIX*polls_share` `group_shares` ON (`group_shares`.`poll_id` = `polls_polls`.`id`) AND (`group_shares`.`type` = 'group') AND (`group_shares`.`deleted` = '0') LEFT JOIN `*PREFIX*polls_groups_polls` `poll_groups` ON `polls_polls`.`id` = `poll_groups`.`poll_id` LEFT JOIN `*PREFIX*polls_share` `poll_group_shares` ON (`poll_group_shares`.`group_id` = `poll_groups`.`group_id`) AND (`poll_group_shares`.`deleted` = '0') AND (`poll_group_shares`.`user_id` = :dcValue2) WHERE `polls_polls`.`id` = :dcValue1 GROUP BY `polls_polls`.`id`, `user_shares`.`type`, `user_shares`.`locked`, `user_shares`.`token`\"; "}}

Additional environment informations

No response

Configuration report

{
    "system": {
        "apps_paths": [
            {
                "path": "\/snap\/nextcloud\/current\/htdocs\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/snap\/nextcloud\/current\/nextcloud\/extra-apps",
                "url": "\/extra-apps",
                "writable": true
            }
        ],
        "supportedDatabases": [
            "mysql"
        ],
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "memcache.local": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0
        },
        "log_type": "file",
        "logfile": "\/var\/snap\/nextcloud\/current\/logs\/nextcloud.log",
        "logfilemode": 416,
        "maintenance_window_start": 1,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "<server>"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "31.0.7.1",
        "overwrite.cli.url": "https:\/\/<server>",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "defaultapp": "",
        "mail_smtpmode": "smtp",
        "mail_smtpauth": 1,
        "mail_sendmailmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "587",
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "maintenance": false,
        "profile.enabled": false,
        "loglevel": 2
    }
}

List of activated Apps

Enabled:
  - activity: 4.0.0
  - admin_audit: 1.21.0
  - app_api: 5.0.2
  - bruteforcesettings: 4.0.0
  - calendar: 5.3.8
  - circles: 31.0.0
  - cloud_federation_api: 1.14.0
  - comments: 1.21.0
  - contactsinteraction: 1.12.0
  - dashboard: 7.11.0
  - dav: 1.33.0
  - federatedfilesharing: 1.21.0
  - federation: 1.21.0
  - files: 2.3.1
  - files_accesscontrol: 2.0.0
  - files_antivirus: 6.0.3
  - files_automatedtagging: 2.0.0
  - files_downloadlimit: 4.0.0
  - files_pdfviewer: 4.0.0
  - files_reminders: 1.4.0
  - files_sharing: 1.23.1
  - files_trashbin: 1.21.0
  - files_versions: 1.24.0
  - firstrunwizard: 4.0.0
  - forms: 5.1.2
  - logreader: 4.0.0
  - lookup_server_connector: 1.19.0
  - nextcloud_announcements: 3.0.0
  - notifications: 4.0.0
  - oauth2: 1.19.1
  - password_policy: 3.0.0
  - photos: 4.0.0
  - polls: 8.2.2
  - privacy: 3.0.0
  - profile: 1.0.0
  - provisioning_api: 1.21.0
  - recommendations: 4.0.0
  - registration: 2.7.0
  - related_resources: 2.0.0
  - serverinfo: 3.0.0
  - settings: 1.14.0
  - sharebymail: 1.21.0
  - socialsharing_email: 3.3.0
  - socialsharing_twitter: 3.3.0
  - support: 3.0.0
  - survey_client: 3.0.0
  - systemtags: 1.21.1
  - text: 5.0.0
  - theming: 2.6.1
  - twofactor_backupcodes: 1.20.0
  - user_status: 1.11.0
  - viewer: 4.0.0
  - weather_status: 1.11.0
  - webhook_listeners: 1.2.0
  - workflowengine: 2.13.0
Disabled:
  - encryption: 2.19.0
  - files_external: 1.23.0
  - suspicious_login: 9.0.1
  - twofactor_nextcloud_notification: 5.0.0
  - twofactor_totp: 13.0.0-dev.0
  - user_ldap: 1.22.0

Nextcloud Signing status

No errors have been found.

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions