Folder not writable error #14676

Open
opened 2025-11-02 11:19:43 -06:00 by GiteaMirror · 4 comments
Owner

Originally created by @mdziczkowski on GitHub (Jun 29, 2025).

Description

When attempting to startup a fresh gitea like in instruction, I recieve the error that /var/lib/gitea/git folder is not writable (Permission Denied).

It skips the fact that the required folder structure (gitea and gitea/git) may not exist yet and nwwd to be created

Gitea Version

latest docker image

Can you reproduce the bug on the Gitea demo site?

No

Log Gist

No response

Screenshots

Error log:

Starting composer_db_1 ... done
Starting composer_server_1 ... done
Attaching to composer_db_1, composer_server_1
db_1      | 2025-06-29 21:20:49+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 9.3.0-1.el9 started.
db_1      | 2025-06-29 21:20:50+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql'
server_1  | mkdir: can't create directory '/var/lib/gitea/git': Permission denied
server_1  | /var/lib/gitea/git is not writable
db_1      | 2025-06-29 21:20:50+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 9.3.0-1.el9 started.
server_1  | docker setup failed
db_1      | '/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock'
db_1      | 2025-06-29T21:20:50.262240Z 0 [System] [MY-015015] [Server] MySQL Server - start.
db_1      | 2025-06-29T21:20:50.449663Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 9.3.0) starting as process 1
db_1      | 2025-06-29T21:20:50.457782Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
composer_server_1 exited with code 1
db_1      | 2025-06-29T21:20:56.619322Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended.
server_1  | mkdir: can't create directory '/var/lib/gitea/git': Permission denied
server_1  | /var/lib/gitea/git is not writable
server_1  | docker setup failed
[...]
Trunchated due repeative error messages of the "server_1" and "composer_1"

### Git Version

latest docker image

### Operating System

Devuan - based on Debian (bookworm)

### How are you running Gitea?

docker-compose

### Database

MySQL/MariaDB
Originally created by @mdziczkowski on GitHub (Jun 29, 2025). ### Description When attempting to startup a fresh gitea like in instruction, I recieve the error that `/var/lib/gitea/git` folder is not writable (Permission Denied). It skips the fact that the required folder structure (gitea and gitea/git) may not exist yet and nwwd to be created ### Gitea Version latest docker image ### Can you reproduce the bug on the Gitea demo site? No ### Log Gist _No response_ ### Screenshots Error log: ``` Starting composer_db_1 ... done Starting composer_server_1 ... done Attaching to composer_db_1, composer_server_1 db_1 | 2025-06-29 21:20:49+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 9.3.0-1.el9 started. db_1 | 2025-06-29 21:20:50+00:00 [Note] [Entrypoint]: Switching to dedicated user 'mysql' server_1 | mkdir: can't create directory '/var/lib/gitea/git': Permission denied server_1 | /var/lib/gitea/git is not writable db_1 | 2025-06-29 21:20:50+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 9.3.0-1.el9 started. server_1 | docker setup failed db_1 | '/var/lib/mysql/mysql.sock' -> '/var/run/mysqld/mysqld.sock' db_1 | 2025-06-29T21:20:50.262240Z 0 [System] [MY-015015] [Server] MySQL Server - start. db_1 | 2025-06-29T21:20:50.449663Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 9.3.0) starting as process 1 db_1 | 2025-06-29T21:20:50.457782Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started. composer_server_1 exited with code 1 db_1 | 2025-06-29T21:20:56.619322Z 1 [System] [MY-013577] [InnoDB] InnoDB initialization has ended. server_1 | mkdir: can't create directory '/var/lib/gitea/git': Permission denied server_1 | /var/lib/gitea/git is not writable server_1 | docker setup failed [...] Trunchated due repeative error messages of the "server_1" and "composer_1" ### Git Version latest docker image ### Operating System Devuan - based on Debian (bookworm) ### How are you running Gitea? docker-compose ### Database MySQL/MariaDB
GiteaMirror added the type/bug label 2025-11-02 11:19:43 -06:00
Author
Owner

@wxiaoguang commented on GitHub (Jul 1, 2025):

It's caused by the mismatched rootless UID

Broken permissions on rootless docker install #29568

@wxiaoguang commented on GitHub (Jul 1, 2025): It's caused by the mismatched rootless UID Broken permissions on rootless docker install #29568
Author
Owner

@mdziczkowski commented on GitHub (Jul 1, 2025):

It's caused by the mismatched rootless UID

Broken permissions on rootless docker install #29568

any chance it becomes fixed soon?

@mdziczkowski commented on GitHub (Jul 1, 2025): > It's caused by the mismatched rootless UID > > Broken permissions on rootless docker install [#29568](https://github.com/go-gitea/gitea/issues/29568) any chance it becomes fixed soon?
Author
Owner

@lunny commented on GitHub (Jul 1, 2025):

Could you post your compose file?

@lunny commented on GitHub (Jul 1, 2025): Could you post your compose file?
Author
Owner

@mdziczkowski commented on GitHub (Jul 6, 2025):

version: "2"

services:
  server:
    image: docker.gitea.com/gitea:latest-rootless
    restart: unless-stopped

    volumes:
      - ./data:/var/lib/gitea
      - ./config:/etc/gitea
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    ports:
      - "3080:3000"
      - "3022:2222"

However I use command: docker run -itd --name gitea -p 3080:3000 -p 3022:2222 container_id instead

@mdziczkowski commented on GitHub (Jul 6, 2025): ``` version: "2" services: server: image: docker.gitea.com/gitea:latest-rootless restart: unless-stopped volumes: - ./data:/var/lib/gitea - ./config:/etc/gitea - /etc/timezone:/etc/timezone:ro - /etc/localtime:/etc/localtime:ro ports: - "3080:3000" - "3022:2222" ``` However I use command: `docker run -itd --name gitea -p 3080:3000 -p 3022:2222 container_id` instead
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#14676