0

My application is showing error:

Magento 2.2.2 - Warning: SessionHandler::read() No space left on device (28) in /var/www/html/vendor/magento/framework/Session/SaveHandler/Native.php on line 22

I searched for information and many of them said it was lacking server space, but my server has 3GB of space.

enter image description here

Memory and CPU usage information also appears to be normal

enter image description here

But when I execute:

bin/magento cache:clear

everything returns to normal and my application works again.

Magento is running on an AWS EC2 T2.Medium 16GB disk drive and 4GB RAM.

Folders and files are set according to Magento documentation:

sudo find var generated vendor pub/static pub/media app/etc -type f -exec chmod g+w {} + && sudo find var generated vendor pub/static pub/media app/etc -type d -exec chmod g+ws {} + && sudo chown -R :apache . && sudo chmod u+x bin/magento
9
  • Can you run df command before and after cleaning the cache Apr 12, 2019 at 11:17
  • @RajMohanR Running cache: clear changed from 3.4GB to 3.5GB Apr 12, 2019 at 11:25
  • @DiegoQueiroz your issue is your server is running out of space, once the cache is set its unable write anything else hence when you clear the cache it goes away. your deleteing files which is freeing up space on the device but the moment you go back to the site you are filling that cache folder back up Apr 12, 2019 at 11:38
  • @DavaGordon but my server has 3.5GB of free disk space. Apr 12, 2019 at 11:58
  • @DiegoQueiroz that may be but when your server performs certain tasks it used additional space to run processes in the background it may only use them temporary but going off your error i can confirm your server does not have enough space to run its tasks to confirm this i would suggest updating your stroage to 20GB and seeing if the issue persists Apr 12, 2019 at 12:01

2 Answers 2

3

This is a storage issue, as per my earlier suggestion. recommendation for this is/was to update storage from 16gb to 20gb if anyone else has this issue i suggest this is the first place you look .

Why this happen even after space on the server:

when your server performs certain tasks it used additional space to run processes in the background it may only use them temporarily but going off your error so the server does not have enough space to run its tasks.

0

This happens when your PHP session.save_handler parameter is set to some session storage other than a file. You can edit env.php to fix error. Find the file env.php under the path app/etc. Then replace the following code:

'session' => [
    'save' => 'files'
],

Edit to the following code:

'session' => [
    'save' => 'db'
],

save and reload the website the problem will be fixed.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.