owncloud / owncloud/ocis

Files are not deleted from S3 Bucket after space got deleted

Open
#10,796 2 comments 0 reactions 0 assignees View on GitHub
Type:Bug
Dominant language
Go
Stars
2.1k
Forks
274
Avg merge
2d 1h
Merged PRs (30d)
103

Description

## 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:{{{} [] [] } 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}"}`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.