nextcloud / server

☁️ Nextcloud server, a safe home for all your data
https://nextcloud.com
GNU Affero General Public License v3.0
27.18k stars 4.04k forks source link

Encountering numerous DB transaction errors while using NextCloud. #29588

Closed cyberpower678 closed 2 years ago

cyberpower678 commented 2 years ago

How to use GitHub

Steps to reproduce

This is just happening with regular usage of NextCloud. They appear to either be triggered by trying to delete files and folders, or when syncing a large folder on the client. Delete action errors: [webdav] Fatal: An exception occurred while executing a query: SQLSTATE[23505]: Unique violation: 7 ERROR: duplicate key value violates unique constraint "idx_20109_primary" DETAIL: Key (auto_id)=(49) already exists.

The rest of the transaction errors are caused by normal client usage. I have attached the logs. You can't miss them.

DELETE /remote.php/dav/files/maxdoerr/Readme.md from 192.168.1.1 by maxdoerr at 2021-11-07T02:09:37+00:00

Expected behaviour

NextCloud is expected to interact with Postgres within specified limitations.

Actual behaviour

NextCloud is exceeding these limitations and causing transaction failures

Error: More than 1000 expressions in a list are not allowed on Oracle.

Server configuration

Operating system: Docker (Debian)

Web server: Apache

Database: Postgres

PHP version: 8

Nextcloud version: (see Nextcloud admin page) 22.2.0

Updated from an older Nextcloud/ownCloud or fresh install:Updated

Where did you install Nextcloud from: Docker image

Signing status:

Signing status ``` No errors have been found. ```

List of activated apps:

App list ``` Enabled: - accessibility: 1.8.0 - activity: 2.15.0 - admin_audit: 1.12.0 - analytics: 3.6.1 - announcementcenter: 6.0.0 - appointments: 1.10.2 - apporder: 0.13.0 - audioplayer: 3.2.2 - bookmarks: 10.0.2 - breezedark: 22.0.2 - bruteforcesettings: 2.2.0 - calendar: 2.3.4 - camerarawpreviews: 0.7.12 - checksum: 1.1.2 - cloud_federation_api: 1.5.0 - comments: 1.12.0 - contacts: 4.0.6 - contactsinteraction: 1.3.0 - cookbook: 0.9.6 - cospend: 1.4.2 - dashboard: 7.2.0 - dav: 1.19.0 - diffuse: 2.5.3 - event_update_notification: 1.3.0 - extract: 1.3.2 - federatedfilesharing: 1.12.0 - files: 1.17.0 - files_accesscontrol: 1.12.1 - files_downloadactivity: 1.11.1 - files_external: 1.13.0 - files_linkeditor: 1.1.6 - files_markdown: 2.3.4 - files_pdfviewer: 2.3.0 - files_rightclick: 1.1.0 - files_sharing: 1.14.0 - files_trashbin: 1.12.0 - files_versions: 1.15.0 - files_videoplayer: 1.11.0 - firstrunwizard: 2.11.0 - forms: 2.3.0 - geoblocker: 0.5.1 - impersonate: 1.9.0 - logreader: 2.7.0 - lookup_server_connector: 1.10.0 - mail: 1.10.5 - maps: 0.1.9 - metadata: 0.14.0 - music: 1.4.1 - news: 16.2.0 - nextcloud_announcements: 1.11.0 - notes: 4.1.1 - notifications: 2.10.1 - oauth2: 1.10.0 - password_policy: 1.12.0 - passwords: 2021.10.20 - photos: 1.4.0 - polls: 3.3.0 - privacy: 1.6.0 - provisioning_api: 1.12.0 - qownnotesapi: 21.7.0 - quota_warning: 1.11.0 - recommendations: 1.1.0 - serverinfo: 1.12.0 - settings: 1.4.0 - sharebymail: 1.12.0 - sharingpath: 0.4.3 - side_menu: 1.28.0 - spreed: 12.1.2 - survey_client: 1.10.0 - suspicious_login: 4.0.0 - systemtags: 1.12.0 - talk_matterbridge: 1.22.4 - tasks: 0.14.2 - text: 3.3.0 - theming: 1.13.0 - timemanager: 0.2.5 - twofactor_admin: 3.1.0 - twofactor_backupcodes: 1.11.0 - twofactor_gateway: 0.19.0 - twofactor_nextcloud_notification: 3.2.1 - twofactor_totp: 6.1.0 - twofactor_u2f: 6.2.0 - updatenotification: 1.12.0 - user_status: 1.2.0 - viewer: 1.6.0 - weather_status: 1.2.0 - webapppassword: 21.7.0 - workflowengine: 2.4.0 Disabled: - audioplayer_editor - audioplayer_sonos - browser_warning - carnet - circles - customproperties - data_request - deck - documentserver_community - drawio - duplicatefinder - emlviewer - encryption - end_to_end_encryption - external - facerecognition - federation - files_antivirus - files_automatedtagging - files_fulltextsearch - files_fulltextsearch_tesseract - files_lock - files_mindmap - files_photospheres - files_retention - files_trackdownloads - flowupload - fulltextsearch - fulltextsearch_elasticsearch - gpgmailer - gpxedit - gpxmotion - gpxpod - groupfolders - guests - hidesidebars - imageconverter - issuetemplate - limit_login_to_ip - ocsms - onlyoffice - ownpad - phonetrack - printer - quickaccesssorting - quicknotes - rainloop - ransomware_detection - ransomware_protection - richdocuments - richdocumentscode - richdocumentscode_arm64 - sendent - socialsharing_diaspora - socialsharing_email - socialsharing_facebook - socialsharing_twitter - support - talk_simple_poll - terms_of_service - theming_customcss - transmission - twofactor_webauthn - unsplash - user_ldap - user_saml - user_usage_report - w2g2 - wopi - workflow_ocr - workflow_pdf_converter ```

