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

Phew_34's avatar

Consistent Session Saving Errors

Hi there

Getting really frustrated with out first laravel App, thought we had fixed an issue with the file system being overrun by sessions but its happened again causing fatal errors but this time with the file system NOT being full in linux.

This is the error: 'file_put_contents(/server-path-to-app/storage/framework/sessions/RmbdAQzqgZcTx4p2kBdiIKBZQsezYnsDShN0X94H): Failed to open stream: No space left on device'

ln 187 of: vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php return file_put_contents($path, $contents, $lock ? LOCK_EX : 0);

That directory had 777 files in it (https://i.imgur.com/v72ROB0.jpg). When you delete them the error goes, when it get back to exactly 777 files.... error again.

and we do need somewhere in the region of that many active sessions, i cannot see what the issue now it as before it was reaching the actual linux cap of 268,000 which was a issue on our part but 777!? why on earth is it now doing it on 777?

0 likes
8 replies
theProfit's avatar

In the error i see “ No space left on device“ please check the disk space.

Snapey's avatar

not knowing your level of experience... 777 seems incredibly like the directory permissions. are you sure you are reading the ls command correctly

what do you get from du command?

Phew_34's avatar

Server has lots of disk space so its not that.

Yea i thought it was really weird that that the number of files matched chmod numbers. But it IS 777 files (e.g. session files) and it starts to throw this error.

du -h is 1.2G

Lion share is:

446M ./.cache/composer/repo/https---repo.packagist.org 446M ./.cache/composer/repo 460M ./.cache/composer 460M ./.cache 28K ./bootstrap/cache 36K ./bootstrap 76K ./config 1.2G .

Server has 23GB 14 used by OS 1.2 here

So loads of space.

Phew_34's avatar

Right decided to download several of the session files prefix them with NEW- and re-upload and getting an FTP error!

Command: STOR NEW-m2egQHgFqZFoD8WO4Foj36H1zu1iySw7KD07zTWw Response: 550 NEW-m2egQHgFqZFoD8WO4Foj36H1zu1iySw7KD07zTWw: No space left on device Error: Critical file transfer error

So looks server related afterall?

Phew_34's avatar

Well: df -i

/dev/mapper/ubuntu--vg-root 1572864 1572834 30 100% /

The entire server has run out of inodes! that explains it. Somewhere there is probably millions of 0 byte files. I wonder if the fact we run 5min cron jobs is doing this. Think it must be in-part related to the laravel app but not something we can control.

our server people are locating where the junk files are.

Phew_34's avatar

Server hosters - 'oh, kopia chache was set to 10GB' - millions of files.

No issue with laravel!

Please or to participate in this conversation.