Error - mkdir: can't create directory '/data/git/': Permission denied #12246

Closed
opened 2025-11-02 10:03:14 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @alvin6233 on GitHub (Dec 21, 2023).

Description

I use helm chart to deploy gitea. Using external pvc(I have created pv/pvc) and setting the ReadWriteMany. But the gitea pod can't be created. Then i find init-container logs and get the following error msg:

(base) ➜  ~ k -n gitea logs  gitea-66fb985648-khrzk  -c init-directories
+ mkdir -p /data/git/.ssh
mkdir: can't create directory '/data/git/': Permission denied

The pod volumes as follows:

Volumes:
  init:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  gitea-init
    Optional:    false
  config:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  gitea
    Optional:    false
  inline-config-sources:
    Type:        Secret (a volume populated by a Secret)
    SecretName:  gitea-inline-config
    Optional:    false
  temp:
    Type:       EmptyDir (a temporary directory that shares a pod's lifetime)
    Medium:     
    SizeLimit:  <unset>
  data:
    Type:       PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
    ClaimName:  gitea-shared-storage
    ReadOnly:   false

Image settings:

image:
  registry: ""
  repository: gitea/gitea
  # Overrides the image tag whose default is the chart appVersion.
  tag: ""
  digest: ""
  pullPolicy: IfNotPresent
  rootless: true
  fullOverride: ""

Gitea helm chart: gitea-10.0.0

Gitea Version

1.21.2

Can you reproduce the bug on the Gitea demo site?

Yes

Log Gist

No response

Screenshots

  • mkdir -p /data/git/.ssh
    mkdir: can't create directory '/data/git/': Permission denied

Git Version

No response

Operating System

No response

How are you running Gitea?

I pull helm chart and use external pvc. my persistence config as follows:
persistence:
enabled: true
create: false
mount: true
claimName: gitea-shared-storage
size: 1000Gi
accessModes:
- ReadWriteMany
labels: {}
storageClass:
subPath:
volumeName: ""
annotations:
helm.sh/resource-policy: keep

Database

None

Originally created by @alvin6233 on GitHub (Dec 21, 2023). ### Description I use helm chart to deploy gitea. Using external pvc(I have created pv/pvc) and setting the ReadWriteMany. But the gitea pod can't be created. Then i find init-container logs and get the following error msg: ``` (base) ➜ ~ k -n gitea logs gitea-66fb985648-khrzk -c init-directories + mkdir -p /data/git/.ssh mkdir: can't create directory '/data/git/': Permission denied ``` The pod volumes as follows: ``` Volumes: init: Type: Secret (a volume populated by a Secret) SecretName: gitea-init Optional: false config: Type: Secret (a volume populated by a Secret) SecretName: gitea Optional: false inline-config-sources: Type: Secret (a volume populated by a Secret) SecretName: gitea-inline-config Optional: false temp: Type: EmptyDir (a temporary directory that shares a pod's lifetime) Medium: SizeLimit: <unset> data: Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace) ClaimName: gitea-shared-storage ReadOnly: false ``` Image settings: ``` image: registry: "" repository: gitea/gitea # Overrides the image tag whose default is the chart appVersion. tag: "" digest: "" pullPolicy: IfNotPresent rootless: true fullOverride: "" ``` Gitea helm chart: gitea-10.0.0 ### Gitea Version 1.21.2 ### Can you reproduce the bug on the Gitea demo site? Yes ### Log Gist _No response_ ### Screenshots + mkdir -p /data/git/.ssh mkdir: can't create directory '/data/git/': Permission denied ### Git Version _No response_ ### Operating System _No response_ ### How are you running Gitea? I pull helm chart and use external pvc. my persistence config as follows: persistence: enabled: true create: false mount: true claimName: gitea-shared-storage size: 1000Gi accessModes: - ReadWriteMany labels: {} storageClass: subPath: volumeName: "" annotations: helm.sh/resource-policy: keep ### Database None
GiteaMirror added the type/bug label 2025-11-02 10:03:14 -06:00
Author
Owner

@joshtrichards commented on GitHub (Dec 31, 2023):

https://gitea.com/gitea/helm-chart/issues/512

@joshtrichards commented on GitHub (Dec 31, 2023): https://gitea.com/gitea/helm-chart/issues/512
Author
Owner

@github-actions[bot] commented on GitHub (Mar 1, 2024):

Automatically locked because of our CONTRIBUTING guidelines

@github-actions[bot] commented on GitHub (Mar 1, 2024): Automatically locked because of our [CONTRIBUTING guidelines](https://github.com/go-gitea/gitea/blob/main/CONTRIBUTING.md#issue-locking)
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#12246