Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

fossella's avatar

disk space issue with readStream

Thank you in advance for reading. I'm not generally a devops guy so I'm a little out of my depth.

I am trying to do this:

Storage::disk('local')->writeStream(
    $zip_filename,
    Storage::disk('ftp')->readStream('Catalog/' . $zip_filename)
);

but I am getting this error:

  ErrorException 

  fputs(): Write of 28672 bytes failed with errno=28 No space left on device

  at vendor/phpseclib/phpseclib/phpseclib/Net/SFTP.php:2461
    2457▕                             $content .= $temp;
    2458▕                         } elseif (is_callable($local_file)) {
    2459▕                             $local_file($temp);
    2460▕                         } else {
  ➜ 2461▕                             fputs($fp, $temp);
    2462▕                         }
    2463▕                         if (is_callable($progressCallback)) {
    2464▕                             call_user_func($progressCallback, $offset);
    2465▕                         }

      +4 vendor frames 

  5   app/Console/Commands/UpdateCatalog.php:48
      Illuminate\Filesystem\FilesystemAdapter::readStream()
      +13 vendor frames 

  19  artisan:13
      Illuminate\Foundation\Application::handleCommand()

I am not out of space:

Filesystem        Size  Used Avail Use% Mounted on
devtmpfs          4.0M     0  4.0M   0% /dev
tmpfs             951M     0  951M   0% /dev/shm
tmpfs             381M  452K  380M   1% /run
/dev/nvme0n1p1     60G   11G   50G  17% /
tmpfs             951M  488M  464M  52% /tmp
/dev/nvme0n1p128   10M  1.3M  8.7M  13% /boot/efi
tmpfs             191M     0  191M   0% /run/user/1000

and I am not out of inodes

Filesystem         Inodes  IUsed    IFree IUse% Mounted on
devtmpfs           240421    335   240086    1% /dev
tmpfs              243382      1   243381    1% /dev/shm
tmpfs              819200    571   818629    1% /run
/dev/nvme0n1p1   31451120 114643 31336477    1% /
tmpfs             1048576   3308  1045268    1% /tmp
/dev/nvme0n1p128        0      0        0     - /boot/efi
tmpfs               48676     14    48662    1% /run/user/1000

That's the extent of what I know to check. What else should I be looking at to solve this?

0 likes
1 reply
fossella's avatar

Solved! The issue was that /tmp didn't have enough space. Not sure why it needs so much to stream a file, but that was the issue.

Please or to participate in this conversation.