subuser-security / subuser

Run programs on linux with selectively restricted permissions.
http://subuser.org
GNU Lesser General Public License v3.0
889 stars 65 forks source link

Out of memory error when building images #318

Closed timthelion closed 7 years ago

timthelion commented 7 years ago

While building a subuser image which crashes with:

  File "/home/timothy/pu/projects/subuser/logic/subuserlib/verify.py", line 72, in verify
    subuser.getRunReadyImage().setup()
  File "/home/timothy/pu/projects/subuser/logic/subuserlib/classes/subuserSubmodules/run/runReadyImage.py", line 22, in setup
    self.__id = self.build()
  File "/home/timothy/pu/projects/subuser/logic/subuserlib/classes/subuserSubmodules/run/runReadyImage.py", line 54, in build
    return self.user.dockerDaemon.build(None,quietClient=True,useCache=True,tag=tag,forceRm=True,rm=True,dockerfile=self.generateImagePreparationDockerfile())
  File "/home/timothy/pu/projects/subuser/logic/subuserlib/classes/docker/dockerDaemon.py", line 186, in build
    with tempfile.NamedTemporaryFile() as tmpArchive:
  File "/usr/lib/python3.4/tempfile.py", line 599, in NamedTemporaryFile
    (fd, name) = _mkstemp_inner(dir, prefix, suffix, flags)
  File "/usr/lib/python3.4/tempfile.py", line 339, in _mkstemp_inner
    fd = _os.open(file, flags, 0o600)
OSError: [Errno 28] No space left on device: '/tmp/tmpdra6542u'

This in turn causes Firefox to crash with:

g_dbus_connection_real_closed: Remote peer vanished with error: Underlying GIOStream returned 0 bytes on an async read (g-io-error-quark, 0). Exiting.
firefox: Fatal IO error 11 (Resource temporarily unavailable) on X server unix:100.
timthelion commented 7 years ago
timothy@yoga ~/p/p/tg> df -h
Filesystem      Size  Used Avail Use% Mounted on
/dev/sda2       231G   71G  160G  31% /
udev             10M     0   10M   0% /dev
tmpfs           1.6G   66M  1.5G   5% /run
tmpfs           3.9G   33M  3.9G   1% /dev/shm
tmpfs           5.0M  4.0K  5.0M   1% /run/lock
tmpfs           3.9G     0  3.9G   0% /sys/fs/cgroup
/dev/sda1       511M  648K  511M   1% /boot/efi
tmpfs           791M  4.0K  791M   1% /run/user/116
tmpfs           791M   12K  791M   1% /run/user/1000

But I'm also getting errors like:

000265.log: no space left on device providers.go:258
11:07:33.115 ERROR  providers: error adding new providers: write /home/timothy/.ipfs/datastore/000265.log: no space left on device providers.go:258
11:07:33.286 ERROR  providers: error adding new providers: write /home/timothy/.ipfs/datastore/000265.log: no space left on device providers.go:258
11:07:33.286 ERROR  providers: error adding new providers: write /home/timothy/.ipfs/datastore/000265.log: no space left on device providers.go:258
11:07:33.566 ERROR  providers: error adding new providers: write /home/timothy/.ipfs/datastore/000265.log: no space left on device providers.go:258

Very confusing...

timthelion commented 7 years ago

I think that this is a kernel bug and not subuser's fault, even though it seems to be triggered by Docker's build process.

timthelion commented 7 years ago

Again I find myself on the btrfs wiki: https://btrfs.wiki.kernel.org/index.php/Problem_FAQ#I_get_.22No_space_left_on_device.22_errors.2C_but_df_says_I.27ve_got_lots_of_space a pleasant reminder that I've been here before and for some reason am still using btrfs, despite the fact that other file systems such as ext3 have never sent me on a trip to THEIR wikis.

Not that I could do better myself. I'm sure that subuser has some version compatibility bugs and other edge cases :P