Nextcloud configuration:

Config report ``` { "system": { "apps_paths": [ { "path": "\/var\/www\/html\/apps", "url": "\/apps", "writable": true }, { "path": "\/var\/www\/html\/custom_apps", "url": "\/custom_apps", "writable": true } ], "logfile": "\/var\/www\/log\/nextcloud.log", "memcache.local": "\\OC\\Memcache\\APCu", "passwordsalt": "***REMOVED SENSITIVE VALUE***", "secret": "***REMOVED SENSITIVE VALUE***", "trusted_domains": [ "localhost", "192.168.1.*", "*" ], "trusted_proxies": "***REMOVED SENSITIVE VALUE***", "apache_disable_rewrite_ip": true, "datadirectory": "***REMOVED SENSITIVE VALUE***", "dbtype": "pgsql", "version": "22.2.0.2", "overwrite.cli.url": "***REMOVED SENSITIVE VALUE***, "overwritehost": "***REMOVED SENSITIVE VALUE***", "overwriteprotocol": "https", "dbname": "***REMOVED SENSITIVE VALUE***", "dbhost": "***REMOVED SENSITIVE VALUE***", "dbport": "", "dbtableprefix": "oc_", "dbuser": "***REMOVED SENSITIVE VALUE***", "dbpassword": "***REMOVED SENSITIVE VALUE***", "installed": true, "instanceid": "***REMOVED SENSITIVE VALUE***", "twofactor_enforced": "true", "twofactor_enforced_groups": [ "admin", "2fa" ], "twofactor_enforced_excluded_groups": [], "ldapIgnoreNamingRules": false, "ldapProviderFactory": "OCA\\User_LDAP\\LDAPProviderFactory", "theme": "", "loglevel": 2, "debug": false, "maintenance": false, "has_rebuilt_cache": true, "mail_smtpmode": "smtp", "mail_smtpsecure": "tls", "mail_sendmailmode": "smtp", "mail_from_address": "***REMOVED SENSITIVE VALUE***", "mail_domain": "***REMOVED SENSITIVE VALUE***", "mail_smtpauth": 1, "mail_smtpauthtype": "LOGIN", "mail_smtphost": "***REMOVED SENSITIVE VALUE***", "mail_smtpport": "587", "mail_smtpname": "***REMOVED SENSITIVE VALUE***", "mail_smtppassword": "***REMOVED SENSITIVE VALUE***", "app_install_overwrite": [ "spreed", "twofactor_gateway" ], "default_phone_region": "ISO 3166-2:US" } } ```

Are you using external storage, if yes which one: local

Are you using encryption: no (host provides encryption)

Are you using an external user-backend, if yes which one: no

Nextcloud log (data/nextcloud.log)

Nextcloud log [nextcloud.log](https://github.com/nextcloud/server/files/7493272/nextcloud.log)
cyberpower678 commented 2 years ago

The deleting files one is the most problematic one at the moment. If anyone knows how to workaround/fix this, I would be truly grateful.

JoeH82 commented 2 years ago

Similar issue here: #28960

Very annoying, as there were some issues related to that, which were closed in the past, but did not fixed the problem for me.

skjnldsv commented 2 years ago

Fixed with newer nc versions