Skip to content

Unknown cache errors #1043

Closed
Closed

Description

@mosslocker

Describe the bug

When moving or deleting files on my Opencloud server, I have come across some errors in the container logs. The files appear to move and delete successfully, but I wanted to raise this report in-case something is going wrong under the hood.

Steps to reproduce

  1. Create a folder
  2. Move a file to that folder
  3. Delete a file

Expected behaviour

Actions are performed with no errors in the container logs

Actual behaviour

Three types of errors occur at various stages (logs provided)

  • ERR failed to handle moved away item error=error: not found: path not found in cache
  • ERR could not delete parent id cache error="key not found"
  • ERR could not remove lock file

Setup

  • I only wish to use the Opencloud fileserver, I am not interested in things like Collabra etc.
  • I am running Opencloud-rolling:latest using Docker, on a Ubuntu 24.04 Virtual Machine. This VM is managed by Proxmox.
  • I use Caddy for my reverse proxy
  • I use Zitadel for OAuth
  • I am pointing the POSIX root to a virtoFS mount on my VM (/mnt/cloud/opencloud). This virtioFS mount points to a ZFS pool on my Proxmox host where I plan on keeping my files for Opencloud. I do not want to store the files on the VM itself.
  • Extended attributes are enabled on the virtioFS configuration for this VM
  • The directories on both the VM and HOST are set to 1000:1000 permissions, as specified in OC docs
  • I have defined a CSP.yaml, using the example given in the opencloud_full deployments
  • I have defined a proxy.yaml, this simply looks for my Client ID from Zitadel and makes me an admin when I login, for testing purposes.
  • Container log is attached

Here is my compose.yaml

services:
  opencloud:
    image: opencloudeu/opencloud-rolling:latest
    container_name: opencloud
    restart: unless-stopped
    volumes:
      - config:/etc/opencloud
      - data:/var/lib/opencloud
      - /mnt/cloud/opencloud:/var/lib/opencloud-posix
      # Local CSP with my auth domain added
      - ./config/csp.yaml:/etc/opencloud/csp.yaml
      # Local proxy.yaml contains role assignment instructions to make myself an admin
      - ./config/proxy.yaml:/etc/opencloud/proxy.yaml
    ports:
      - "{MY PORT}:9200"   
    logging:
      driver: local
    entrypoint:
      - /bin/sh
    command: ["-c", "opencloud init || true; opencloud server"]
    environment:
      OC_URL: https://{MY DOMAIN}
      OC_LOG_LEVEL: error
      OC_LOG_PRETTY: true
      # Reverse proxy handles certificates, so these two are set to False
      PROXY_TLS: false
      OC_INSECURE: true
      
      # These four are from the deployment example on the OC github, no idea what they do
      GATEWAY_GRPC_ADDR: 0.0.0.0:9142
      MICRO_REGISTRY_ADDRESS: 127.0.0.1:9233
      NATS_NATS_HOST: 0.0.0.0
      NATS_NATS_PORT: 9233
      # custom CSP file
      PROXY_CSP_CONFIG_FILE_LOCATION: /etc/opencloud/csp.yaml     

      # use posixFS for more human readable file structure
      STORAGE_USERS_DRIVER: posix
      # Recommended cache storage driver from the OC docs when using posix
      STORAGE_USERS_ID_CACHE_STORE: nats-js-kv
      # Not sure if I need this line as well
      # STORAGE_USERS_FILEMETADATA_CACHE_STORE: nats-js-kv
      STORAGE_USERS_POSIX_ROOT: /var/lib/opencloud-posix
      # I am using virtioFS, to link to a ZFS pool on the host, do I need this??
      STORAGE_USERS_POSIX_WATCH_FS: true 
            
      ####### INTERNAL AUTH #######
      # PROXY_ENABLE_BASIC_AUTH: true
      #############################

      ########### EXTERNAL AUTH ###########
      OC_OIDC_ISSUER: https://{MY ZITADEL DOMAIN}
      EXTERNAL_OIDC_DOMAIN: {MY ZITADEL DOMAIN}
      # Needed to access all the relevant sub-URLs for Auth
      PROXY_OIDC_REWRITE_WELLKNOWN: true
      # App ID from Zitadel
      WEB_OIDC_CLIENT_ID: {MY ZITADEL CLIENT ID}
      # Doesn't work without this, no idea why
      PROXY_OIDC_ACCESS_TOKEN_VERIFY_METHOD: none
      # Make accounts for OC if they don't already exist, based on claims from Zitadel
      PROXY_AUTOPROVISION_ACCOUNTS: true
      # sub is used due to the ClientID never changing, where as users sometimes change their preferred_name
      PROXY_USER_OIDC_CLAIM: sub
      PROXY_USER_CS3_CLAIM: username
      PROXY_AUTOPROVISION_CLAIM_EMAIL: email
      PROXY_AUTOPROVISION_CLAIM_DISPLAYNAME: name
      PROXY_AUTOPROVISION_CLAIM_GROUPS: groups
      PROXY_AUTOPROVISION_CLAIM_USERNAME: sub
      OC_EXCLUDE_RUN_SERVICES: idp
      OC_ADMIN_USER_ID: ""
      GRAPH_ASSIGN_DEFAULT_USER_ROLE: false
      GRAPH_USERNAME_MATCH: none
      GRAPH_LDAP_SERVER_WRITE_ENABLED: true
      ######################################

