Skip to content

[S3] artgc Artifact Garbage Collect cannot delete directories #14565

@antoinetran

Description

@antoinetran

Pre-requisites

  • I have double-checked my configuration
  • I have tested with the :latest image tag (i.e. quay.io/argoproj/workflow-controller:latest) and can confirm the issue still exists on :latest. If not, I have explained why, in detail, in my description below.
  • I have searched existing issues and could not find a match for this bug
  • I'd like to contribute the fix myself (see contributing guide)

What happened? What did you expect to happen?

When uploading a directory to a S3 bucket, it is successful. When the workflow is deleted, the artgc pod tries to remove the directory but can't. It can only deletes list of files.

Version(s)

v3.6.7

Paste a minimal workflow that reproduces the issue. We must be able to run the workflow; don't enter a workflow that uses private images.

metadata:
  name: testtodel-template
  generateName: testtodel-
  namespace: argo-workflows
spec:
  entrypoint: init-pipeline
  templates:
    - name: init-pipeline
      steps:
        - - name: upload-file-test
            template: upload-file
        - - name: upload-directory-test
            template: upload-directory

    - name: upload-file
      outputs:
        artifacts:
          - name: file_to_localstorage
            path: "/tmp/not_a_directory"
            archive:
              # Avoid having tgz file.
              none: {}
            s3:
              key: "{{workflow.name}}/not_a_directory"
      script:
        image: "bash:3.1.23-alpine3.21"
        command: ["bash"]
        source: |
          set -x
          id
          date -Is --utc
          echo 123 >/tmp/not_a_directory
        resources:
          requests:
            memory: "50Mi"
            cpu: "50m"
          limits:
            memory: "50Mi"
            cpu: "50m"

    - name: upload-directory
      outputs:
        artifacts:
          - name: file_to_localstorage
            path: "/tmp/directory"
            archive:
              # Avoid having tgz file.
              none: {}
            s3:
              key: "{{workflow.name}}/directory"
      script:
        image: "bash:3.1.23-alpine3.21"
        command: ["bash"]
        source: |
          set -x
          id
          date -Is --utc
          mkdir /tmp/directory
          echo 123 >/tmp/directory/onefile
        resources:
          requests:
            memory: "50Mi"
            cpu: "50m"
          limits:
            memory: "50Mi"
            cpu: "50m"

Logs from the workflow controller

not relevant

Logs from in your workflow's wait container

not relevant

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/artifactsS3/GCP/OSS/Git/HDFS etcsolution/workaroundThere's a workaround, might not be great, but exists

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions