Skip to content

fix: PUID=0 PGID=0 handling#420

Draft
LorenzoCattai wants to merge 1 commit intorishikanthc:mainfrom
LorenzoCattai:fix/PUID=0-PGID=0-handling
Draft

fix: PUID=0 PGID=0 handling#420
LorenzoCattai wants to merge 1 commit intorishikanthc:mainfrom
LorenzoCattai:fix/PUID=0-PGID=0-handling

Conversation

@LorenzoCattai
Copy link
Copy Markdown

@LorenzoCattai LorenzoCattai commented Mar 9, 2026

Fixes #419.

This is a basic fix to properly handle running the main scriberr app as UID 0 and GID 0 inside the container, see #419 for more details.

To test this PR you can clone this branch with:
git clone --single-branch --branch fix/PUID=0-PGID=0-handling https://github.com/LorenzoCattai/Scriberr.git scriberr-fix_PUID=0-GUID=0-handling
and then in the same directory where you cloned this branch make and use (with rootless docker setup) this docker compose file:
docker-compose.yaml

name: scriberr
services:
  scriberr:
    container_name: scriberr
    image: ghcr.io/rishikanthc/scriberr:v1.2.0
    ports:
      - "8080:8080"
    volumes:
      - ./scriberr-data:/app/data # bind mount for generic scriberr data
      - ./python-environments-and-models-data:/app/whisperx-env # bind mount for models and python envs
      - ./scriberr-fix_PUID=0-GUID=0-handling/docker-entrypoint.sh:/usr/local/bin/docker-entrypoint.sh # DEBUG bind mount for injecting patched file into the container
    environment:
      - PUID=0
      - PGID=0
      - APP_ENV=production # DO NOT CHANGE THIS
      # CORS: comma-separated list of allowed origins for production
      # - ALLOWED_ORIGINS=https://your-domain.com
      # - SECURE_COOKIES=false # Uncomment this ONLY if you are not using SSL
    restart: unless-stopped

@LorenzoCattai
Copy link
Copy Markdown
Author

LorenzoCattai commented Mar 9, 2026

This is still a draft, input is very much appreciated, right now I just added a few lines to docker-entrypoint.sh to handle this scenario, although it could be handled better.

Right now even if the user sets the env variable PUID to 0, setup_user is still called just to create a possible GUID that does not exist yet, appuser is not actually used on the exec part of the script, this should work fine but there is probably a better way to do this with some restructuring of docker-entrypoint.sh.

@LorenzoCattai
Copy link
Copy Markdown
Author

I'm currently waiting for the container to finish setting up to see if this works properly all the way through.

@LorenzoCattai LorenzoCattai force-pushed the fix/PUID=0-PGID=0-handling branch from c0ff571 to 0a8cafb Compare March 9, 2026 14:02
@LorenzoCattai
Copy link
Copy Markdown
Author

LorenzoCattai commented Mar 10, 2026

A test video file I uploaded was succesfully processed but when opening it I am getting error:

2026/03/10 17:02:29 /src/internal/repository/implementations.go:353 record not found
[0.232ms] [rows:0] SELECT * FROM `summaries` WHERE transcription_id = "7cfc64bf-a9ef-41c3-8d15-8a8bd6642c93" ORDER BY created_at DESC,`summaries`.`id` LIMIT 1

the web app shows:

Unable to load audio stream.

and is not loading the audio stream, the transcribed audio, speakers and timestamps are properly shown tho.

The audio file does exist in the fs tho:
$ tree

.
├── jwt_secret
├── scriberr.db
├── scriberr.db-shm
├── scriberr.db-wal
├── temp
│   └── whisperx
├── transcripts
│   └── 7cfc64bf-a9ef-41c3-8d15-8a8bd6642c93
│       └── transcription.log
└── uploads
    ├── 7cfc64bf-a9ef-41c3-8d15-8a8bd6642c93.mp3
    └── quick_transcriptions

$ file uploads/7cfc64bf-a9ef-41c3-8d15-8a8bd6642c93.mp3

uploads/7cfc64bf-a9ef-41c3-8d15-8a8bd6642c93.mp3: Audio file with ID3 version 2.4.0, contains: MPEG ADTS, layer III, v1, 64 kbps, 44.1 kHz, Stereo

Also, the ownership and permission of the directories and files is correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

"failed to connect to database" when running in Rootless Docker with PUID=0 and PGID=0

1 participant