bookmarks icon indicating copy to clipboard operation
bookmarks copied to clipboard

Nextcloud log: ...bookmarks/cache/CACHEDIR.TAG: Failed to open stream

Open kF13Ld opened this issue 1 year ago • 5 comments

Describe the bug Nextcloud AiO shows error messages in log about every 30-35 min: file_put_contents(/mnt/ncdata/appdata_octzohmn52wo/bookmarks/cache/CACHEDIR.TAG): Failed to open stream: No such file or directory at /var/www/html/lib/private/Files/Storage/Local.php#304 To Reproduce Steps to reproduce the behavior:

  1. Nextcloud AiO v10.1.1 running
  2. view protocoll: https:///settings/admin/logging
  3. See error

Expected behavior No error message

Desktop (please complete the following information):

  • OS: Linux (Aurora)
  • Browser: Firefox
  • Version: 133.0.3

Server (please complete the following information):

  • OS: Debian 12 Bookworm
  • Nextcloud AiO v10.1.1
  • Bookmarks app version: 15.0.4
  • Activated Nextcloud Apps:
 root@alpine:~# sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ app:list
Enabled:
  - activity: 3.0.0
  - admin_audit: 1.20.0
  - app_api: 4.0.3
  - bookmarks: 15.0.4
  - bruteforcesettings: 3.0.0
  - calendar: 5.0.8
  - circles: 30.0.0
  - cloud_federation_api: 1.13.0
  - comments: 1.20.1
  - contacts: 6.1.2
  - contactsinteraction: 1.11.0
  - dav: 1.31.1
  - facerecognition: 0.9.60
  - federatedfilesharing: 1.20.0
  - federation: 1.20.0
  - files: 2.2.0
  - files_downloadlimit: 3.0.0
  - files_fulltextsearch: 30.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
  - firstrunwizard: 3.0.0
  - fulltextsearch: 30.0.0
  - fulltextsearch_elasticsearch: 30.0.0
  - logreader: 3.0.0
  - lookup_server_connector: 1.18.0
  - memories: 7.4.1
  - nextcloud-aio: 0.7.0
  - nextcloud_announcements: 2.0.0
  - notes: 4.11.0
  - notifications: 3.0.0
  - notify_push: 0.7.0
  - oauth2: 1.18.1
  - password_policy: 2.0.0
  - photos: 3.0.2
  - previewgenerator: 5.7.0
  - privacy: 2.0.0
  - provisioning_api: 1.20.0
  - recognize: 8.2.0
  - recommendations: 3.0.0
  - related_resources: 1.5.0
  - serverinfo: 2.0.0
  - settings: 1.13.0
  - sharebymail: 1.20.0
  - support: 2.0.0
  - survey_client: 2.0.0
  - systemtags: 1.20.0
  - tasks: 0.16.1
  - text: 4.1.0
  - theming: 2.5.0
  - twofactor_backupcodes: 1.19.0
  - twofactor_totp: 12.0.0-dev
  - user_status: 1.10.0
  - viewer: 3.0.0
  - weather_status: 1.10.0
  - webhook_listeners: 1.1.0-dev
  - workflowengine: 2.12.0
Disabled:
  - dashboard: 7.10.0 (installed 7.8.0)
  - deck: 1.14.2 (installed 1.14.2)
  - encryption: 2.18.0
  - files_external: 1.22.0
  - suspicious_login: 8.0.0
  - twofactor_nextcloud_notification: 4.0.0
  - user_ldap: 1.21.0

  • Nextcloud configuration:
root@alpine:~# sudo docker exec --user www-data -it nextcloud-aio-nextcloud php occ config:list system                                                                                       {
    "system": {
        "one-click-instance": true,
        "one-click-instance.user-limit": 100,
        "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
            }  
        ],
        "appsallowlist": false,
        "check_data_directory_permissions": false,
        "memcache.distributed": "\\OC\\Memcache\\Redis",
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "password": "***REMOVED SENSITIVE VALUE***",
            "port": 6379
        },
        "overwritehost": "***REMOVED SENSITIVE VALUE**",
        "overwriteprotocol": "https",
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "***REMOVED SENSITIVE VALUE**"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "pgsql",
        "version": "30.0.4.1",
        "overwrite.cli.url": "https:\/\/***REMOVED SENSITIVE VALUE**\/",
        "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***",
        "maintenance": false,
        "loglevel": "2",
        "log_type": "file",
        "logfile": "\/var\/www\/html\/data\/nextcloud.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",
            "0": "OC\\Preview\\Imaginary",
            "23": "OC\\Preview\\ImaginaryPDF"
        },
        "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",
        "updatedirectory": "\/nc-updater",
        "maintenance_window_start": 100,
        "allow_local_remote_servers": true,
        "davstorage.request_timeout": 3600,
        "htaccess.RewriteBase": "\/",
        "dbpersistent": false,
        "files_external_allow_create_new_local": false,
        "trusted_proxies": "***REMOVED SENSITIVE VALUE***",
        "preview_imaginary_url": "***REMOVED SENSITIVE VALUE***",
        "preview_imaginary_key": "***REMOVED SENSITIVE VALUE***",
        "default_phone_region": "DE",
        "mail_smtpsecure": "ssl",
        "mail_sendmailmode": "smtp",
        "mail_smtphost": "***REMOVED SENSITIVE VALUE***",
        "mail_from_address": "***REMOVED SENSITIVE VALUE***",
        "mail_domain": "***REMOVED SENSITIVE VALUE***",
        "mail_smtpport": "465",
        "mail_smtpauth": 1,
        "mail_smtpname": "***REMOVED SENSITIVE VALUE***",
        "mail_smtppassword": "***REMOVED SENSITIVE VALUE***",
        "auth.bruteforce.protection.enabled": true,
        "ratelimit.protection.enabled": true,
        "data-fingerprint": "8e63ee77960fdff805345fa2e5eb7c42",
        "facerecognition.external_model_url": "nextcloud-aio-facerecognition:5000",
        "facerecognition.external_model_api_key": "some-super-secret-api-key",
        "enabledFaceRecognitionMimetype": [
            "image\/jpeg",
            "image\/png",
            "image\/heic",
            "image\/tiff",
            "image\/webp"
        ],
        "memories.db.triggers.fcu": true,
        "memories.exiftool": "\/var\/www\/html\/custom_apps\/memories\/bin-ext\/exiftool-amd64-musl",
        "memories.vod.path": "\/var\/www\/html\/custom_apps\/memories\/bin-ext\/go-vod-amd64",
        "memories.vod.ffmpeg": "\/usr\/bin\/ffmpeg",
        "memories.vod.ffprobe": "\/usr\/bin\/ffprobe",
        "documentation_url.server_logs": "https:\/\/github.com\/nextcloud\/all-in-one\/discussions\/5425",
        "DOMAIN": "***REMOVED SENSITIVE VALUE**"
    }
}

Nextcloud log (nextcloud/data/nextcloud.log)

file_put_contents(/mnt/ncdata/appdata_octzohmn52wo/bookmarks/cache/CACHEDIR.TAG): Failed to open stream: No such file or directory at /var/www/html/lib/private/Files/Storage/Local.php#304 

kF13Ld avatar Jan 05 '25 20:01 kF13Ld

Hello :wave:

Thank you for taking the time to open this issue with the bookmarks app. I know it's frustrating when software causes problems. You have made the right choice to come here and open an issue to make sure your problem gets looked at and if possible solved. I'm Marcel and have been maintaining this software the last few years. I currently work for Nextcloud but maintain this app in my free time, because it is not an official Nextcloud product. My day job at Nextcloud is pretty awesome but sadly leaves me with less time for side projects like this one than I used to have. I still try to answer all issues and if possible fix all bugs here, but it sometimes takes a while until I get to it. Until then, please be patient. Note also that GitHub is a place where people meet to make software better together. Nobody here is under any obligation to help you, solve your problems or deliver on any expectations or demands you may have, but if enough people come together we can collaborate to make this software better. For everyone. Thus, if you can, you could also look at other issues to see whether you can help other people with your knowledge and experience. If you have coding experience it would also be awesome if you could step up to dive into the code and try to fix the odd bug yourself. Everyone will be thankful for extra helping hands! One last word: If you feel, at any point, like you need to vent, this is not the place for it; you can go to the forum, to twitter or somewhere else. But this is a technical issue tracker, so please make sure to focus on the tech and keep your opinions to yourself. (Also see our Code of Conduct. Really.)

