Is there a common cause for "bwrap: Can't find source path ...: Permission denied" errors?

Sorry, I hope this question isn’t too off-topic:

I’m currently trying to set up a new runtime with flatpak-builder based on the KDE Sdk for a component that doesn’t support install inside an /app prefix folder.

As a test, I’m using the “simple” build system, but even a trivial build command like bash -c ‘echo test’ gives this error once I run flatpak-builder:

bwrap: Can’t find source path /run/user/1000/.flatpak/3447251370: Permission denied

Is there some common reason or cause for such errors? I’m guessing I messed up a basic step and there is an obvious trigger for this.

I tested this now with the FFmpeg example from a random flatpak tutorial I found and I’m seeing the same error:

# cat org.linuxconfig.FFmpeg.yml 

app-id: org.linuxconfig.FFmpeg
runtime: org.freedesktop.Platform
runtime-version: '21.08'
sdk: org.freedesktop.Sdk
modules:
  - name: ffmpeg
    sources:
      - type: archive
        url: https://www.ffmpeg.org/releases/ffmpeg-4.4.1.tar.xz
        sha256: eadbad9e9ab30b25f5520fbfde99fae4a92a1ae3c0257a8d68569a4651e30e02
    config-opts:
      - --enable-gpl
      - --enable-libmp3lame
      - --enable-libopus
      - --enable-libvpx
      - --enable-libx264
      - --disable-static
      - --enable-shared
      - --disable-doc

# flatpak-builder  build ./org.linuxconfig.FFmpe
g.yml 
Downloading sources
Starting build of org.linuxconfig.FFmpeg
Cache miss, checking out last cache hit
========================================================================
Building module ffmpeg in /home/ellie/Develop/flatpaktest/.flatpak-builder/build/ffmpeg-3
========================================================================
bwrap: Can't find source path /run/user/10000/.flatpak/981349234: Permission denied
Error: module ffmpeg: Child process exited with code 1

Is this a flatpak bug?

Can’t say much about it - some people have similar issues when running flatpak applications.

Could you provide more information about your system? Distribution, version of flatpak & flatpak-builder? Which filesystem are you using? Maybe run flatpak-builder with -vor even -vv to provide more logs.

1 Like

The same happenned to me on Ubuntu 25.04, freshly installed package:

flatpak run org.gnome.World.PikaBackup                                                                                                      
bwrap: Can't find source path /run/user/1000/doc/by-app/org.gnome.World.PikaBackup: Permission denied


systemctl --user restart xdg-document-portal.service - helped

I’ve seen this both on postmarketOS Edge and Ubuntu, too. Is this a flatpak bug then?

I can install and run flatpaks fine, I just can’t build any since flatpak-builder gives me that error.