kubernetes-sigs / kubernetes-sigs/kustomize

Concurrency issues with Helm generator - archive already exists

Open
#5,271 26 comments 17 reactions 0 assignees View on GitHub
area/helm kind/bug triage/under-consideration
Dominant language
Go
Stars
12.2k
Forks
2.4k
Avg merge
2d 14h
Merged PRs (30d)
25

Description

### What happened?

Given the following file structure where the base has a `helmChart` reference:

```
base/kustomization.yaml <-- has a helmChart reference
overlays/overlay1/kustomization.yaml
overlays/overlay2/kustomization.yaml
```

If you run Kustomize on both overlays at the same time, there's a chance one of the 2 commands fail with following error:
```
Error: failed to untar:
a file or directory with the name /tmp/git@gitlab.com_xxxxxx_devops_apps/base/apps/data-query-gateway/charts/k8s-app-1.2.7.tgz already exists:
unable to run: 'helm pull --untar --untardir /tmp/git@gitlab.com_xxxxxx_devops_apps/base/apps/data-query-gateway/charts --repo https://argo:D64mNn3f6ZU77UGm2YWy@gitlab.com/api/v4/projects/29393074/packages/helm/stable k8s-app --version 1.2.7'
with env=[HELM_CONFIG_HOME=/tmp/kustomize-helm-837700893/helm HELM_CACHE_HOME=/tmp/kustomize-helm-837700893/helm/.cache HELM_DATA_HOME=/tmp/kustomize-helm-837700893/helm/.data]
(is 'helm' installed?)
```

See [several users reporting the issue in the context of ArgoCD](https://github.com/argoproj/argo-cd/issues/8008#issuecomment-1682233415) where it's a common setup to have multiple "applications" concurrently synchronizing and if they happen to share same Kustomize base, the error above happens.

### What did you expect to happen?

Ideally, it should be possible to run Kustomize on both overlays without any concurrency issues.

### How can we reproduce it (as minimally and precisely as possible)?

N/A

### Expected output

N/A

### Actual output

N/A

### Kustomize version

5.0.3

### Operating system

Linux

Contributor guide

Open the contributing guide

Research direction

Start by reproducing concurrent Kustomize runs on the two overlays sharing the Helm-based base, then inspect the Helm generator and archive extraction path implicated by the error. Done means both runs complete successfully without an archive-already-exists failure; the issue provides no named files or tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
go, helm
Domain
cli, devops
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.