I look forward to working with you on this issue Cheers :blue_heart:

github-actions[bot] avatar Jan 05 '25 20:01 github-actions[bot]

I had exactly the same problem very recently. I found out that the folders "bookmarks" and "cache" were not present, neither in the container "nextcloud-aio-nextcloud" nor on the appertaining volume "nextcloud_aio_nextcloud_data".

I had a similar problem with a similar error log entry one or two months before with the bookmarks app. I did not exactly remember the solution, but after deactivating and deleting the bookmarks app and also recreating all of the containers I still had a "bookmarks" folder in that place. So I deleted that folder recursively and installed bookmarks app again. Then it worked until recently when I received your error message.

So now the steps I did now: Go into the nextcloud-aio-nextcloud container: docker exec -it nextcloud-aio-nextcloud bash cd to: /mnt/ncdata/appdata_octzohmn52wo

Check if the bookmarks folder is there, otherwise create it and also the cache folde r,and change ownership :

mkdir bookmarks cd bookmarks mkdir cache cd.. cd.. sudo chown www-data:www-data -R bookmarks

Now exit the container and cd to the nextcloud.log /var/lib/docker/volumes/nextcloud_aio_nextcloud/_data/data/ Open nextcloud.log with an editor and delete all the content and save the file.

Stop all containers and restart them. The newly created folders are also present now in the volume nextcloud_aio_nextcloud_data I have a green checkmark since two days now. Hope this helps! Please check all paths to make sure they apply to your settings.

ger35678 avatar Jan 11 '25 08:01 ger35678

Thank you very much! Even after one day those messages did not reoccur!

In short: the bookmarks app would just have to create the subfolder: /mnt/ncdata/appdata_octzohmn52wo/bookmarks/cache for everything to work.

kF13Ld avatar Jan 12 '25 11:01 kF13Ld

The thing is that the app does create the folder if it doesn't exist 🤔

marcelklehr avatar Jan 14 '25 17:01 marcelklehr

I had the same issue, followed the steps above (thanks @ger35678 !) and seems errors are gone now. When I checked, there was no "cache" folder in the bookmarks folder and so I had to create it.

This was the error popping up in my logs:

[PHP] Error: file_put_contents(/mnt/ncdata/appdata_octacvxomn89/bookmarks/cache/CACHEDIR.TAG): Failed to open stream: No such file or directory at /var/www/html/lib/private/Files/Storage/Local.php#304 from ? by -- at 31 Mar 2025, 08:36:48

{"reqId":"3qyPU9QpWUpSL3lTN0yM","level":3,"time":"2025-03-31T08:36:48+00:00","remoteAddr":"","user":"--","app":"PHP","method":"","url":"--","message":"file_put_contents(/mnt/ncdata/appdata_octacvxomn89/bookmarks/cache/CACHEDIR.TAG): Failed to open stream: No such file or directory at /var/www/html/lib/private/Files/Storage/Local.php#304","userAgent":"--","version":"30.0.8.1","data":{"app":"PHP"},"id":"67ea5eb294ba0"}

Edit: I also noticed I had two folders:

appdata_oc0a9y2tmc72/ 
appdata_octacvxomn89/ 

So I did the same treatment in both. 🤷‍♂

andreas-1107 avatar Mar 31 '25 09:03 andreas-1107

Closing for now as this seems to not have happened anymore recently. Feel free to shout here or open a new issue if this reappears. Thank you for your cooperation 💙

marcelklehr avatar Jul 27 '25 12:07 marcelklehr