volumes:
  config:
  data:

Here is my csp.yaml

directives:
  child-src:
    - '''self'''
  connect-src:
    - '''self'''
    - 'blob:'
    # - 'https://${COMPANION_DOMAIN|companion.opencloud.test}/'
    # - 'wss://${COMPANION_DOMAIN|companion.opencloud.test}/'
    - 'https://raw.githubusercontent.com/opencloud-eu/awesome-apps/'
    # - 'https://${KEYCLOAK_DOMAIN|keycloak.opencloud.test}/'
    - 'https://{MY-ZITADEL-DOMAIN}'
  default-src:
    - '''none'''
  font-src:
    - '''self'''
  frame-ancestors:
    - '''self'''
  frame-src:
    - '''self'''
    - 'blob:'
    - 'https://embed.diagrams.net/'
    # In contrary to bash and docker the default is given after the | character
    # - 'https://${ONLYOFFICE_DOMAIN|onlyoffice.opencloud.test}/'
    # - 'https://${COLLABORA_DOMAIN|collabora.opencloud.test}/'
    # This is needed for the external-sites web extension when embedding sites
    - 'https://docs.opencloud.eu'
  img-src:
    - '''self'''
    - 'data:'
    - 'blob:'
    - 'https://raw.githubusercontent.com/opencloud-eu/awesome-apps/'
    # In contrary to bash and docker the default is given after the | character
    # - 'https://${ONLYOFFICE_DOMAIN|onlyoffice.opencloud.test}/'
    # - 'https://${COLLABORA_DOMAIN|collabora.opencloud.test}/'
  manifest-src:
    - '''self'''
  media-src:
    - '''self'''
  object-src:
    - '''self'''
    - 'blob:'
  script-src:
    - '''self'''
    - '''unsafe-inline'''
  style-src:
    - '''self'''
    - '''unsafe-inline'''

Here is my proxy.yaml

role_assignment:
    driver: oidc
    oidc_role_mapper:
        role_claim: sub
        role_mapping:
            - role_name: admin
              claim_value: {MY ZITADEL USER ID}

OC container logs.txt

Activity

  1. butonic commented on Jun 11, 2025

    @butonic
    Member
          # I am using virtioFS, to link to a ZFS pool on the host, do I need this??
          STORAGE_USERS_POSIX_WATCH_FS: true
    

    yes, but I can't tell if it is sufficient, yet. You only need this if you are moving / editing files and folders outside of opencloud. An a local filesystem we will use inotify to monitor for changes and then assimilate the changes by adding missin file ids to the extended attributes and invalidating our caches.

    STORAGE_USERS_FILEMETADATA_CACHE_STORE defaults to memory, which is sufficient when running a singe node deployment

    Reading your description and since you enabled STORAGE_USERS_POSIX_WATCH_FS I assume you are interacting with the files in this manner. Correct me if I am wrong!

    Now there are several things that can go wrong: It is not clear where you change the filees. The inotity mechanism might need to be propagated from the host that provides the ZFS into your VM that uses virtoFS ... I am not sure that is a supported feature.

    1. Try restarting opencloud. That will assimilate the existing files and ubdate the caches.
    2. Then try editing files by sshing into your vm (move a folder, then try accessing it or a file contained in it via web). This shoud work.
    3. Try editing files on your proxmox host. I doubt that works.
    4. Try using a docker compose setup instead of a VM.

    Please let us know what works or if you can clarify your setup.

  2. mosslocker commented on Jun 11, 2025

    @mosslocker
    Author

    To clarify my setup for you:

    • I am currently exclusively interacting with my files using the Opencloud WebUI, for testing. I am not, and do not plan to, interact with files on the file system myself and have Opencloud "look" for changes - everything will be done in the OC environment.
    • I only added STORAGE_USERS_POSIX_WATCH_FS because I saw it on your documentation under "docs/admin/configuration/storage/storage-posix", and thought I potentially needed it. But by your description, I don't think I do.
    • I am a little confused by your suggestion to use a docker compose setup, instead of a VM. I am currently using docker compose already, inside of a VM.

    Thanks

  3. butonic commented on Jun 12, 2025

    @butonic
    Member

    Ok, that clarifies the setup. I am trying to understand why you run a docker compose deployment inside a VM. To set resource limits? For routing? Why the additional VM? You could run docker compose directly with proxmox, right?

    Lets go through your env vars:

          # -> this causes opencloud to trust all certificates, you goal should be to leave this to the default false
          OC_INSECURE: true
          
          # These four are from the deployment example on the OC github, no idea what they do
          # -> these make the gateway and nats services accept network request from other containers
          # currently only needed for the collaboration service, you should be able to comment this
          #GATEWAY_GRPC_ADDR: 0.0.0.0:9142   
          #MICRO_REGISTRY_ADDRESS: 127.0.0.1:9233
          #NATS_NATS_HOST: 0.0.0.0
          #NATS_NATS_PORT: 9233
    
          # Not sure if I need this line as well
          # -> no, default is memory which works fine for single a process deployment
          # STORAGE_USERS_FILEMETADATA_CACHE_STORE: nats-js-kv
    
          # I am using virtioFS, to link to a ZFS pool on the host, do I need this??
          # -> with your clarification: no. not needed if all file access happens through opencloud
          # STORAGE_USERS_POSIX_WATCH_FS: true
    
          ########### EXTERNAL AUTH ###########
          # Doesn't work without this, no idea why
          # -> opencloud by default assumes access tokens in jwt format, which we can verify without 
          # making requests to the idp. The idp may however only send an opaque string, which we cannot verify.
          # depends on the idp and might even be a config option there.
          # setting it to none does not reduce security because we verify the access token by sending it to the idp
          PROXY_OIDC_ACCESS_TOKEN_VERIFY_METHOD: none

    nothing critical.

    now on to the ERR log entries:

    • 2025-06-11T12:11:15Z ERR failed to handle moved away item error="error: not found: path not found in cache... can be ignored ... AFAICT this case is actually expected if a file is moved away. We need to decrease the log level.
      		err = t.HandleFileDelete(path, false) // Do not send a item-trashed SSE in case of moves. They trigger a item-renamed event instead.
      		if err != nil {
      			t.log.Error().Err(err).Str("path", path).Bool("isDir", isDir).Msg("failed to handle moved away item")
      		}
    • 2025-06-11T12:11:15Z ERR could not delete parent id cache error="key not found"... can be ignored ... AFAICT the activitylog service tries to cleanup its cache. We need to decrease the log level.
      	if err := a.parentIdCache.Remove(storagespace.FormatResourceID(purgeId)); err != nil {
      		a.log.Error().Interface("event", ref).Err(err).Msg("could not delete parent id cache")
      	}
    • 2025-06-11T12:11:30Z ERR could not remove lock file error=" ... no such file or directory" can be ignored. we need to decrease the log level to debug.
      	// Remove lock file if it exists
      	if err := os.Remove(n.LockFilePath()); err != nil {
      		t.log.Error().Err(err).Str("path", n.LockFilePath()).Msg("could not remove lock file")
      	}
    • 2025-06-11T12:11:30Z ERR failed to handle moved away item error="error: not found: path not found in cache same as the first err entry

    meh. sorry for the noise. nothing to see here ... Thx for the really nice report and logs!

    This is a great junior job.

  4. moved this from Qualification to Prio <= 3 in OpenCloud Team Boardon Jun 12, 2025
  5. added theissue type on Jun 12, 2025
  6. mosslocker commented on Jun 12, 2025

    @mosslocker
    Author

    Thank you for your reply

    • I use docker on this VM for many different applications, things like Immich, Opencloud, Paperless etc etc. I have another separate VM on Proxmox for some game servers, so I do it this way to keep them separate; it makes backups easier too. I will probably ditch proxmox altogether in the future, but I'm fairly new to self hosting so I'm still learning.
    • On the environment variables, thank you for clarifying these points. It might be a good idea in your deployment examples to have a "bare bones" compose.yaml example, for those who only want to install the file server, and leave out additional services like Collabra.
    • I use OC_INSECURE=true because I use Caddy as a reverse proxy with self-signed certificates, I did that based on advise I found here: https://github.com/orgs/opencloud-eu/discussions/727
    • That's also good to know RE:- the errors, I was worried I had messed something up, so I'm glad they're simply debug messages.

    All the best!

  7. robin-thoene commented on Jul 28, 2026

    @robin-thoene

    Hey, I would like to complete this issue. For that I would like to confirm two of my assumptions first:

    1. two of the messages are from the vendored reva dependency. I assume it needs to be fixed in opencloud-eu/reva first and then updated here
    2. the desired new log level debug in all cases
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

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions