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

kenprogrammer's avatar

errno=28 No space left on device

This issue keeps recurring causing 500 Server Error: write of 182 bytes failed with errno=28 No space left on device

After following the suggestions given here i.e truncate laravel log file,clear composer cache,clear project cache etc. The app works but after a few days it occurs again.

https://stackoverflow.com/questions/32218398/laravel-5-1-errorexception-in-file-put-contents-error-possibly-out-of-free-di

Hosting Info: Linode VPS 2 CPU Cores 4 GB RAM 80 GB Storage Debian 10

What's the permanent solution?

0 likes
11 replies
alexhackney's avatar

You can also use daily logs and it will rotate them for you and gz them.

Is it the log files though?

Maybe you have another issue?

1 like
Snapey's avatar

first use df command to check free space

If you have no space then you can use du --d 1 to list the disk usage of all the folders in the current directory

However, I think df will show this is not a space issue

1 like
kenprogrammer's avatar

I've realized also composer cache could be the cause of the problem. It affects all the projects hosted on the VPS. After performing composer clear-cache I cannot do composer update or dump-autoload.

I've to : cd bootstrap/cache/ rm -rf *.php

first then composer update and all the projects will be up again. If I do this in the evening,the next morning the problem will occur again. Note: No composer installation or update. Any permanent remedy?

Snapey's avatar

You have not said what df revealed ?

kenprogrammer's avatar

/dev/root 3789264 3584636 0 100% / devtmpfs 1998984 0 1998984 0% /dev tmpfs 2003028 0 2003028 0% /dev/shm tmpfs 2003028 205772 1797256 11% /run tmpfs 5120 0 5120 0% /run/lock tmpfs 2003028 0 2003028 0% /sys/fs/cgroup /dev/loop0 63232 63232 0 100% /snap/core20/1026 /dev/loop2 101760 101760 0 100% /snap/core/11316 /dev/loop3 43392 43392 0 100% /snap/certbot/1280 /dev/loop1 63360 63360 0 100% /snap/core20/1081 /dev/loop6 101888 101888 0 100% /snap/core/11420 /dev/loop5 43520 43520 0 100% /snap/certbot/1343 tmpfs

kenprogrammer's avatar

After performing apt-get clean,autoclean and autoremove

/dev/root 3.7G 3.4G 42M 99% /

Seems there'sn't much those commands can do. A few days ago I had cleared log files in /var/logs

Any suggestions will be highly appreciated.

sayasuhendra's avatar

just empty laravel.log

echo "" > storage/logs/laravel.log

for permanent solutions

Artisan::command('logs:clear', function() {
    
    exec('rm -f ' . storage_path('logs/*.log'));

    exec('rm -f ' . base_path('*.log'));
    
    $this->comment('Logs have been cleared!');
    
})->describe('Clear log files');
kenprogrammer's avatar

@sayasuhendra The issue was disk running out of space. I had resized the disk up but for some weird reasons Linode had failed to effect the changes.

Please or to participate in this conversation.