nextcloud / nextcloud/server

Files are no longer deleted:Datein werden nicht mehr gelöscht

Open
#58,747 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

0. Needs triage 33-feedback bug
Dominant language
PHP
Stars
36.9k
Forks
5.2k
Avg merge
2d 3h
Merged PRs (30d)
713

Description

Error while running background job OCA\Files_Retention\BackgroundJob\RetentionJob (id: 52815816889999361, arguments: {tag:20})
TypeError OC\Files\View::getOwner(): Argument nextcloud/files_retention#1 ($path) must be of type string, null given, called in /var/www/nextcloud/lib/private/Files/Filesystem.php on line 690

Files are no longer being deleted according to the rules. Deleting and recreating the rules did not help. Deleting the Retention app and then reinstalling it also did not change anything.

Expected behaviour

That the files are deleted again in accordance with the rules.

Actual behaviour

Files are not deleted and only the above error message is generated.

Server configuration

Web server: Nginx

Database: MariaDB

PHP version: 8.4

Nextcloud version: 33.0.0

Enabled:

  • activity: 6.0.0-dev.0
  • admin_audit: 1.23.0
  • agenda_bot: 1.6.0
  • announcementcenter: 7.3.0
  • app_api: 33.0.0
  • assistant: 3.3.0
  • bruteforcesettings: 6.0.0-dev.0
  • calendar: 6.2.1
  • call_summary_bot: 3.2.0
  • circles: 33.0.0
  • cloud_federation_api: 1.17.0
  • collectives: 4.0.0
  • comments: 1.23.0
  • contacts: 8.4.0
  • contactsinteraction: 1.14.1
  • context_chat: 5.3.1
  • csp_editor: 1.8.0
  • dashboard: 7.13.0
  • dav: 1.36.0
  • deck: 1.17.0
  • external: 8.0.0
  • federatedfilesharing: 1.23.0
  • federation: 1.23.0
  • files: 2.5.0
  • files_antivirus: 6.1.0
  • files_automatedtagging: 4.0.0
  • files_downloadlimit: 5.1.0-dev.0
  • files_fulltextsearch: 33.0.0
  • files_pdfviewer: 6.0.0-dev.0
  • files_reminders: 1.6.0
  • files_retention: 4.0.0
  • files_sharing: 1.25.2
  • files_trashbin: 1.23.0
  • files_versions: 1.26.0
  • forms: 5.2.4
  • fulltextsearch: 33.0.0
  • fulltextsearch_elasticsearch: 33.0.0
  • impersonate: 4.0.0
  • integration_mastodon: 5.0.0
  • integration_openai: 4.3.0
  • logreader: 6.0.0
  • lookup_server_connector: 1.21.0
  • mail: 5.7.1
  • memories: 7.8.2
  • news: 28.0.0-rc.2
  • nextcloud_announcements: 5.0.0
  • notes: 4.13.0
  • notifications: 6.0.0
  • notify_push: 1.3.0
  • oauth2: 1.21.0
  • ocs_api_viewer: 1.0.11
  • password_policy: 5.0.0-dev.0
  • passwords: 2026.2.20
  • photos: 6.0.0-dev.0
  • previewgenerator: 5.13.0
  • privacy: 5.0.0-dev.0
  • profile: 1.2.0
  • provisioning_api: 1.23.0
  • recommendations: 6.0.0-dev.0
  • related_resources: 4.0.0-dev.0
  • richdocuments: 10.1.0
  • richdocumentscode: 25.4.902
  • serverinfo: 5.0.0-dev.0
  • settings: 1.16.0
  • sharebymail: 1.23.0
  • sharereview: 2.1.0
  • spreed: 23.0.1
  • suspicious_login: 11.0.0-dev.0
  • systemtags: 1.23.0
  • tables: 2.0.0
  • text: 7.0.0-dev.3
  • theming: 2.8.0
  • thesearchpage: 2.1.1
  • twofactor_backupcodes: 1.22.0
  • twofactor_totp: 15.0.0-dev.0
  • twofactor_webauthn: 2.6.0
  • updatenotification: 1.23.0
  • user_status: 1.13.0
  • viewer: 6.0.0-dev.0
  • weather_status: 1.13.0
  • webhook_listeners: 1.5.0
  • whiteboard: 1.5.7
  • workflow_script: 4.0.0
  • workflowengine: 2.15.0
    Disabled:
  • encryption: 2.21.0 (installed 2.20.0)
  • files_external: 1.25.1 (installed 1.24.0)
  • firstrunwizard: 6.0.0-dev.0 (installed 5.0.0-dev.0)
  • support: 5.0.0 (installed 4.0.0-dev.0)
  • survey_client: 5.0.0-dev.0 (installed 1.8.0)
  • twofactor_nextcloud_notification: 7.0.0 (installed 5.0.0)
  • user_ldap: 1.24.0 (installed 1.23.0)
{
    "system": {
        "serverid": 1,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            123.de",
            "abc.b30.local"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "33.0.0.16",
        "overwrite.cli.url": "https:\/\/123.de",
        "overwritehost": 123.de",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "activity_expire_days": 14,
        "auth.bruteforce.protection.enabled": true,
        "forbidden_filenames": [
            ".htaccess",
            "Thumbs.db",
            "thumbs.db"
        ],
        "cron_log": true,
        "enable_previews": true,
        "enabledPreviewProviders": [
            "OC\\Preview\\PNG",
            "OC\\Preview\\JPEG",
            "OC\\Preview\\GIF",
            "OC\\Preview\\BMP",
            "OC\\Preview\\XBitmap",
            "OC\\Preview\\Movie",
            "OC\\Preview\\PDF",
            "OC\\Preview\\MP3",
            "OC\\Preview\\TXT",
            "OC\\Preview\\MarkDown",
            "OC\\Preview\\Image",
            "OC\\Preview\\HEIC",
            "OC\\Preview\\TIFF",
            "OC\\Preview\\MKV",
            "OC\\Preview\\MP4",
            "OC\\Preview\\AVI"
        ],
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "filesystem_check_changes": 1,
        "check_data_directory_permissions": false,
        "default_phone_region": "DE",
        "default_language": "de",
        "default_locale": "de_DE",
        "lost_password_link": "disabled",
        "filelocking.enabled": "false",
        "allow_self_signed": true,
        "allow_local_address": true,
        "allow_local_remote_servers": true,
        "share_folder": "\/Shares",
        "htaccess.RewriteBase": "\/",
        "integrity.check.disabled": false,
        "knowledgebaseenabled": false,
        "logfile": "\/var\/tmp\/nextcloud.log",
        "loglevel": 1,
        "logtimezone": "Europe\/Berlin",
        "log_rotate_size": 104857600,
        "maintenance": false,
        "maintenance_window_start": 1,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "cache_app_config": true,
        "overwriteprotocol": "https",
        "preview_max_x": 2048,
        "preview_max_y": 2048,
        "preview_max_scale_factor": 1,
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0,
            "password": "***REMOVED SENSITIVE VALUE***",
            "timeout": 0.5,
            "dbindex": 1
        },
        "quota_include_external_storage": false,
        "skeletondirectory": "\/mnt\/nextclouddata\/benutzer_vorlage",
        "theme": "",
        "trashbin_retention_obligation": "auto, 7",
        "updater.release.channel": "stable",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpmode": "smtp",
        "mail_sendmailmode": "smtp",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "25",
        "mail_smtptimeout": 30,
        "mail_smtpauthtype": "NTLM",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "app_install_overwrite": [
            "memories",
            "csp_editor",
            "files_antivirus",
            "agenda_bot"
        ],
        "twofactor_enforced": "true",
        "twofactor_enforced_groups": [],
        "twofactor_enforced_excluded_groups": [
            "Speziale"
        ],
        "remember_login_cookie_lifetime": 0,
        "session_lifetime": 900,
        "session_keepalive": false,
        "auto_logout": true,
        "forbidden_filename_characters": [
            "<",
            ">",
            ":",
            "\"",
            "|",
            "?",
            "*",
            "\\",
            "\/"
        ],
        "forbidden_filename_extensions": [
            " ",
            ".",
            ".filepart",
            ".part"
        ],
        "memories.db.triggers.fcu": true,
        "memories.exiftool": "\/var\/www\/nextcloud\/apps\/memories\/bin-ext\/exiftool-amd64-glibc",
        "memories.vod.path": "\/var\/www\/nextcloud\/apps\/memories\/bin-ext\/go-vod-amd64",
        "memories.vod.ffmpeg": "\/usr\/bin\/ffmpeg",
        "memories.vod.ffprobe": "\/usr\/bin\/ffprobe",
        "memories.gis_type": 1,
        "preview_max_memory": 2028,
        "preview_max_filesize_image": 512,
        "forbidden_filename_basenames": [
            "con",
            "prn",
            "aux",
            "nul",
            "com0",
            "com1",
            "com2",
            "com3",
            "com4",
            "com5",
            "com6",
            "com7",
            "com8",
            "com9",
            "com\u00b9",
            "com\u00b2",
            "com\u00b3",
            "lpt0",
            "lpt1",
            "lpt2",
            "lpt3",
            "lpt4",
            "lpt5",
            "lpt6",
            "lpt7",
            "lpt8",
            "lpt9",
            "lpt\u00b9",
            "lpt\u00b2",
            "lpt\u00b3"
        ],
        "defaultapp": "dashboard"
    }
}
Nextcloud-Log:
{"reqId":"Zg9FmzZdpMYAgNZhzRRu","level":3,"time":"2026-03-02T08:54:06+01:00","remoteAddr":"","user":"--","app":"core","method":"","url":"--","scriptName":"/var/www/nextcloud/occ","message":"Error while running background job OCA\\Files_Retention\\BackgroundJob\\RetentionJob (id: 52815816889999361, arguments: {\"tag\":20})","userAgent":"--","version":"33.0.0.16","occ_command":["/var/www/nextcloud/occ","background-job:execute"],"exception":{"Exception":"TypeError","Message":"OC\\Files\\View::getOwner(): Argument nextcloud/files_retention#1 ($path) must be of type string, null given, called in /var/www/nextcloud/lib/private/Files/Filesystem.php on line 690","Code":0,"Trace":[{"file":"/var/www/nextcloud/lib/private/Files/Filesystem.php","line":690,"function":"getOwner","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/apps/files_versions/lib/Storage.php","line":90,"function":"getOwner","class":"OC\\Files\\Filesystem","type":"::"},{"file":"/var/www/nextcloud/apps/files_versions/lib/Storage.php","line":225,"function":"getUidAndFilename","class":"OCA\\Files_Versions\\Storage","type":"::"},{"file":"/var/www/nextcloud/apps/files_versions/lib/Listener/FileEventsListener.php","line":326,"function":"markDeletedFile","class":"OCA\\Files_Versions\\Storage","type":"::"},{"file":"/var/www/nextcloud/apps/files_versions/lib/Listener/FileEventsListener.php","line":90,"function":"pre_remove_hook","class":"OCA\\Files_Versions\\Listener\\FileEventsListener","type":"->"},{"file":"/var/www/nextcloud/lib/private/EventDispatcher/ServiceEventListener.php","line":57,"function":"handle","class":"OCA\\Files_Versions\\Listener\\FileEventsListener","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":220,"function":"__invoke","class":"OC\\EventDispatcher\\ServiceEventListener","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php","line":56,"function":"callListeners","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php","line":67,"function":"dispatch","class":"Symfony\\Component\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php","line":79,"function":"dispatch","class":"OC\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Node/HookConnector.php","line":112,"function":"dispatchTyped","class":"OC\\EventDispatcher\\EventDispatcher","type":"->"},{"file":"/var/www/nextcloud/lib/private/legacy/OC_Hook.php","line":85,"function":"delete","class":"OC\\Files\\Node\\HookConnector","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":1322,"function":"emit","class":"OC_Hook","type":"::"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":1194,"function":"runHooks","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/View.php","line":676,"function":"basicOperation","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/lib/private/Files/Node/File.php","line":112,"function":"unlink","class":"OC\\Files\\View","type":"->"},{"file":"/var/www/nextcloud/apps/files_retention/lib/BackgroundJob/RetentionJob.php","line":219,"function":"delete","class":"OC\\Files\\Node\\File","type":"->"},{"file":"/var/www/nextcloud/apps/files_retention/lib/BackgroundJob/RetentionJob.php","line":121,"function":"expireNode","class":"OCA\\Files_Retention\\BackgroundJob\\RetentionJob","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/Job.php","line":47,"function":"run","class":"OCA\\Files_Retention\\BackgroundJob\\RetentionJob","type":"->"},{"file":"/var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php","line":85,"function":"start","class":"OCP\\BackgroundJob\\Job","type":"->"},{"file":"/var/www/nextcloud/core/Command/Background/Job.php","line":72,"function":"start","class":"OCP\\BackgroundJob\\TimedJob","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Command/Command.php","line":326,"function":"execute","class":"OC\\Core\\Command\\Background\\Job","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":1078,"function":"run","class":"Symfony\\Component\\Console\\Command\\Command","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":324,"function":"doRunCommand","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/3rdparty/symfony/console/Application.php","line":175,"function":"doRun","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/lib/private/Console/Application.php","line":187,"function":"run","class":"Symfony\\Component\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/console.php","line":92,"function":"run","class":"OC\\Console\\Application","type":"->"},{"file":"/var/www/nextcloud/occ","line":33,"args":["/var/www/nextcloud/console.php"],"function":"require_once"}],"File":"/var/www/nextcloud/lib/private/Files/View.php","Line":1789,"message":"Error while running background job OCA\\Files_Retention\\BackgroundJob\\RetentionJob (id: 52815816889999361, arguments: {\"tag\":20})","exception":"{\"class\":\"TypeError\",\"message\":\"OC\\Files\\View::getOwner(): Argument nextcloud/files_retention#1 ($path) must be of type string, null given, called in /var/www/nextcloud/lib/private/Files/Filesystem.php on line 690\",\"code\":0,\"file\":\"/var/www/nextcloud/lib/private/Files/View.php:1789\",\"trace\":\"#0 /var/www/nextcloud/lib/private/Files/Filesystem.php(690): OC\\Files\\View->getOwner()\\n#1 /var/www/nextcloud/apps/files_versions/lib/Storage.php(90): OC\\Files\\Filesystem::getOwner()\\n#2 /var/www/nextcloud/apps/files_versions/lib/Storage.php(225): OCA\\Files_Versions\\Storage::getUidAndFilename()\\n#3 /var/www/nextcloud/apps/files_versions/lib/Listener/FileEventsListener.php(326): OCA\\Files_Versions\\Storage::markDeletedFile()\\n#4 /var/www/nextcloud/apps/files_versions/lib/Listener/FileEventsListener.php(90): OCA\\Files_Versions\\Listener\\FileEventsListener->pre_remove_hook()\\n#5 /var/www/nextcloud/lib/private/EventDispatcher/ServiceEventListener.php(57): OCA\\Files_Versions\\Listener\\FileEventsListener->handle()\\n#6 /var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php(220): OC\\EventDispatcher\\ServiceEventListener->__invoke()\\n#7 /var/www/nextcloud/3rdparty/symfony/event-dispatcher/EventDispatcher.php(56): Symfony\\Component\\EventDispatcher\\EventDispatcher->callListeners()\\n#8 /var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php(67): Symfony\\Component\\EventDispatcher\\EventDispatcher->dispatch()\\n#9 /var/www/nextcloud/lib/private/EventDispatcher/EventDispatcher.php(79): OC\\EventDispatcher\\EventDispatcher->dispatch()\\n#10 /var/www/nextcloud/lib/private/Files/Node/HookConnector.php(112): OC\\EventDispatcher\\EventDispatcher->dispatchTyped()\\n#11 /var/www/nextcloud/lib/private/legacy/OC_Hook.php(85): OC\\Files\\Node\\HookConnector->delete()\\n#12 /var/www/nextcloud/lib/private/Files/View.php(1322): OC_Hook::emit()\\n#13 /var/www/nextcloud/lib/private/Files/View.php(1194): OC\\Files\\View->runHooks()\\n#14 /var/www/nextcloud/lib/private/Files/View.php(676): OC\\Files\\View->basicOperation()\\n#15 /var/www/nextcloud/lib/private/Files/Node/File.php(112): OC\\Files\\View->unlink()\\n#16 /var/www/nextcloud/apps/files_retention/lib/BackgroundJob/RetentionJob.php(219): OC\\Files\\Node\\File->delete()\\n#17 /var/www/nextcloud/apps/files_retention/lib/BackgroundJob/RetentionJob.php(121): OCA\\Files_Retention\\BackgroundJob\\RetentionJob->expireNode()\\n#18 /var/www/nextcloud/lib/public/BackgroundJob/Job.php(47): OCA\\Files_Retention\\BackgroundJob\\RetentionJob->run()\\n#19 /var/www/nextcloud/lib/public/BackgroundJob/TimedJob.php(85): OCP\\BackgroundJob\\Job->start()\\n#20 /var/www/nextcloud/core/Command/Background/Job.php(72): OCP\\BackgroundJob\\TimedJob->start()\\n#21 /var/www/nextcloud/3rdparty/symfony/console/Command/Command.php(326): OC\\Core\\Command\\Background\\Job->execute()\\n#22 /var/www/nextcloud/3rdparty/symfony/console/Application.php(1078): Symfony\\Component\\Console\\Command\\Command->run()\\n#23 /var/www/nextcloud/3rdparty/symfony/console/Application.php(324): Symfony\\Component\\Console\\Application->doRunCommand()\\n#24 /var/www/nextcloud/3rdparty/symfony/console/Application.php(175): Symfony\\Component\\Console\\Application->doRun()\\n#25 /var/www/nextcloud/lib/private/Console/Application.php(187): Symfony\\Component\\Console\\Application->run()\\n#26 /var/www/nextcloud/console.php(92): OC\\Console\\Application->run()\\n#27 /var/www/nextcloud/occ(33): require_once('...')\\n#28 {main}\"}","CustomMessage":"Error while running background job OCA\\Files_Retention\\BackgroundJob\\RetentionJob (id: 52815816889999361, arguments: {\"tag\":20})"},"id":"69a545f6725f9"}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with OCA\Files_Retention\BackgroundJob\RetentionJob and trace the reported failure through lib/private/Files/Filesystem.php at line 690, then apps/files_versions/lib/Storage.php and FileEventsListener.php. Reproduce the background-job deletion failure and identify why getOwner receives a null path; done means retention deletions complete without this TypeError.

Written by the indexing model from the issue text.

Assessment

Tech stack
php
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.