Skip to content

promoteToOwner fails with SQL error #2905

Closed

Description

@jack-w-shaw

How to use GitHub

  • Please use the 👍 reaction to show that you are affected by the same issue.
  • Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
  • Subscribe to receive notifications on status change and new comments.

Promoting a user to sole owner of a group results in the following error:

 An exception occurred while executing a query: SQLSTATE[0A000]: Feature not supported: 7 ERROR:  FOR UPDATE cannot be applied to the nullable side of an outer join

It seems #2711 introduced this regression

Steps to reproduce

  1. Create a team
  2. Add some users
  3. Press "Promote as sole owner"

Expected behaviour

No error occurs, the user is promoted

Actual behaviour

"Could not change the member level to Owner" error toast

Server response:

{
    "ocs": {
        "meta": {
            "status": "failure",
            "statuscode": 7,
            "message": "An exception occurred while executing a query: SQLSTATE[0A000]: Feature not supported: 7 ERROR:  FOR UPDATE cannot be applied to the nullable side of an outer join"
        },
        "data": []
    }
}

Server configuration

Web server: Apache

Database: PostgreSQL

PHP version: 8.3

Nextcloud version: 26

List of activated apps
Enabled:
  - admin_audit: 1.24.0
  - appstore: 1.0.0
  - bruteforcesettings: 7.0.0
  - calendar: 6.5.4
  - circles: 34.0.0
  - cloud_federation_api: 1.18.0
  - collectives: 4.6.1
  - comments: 1.24.0
  - contacts: 8.8.1
  - contactsinteraction: 1.15.0
  - dashboard: 7.14.0
  - dav: 1.40.0
  - deck: 1.18.4
  - federatedfilesharing: 1.24.0
  - federation: 1.24.0
  - files: 2.6.0
  - files_downloadlimit: 5.2.0
  - files_external: 1.26.0
  - files_lock: 34.0.1
  - files_pdfviewer: 7.0.0-dev.0
  - files_reminders: 1.7.0
  - files_sharing: 1.26.0
  - files_trashbin: 1.24.0
  - files_versions: 1.27.0
  - group_everyone: 0.1.21
  - groupfolders: 22.0.6
  - logreader: 7.0.0
  - lookup_server_connector: 1.22.0
  - mail: 5.11.5
  - nextcloud_announcements: 6.0.0
  - notes: 6.0.2
  - notifications: 7.0.0-dev.1
  - notify_push: 1.4.0
  - oauth2: 1.22.0
  - office: 1.0.0
  - password_policy: 6.0.0-dev.0
  - privacy: 6.0.0-dev.1
  - profile: 1.3.0
  - provisioning_api: 1.24.0
  - related_resources: 5.0.0-dev.0
  - roomvox: 1.5.0
  - serverinfo: 6.0.0
  - settings: 1.17.0
  - sharebymail: 1.24.0
  - spreed: 24.0.5
  - support: 6.0.0
  - systemtags: 1.24.0
  - tasks: 0.18.1
  - text: 8.0.0
  - theming: 2.9.0
  - twofactor_backupcodes: 1.23.0
  - twofactor_totp: 16.0.0
  - updatenotification: 1.24.0
  - user_ldap: 1.25.0
  - user_status: 1.14.0
  - viewer: 7.0.0-dev.0
  - weather_status: 1.14.0
  - webhook_listeners: 1.6.0
  - workflowengine: 2.16.0
Nextcloud configuration
{
    "system": {
        "one-click-instance": true,
        "one-click-instance.user-limit": 100,
        "update_channel": "stable",
        "memcache.local": "\\OC\\Memcache\\APCu",
        "apps_paths": [
            {
                "path": "\/var\/www\/html\/apps",
                "url": "\/apps",
                "writable": false
            },
            {
                "path": "\/var\/www\/html\/custom_apps",
                "url": "\/custom_apps",
                "writable": true
            }
        ],
        "check_data_directory_permissions": false,
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "timeout": 3,
            "read_timeout": 10,
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "overwritehost": "cloud.tgep.uk",
        "overwriteprotocol": "https",
        "serverid": 408,
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "cloud.tgep.uk"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "34.0.3.2",
        "overwrite.cli.url": "https:\/\/cloud.tgep.uk\/",
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbtableprefix": "oc_",
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "maintenance": false,
        "updatechecker": true,
        "updatedirectory": "\/nc-updater",
        "loglevel": 2,
        "app_install_overwrite": [
            "nextcloud-aio"
        ],
        "log_type": "file",
        "log_type_audit": "file",
        "logfile": "\/var\/www\/html\/data\/nextcloud.log",
        "logfile_audit": "\/var\/www\/html\/data\/audit.log",
        "log_rotate_size": 10485760,
        "log.condition": {
            "apps": [
                "admin_audit"
            ]
        },
        "preview_max_x": 2048,
        "preview_max_y": 2048,
        "jpeg_quality": 60,
        "enabledPreviewProviders": {
            "1": "OC\\Preview\\Image",
            "2": "OC\\Preview\\MarkDown",
            "3": "OC\\Preview\\MP3",
            "4": "OC\\Preview\\TXT",
            "5": "OC\\Preview\\OpenDocument",
            "6": "OC\\Preview\\Movie",
            "7": "OC\\Preview\\Krita"
        },
        "enable_previews": true,
        "upgrade.disable-web": true,
        "mail_smtpmode": "smtp",
        "trashbin_retention_obligation": "auto, 30",
        "versions_retention_obligation": "auto, 30",
        "activity_expire_days": 30,
        "simpleSignUpLink.shown": false,
        "share_folder": "\/Shared",
        "one-click-instance.link": "https:\/\/nextcloud.com\/all-in-one\/",
        "upgrade.cli-upgrade-link": "https:\/\/github.com\/nextcloud\/all-in-one\/discussions\/2726",
        "maintenance_window_start": 100,
        "allow_local_remote_servers": true,
        "davstorage.request_timeout": 3600,
        "documentation_url.server_logs": "https:\/\/github.com\/nextcloud\/all-in-one\/discussions\/5425",
        "htaccess.RewriteBase": "\/",
        "dbpersistent": false,
        "auth.bruteforce.protection.enabled": true,
        "ratelimit.protection.enabled": true,
        "files_external_allow_create_new_local": true,
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory",
        "auth.storeCryptedPassword": true,
        "defaultapp": "dashboard",
    }
}

Activity

  1. jack-w-shaw commented on Sep 14, 2026

    @jack-w-shaw
    Author

    Applying the diff

    public function promoteToOwner(Member $member): ?Member {
        try {
            $this->db->beginTransaction();
    
    -       $qb = $this->getMemberSelectSql();
    +       $qb = $this->getMemberSelectSql(null, false);
            $qb->limitToCircleId($member->getCircleId());
            $qb->limitInt('level', Member::LEVEL_OWNER);
    
            $qb->forUpdate();
    

    is a work around

  2. cristianscheid commented on Sep 17, 2026

    @cristianscheid
    Member

    @jack-w-shaw thank you very much for reporting this and for proposing a solution, tested here and works like a charm! I've opened a PR to fix this:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions