Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Files are not deleted from S3 Bucket after space got deleted #10796

Open
BEBU88 opened this issue Dec 22, 2024 · 1 comment
Open

Files are not deleted from S3 Bucket after space got deleted #10796

BEBU88 opened this issue Dec 22, 2024 · 1 comment
Labels

Comments

@BEBU88
Copy link

BEBU88 commented Dec 22, 2024

Describe the bug

I'm actually testing ocis with S3 storage driver. I created an empty space and then checked the contents at my storage provider. There were several folders and two files created which I would assume are the readme.md and default space picture. I then disabled and deleted the space. I would expect, that the whole folder structure and files are being deleted from the bucket but they remain there.

Steps to reproduce

  1. Spin up an ocis docker container with S3 storage driver
  2. Create an empty space
  3. Disable an delete that space

Expected behavior

All files an folders regarding the space should be deleted from the bucket

Actual behavior

Files remain in the bucket.

Setup

docker-compose.yml

services:
  ocis:
    image: owncloud/ocis-rolling:latest
    networks:
       traefik:
    entrypoint:
      - /bin/sh
    command: [ "-c", "ocis init || true; ocis server" ]
    labels:
      - "traefik.enable=true"
      - "traefik.docker.network=traefik"
      - "traefik.http.services.ocis.loadbalancer.server.port=9200"
      - "traefik.http.routers.ocis.entrypoints=websecure"
      - "traefik.http.routers.ocis.rule=Host(`***`)"
      - "traefik.http.routers.ocis.tls=true"
      - "traefik.http.routers.ocis.tls.certresolver=le_prod"
      - "traefik.http.routers.ocis.middlewares=ocis@file"
      - "traefik.http.middlewares.ocis.headers.contentSecurityPolicy=frame-ancestors https://*.***"
      - "traefik.http.routers.ocis.middlewares=ocis"
    env_file:
      - /mnt/docker/ocis/ocis-config/ocis.env
    volumes:
      - "/mnt/docker/ocis/ocis-config:/etc/ocis/"
      - "/mnt/docker/ocis/ocis-data:/var/lib/ocis"
    #ports:
    #  - 9200:9200
    restart: always 

    logging:
      driver: local
networks:
  traefik:
   external: true  

env-file:

OCIS_URL=https://***
OCIS_LOG_LEVEL=error
OCIS_INSECURE=false
OCIS_OIDC_ISSUER=https://***/realms/***
OCIS_OIDC_CLIENT_ID=ocis-web

STORAGE_USERS_DRIVER=s3ng
STORAGE_USERS_S3NG_ACCESS_KEY=***
STORAGE_USERS_S3NG_SECRET_KEY=***
STORAGE_USERS_S3NG_ENDPOINT=https://nbg1.your-objectstorage.com
STORAGE_USERS_S3NG_BUCKET=***
PROXY_HTTP_ADDR=0.0.0.0:9200
PROXY_TLS=false
PROXY_INSECURE_BACKEND=true
PROXY_OIDC_ACCESS_TOKEN_VERIFY_METHOD=jwt
PROXY_USER_OIDC_CLAIM=preferred_username
PROXY_USER_CS3_CLAIM=username
PROXY_AUTOPROVISION_ACCOUNTS=true
PROXY_ROLE_ASSIGNMENT_DRIVER=oidc
PROXY_ROLE_ASSIGNMENT_OIDC_CLAIM=ocis_role
PROXY_OIDC_REWRITE_WELLKNOWN=true

GRAPH_SPACES_DEFAULT_QUOTA=5000000000

WEB_OIDC_METADATA_URL=https://***/realms/***/.well-known/openid-configuration
WEB_OIDC_POST_LOGOUT_REDIRECT_URI=https://***/realms/***/protocol/openid-connect/logout
WEB_OIDC_SCOPE=openid profile email offline_access
WEB_OPTION_DISABLE_FEEDBACK_LINK=true

I don't get any errors in browser, the space is successfully deleted This is the only thing I can see in the log:

{"level":"debug","time":"2024-12-22T12:36:41Z","message":"space deleted event: {idp:\"https://***/realms/***\" opaque_id:\"64ff26b5-9403-4ba9-af7d-fa5ba051cfb5\" type:USER_TYPE_PRIMARY opaque_id:\"8ef54011-e921-4310-9b12-da60913e1343$2c543d9b-e194-4ad8-9a41-edbad90fcd0a\" Test map[64ff26b5-9403-4ba9-af7d-fa5ba051cfb5:{{{} [] [] <nil>} 0 [] true true true true true true true true true true true true true true true true true true true}] 2024-12-22 12:36:41.096589448 +0000 UTC}"}

@BEBU88
Copy link
Author

BEBU88 commented Dec 24, 2024

Looks like this is also happening with a personal space. After deleting a user in the admin console the files and folders remain in the bucket. Doesn't happen if you move all personal files to trash bin and remove them there. All files and folders regarding the user are deleted from bucket then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant