<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>301098</bug_id>
          
          <creation_ts>2025-10-20 08:51:12 -0700</creation_ts>
          <short_desc>[GTK][WPE] bwrapinfo.json file leaks</short_desc>
          <delta_ts>2026-01-20 09:50:44 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=238403</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Carlos Alberto Lopez Perez">clopez</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>pgriffis</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2152584</commentid>
    <comment_count>0</comment_count>
    <who name="Carlos Alberto Lopez Perez">clopez</who>
    <bug_when>2025-10-20 08:51:12 -0700</bug_when>
    <thetext>Each time the browser is started it is leaking bwrapinfo.json files at ${XDG_RUNTIME_DIR}/.flatpak/webkit-${PID}-${ID}

And this can be an issue that can cause ${XDG_RUNTIME_DIR} to become full

This is causing issues for example, on the RPi4 boards running the WPE performance bot CI. 
See:

https://build.webkit.org/#/builders/895/builds/20515
** (MiniBrowser:3724721): WARNING **: 07:59:25.587: Failed to create &apos;/run/user/1906/.flatpak/webkit-3724721-4&apos;: No space left on device
** (MiniBrowser:3724721): WARNING **: 07:59:25.587: Failed to make socket file /run/user/1906/wpe/bus-proxy-4BU1E3 for dbus proxy: No space left on device
** (MiniBrowser:3724721): WARNING **: 07:59:25.588: Failed to make socket file /run/user/1906/wpe/a11y-proxy-S0T1E3 for dbus proxy: No space left on device
** (WPEWebProcess:2): WARNING **: 07:59:26.014: Can&apos;t connect to a11y bus: Could not connect: No such file or directory
** (MiniBrowser:3724721): WARNING **: 07:59:26.043: Failed to create &apos;/run/user/1906/.flatpak/webkit-3724721-5&apos;: No space left on device


A manual inspect via ssh shows thousands of this files that end adding and consuming all the space available there (380M)

bb-wpe-rpi4-perf6-64 ~ # du -hs /run/user/1906/.flatpak
189M	/run/user/1906/.flatpak

bb-wpe-rpi4-perf6-64 ~ # df -h /run/user/1906/.flatpak
Filesystem      Size  Used Avail Use% Mounted on
tmpfs           380M  189M  191M  50% /run/user/1906

bb-wpe-rpi4-perf6-64 ~ # find /run/user/1906/.flatpak -type f -name bwrapinfo.json|wc -l
48162</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2152585</commentid>
    <comment_count>1</comment_count>
    <who name="Carlos Alberto Lopez Perez">clopez</who>
    <bug_when>2025-10-20 08:52:09 -0700</bug_when>
    <thetext>273334@main added the code to create this bwrapinfo.json files</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2153018</commentid>
    <comment_count>2</comment_count>
    <who name="Patrick Griffis">pgriffis</who>
    <bug_when>2025-10-21 10:11:57 -0700</bug_when>
    <thetext>It looks like Flatpak has a lot of logic to deal with this: https://github.com/flatpak/flatpak/blob/main/common/flatpak-instance.c

It involves locking the file at various points, and a garbage collection step.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2160601</commentid>
    <comment_count>3</comment_count>
    <who name="Carlos Alberto Lopez Perez">clopez</who>
    <bug_when>2025-11-21 09:17:52 -0800</bug_when>
    <thetext>Does it make sense that we create this files if WebKit is not running inside flatpak?
I understand that this is for xdg-desktop-portal, but xdg-desktop-portal is only relevant when running inside flatkpak, isn&apos;t it?

So.. can we at least check if we are running inside flatpak, and if not avoid creating this files?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2173364</commentid>
    <comment_count>4</comment_count>
    <who name="Carlos Alberto Lopez Perez">clopez</who>
    <bug_when>2026-01-20 09:50:44 -0800</bug_when>
    <thetext>This continue to be an issue. I&apos;m workaround-ing the problem by deploying a systemd timer on the bots to clean this files daily</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>