[LINUX] When I tried to connect with SSH, I got a warning about free space.

Such a warning

When I tried to SSH into the server, I got this warning: I can make an SSH connection, but it feels bad ...

Unable to create temporary file for here document:There is no free space on the device

It seems that there is no free space, so when I checked it with the df command, it was as follows. The usage rate is 100%.

df -h
File system size used Remaining used%Mount position
/dev/mapper/centos-root    14G   14G   36K  100% /

Cause

I hypothesized that the log file was ridiculously sized, probably because I sent a lot of requests in the load test. When I checked the log file, the size is 9GB or more.

-rw-rw-r--1 hoge hoge 8403185664 January 8 01:09 production.log
-rw-rw-r--1 hoge hoge 991581155 January 8 01:58 unicorn.stderr.log

Solution

I copied/dev/null to the log file and emptied the contents of the log file. Now that the warning is gone, it's resolved!

cp /dev/null production.log
-rw-rw-r--1 hoge hoge 0 January 8 09:25 production.log
-rw-rw-r--1 hoge hoge 0 January 8 09:26 unicorn.stderr.log

Supplement

When I checked "Unable to create temporary file for here document: There is no free space on the device", it seems that there are some events that cannot be deployed or compiled. The behavior of the server itself seems to be strange, so some measures are required in advance. (In this case, write a script that automatically deletes old logs, or set the OS or application server to automatically delete logs ...)

Recommended Posts

When I tried to connect with SSH, I got a warning about free space.
A memorandum when I tried to get it automatically with selenium
I tried to implement a blockchain that actually works with about 170 lines
I get a UnicodeDecodeError when trying to connect to oracle with python sqlalchemy
When I tried to make a VPC with AWS CDK but couldn't make it
When I tried to create a virtual environment with Python, it didn't work
When I connect to a remote Jupyter Server with VScode, it's remote but local
When I tried to introduce python3 to atom, I got stuck
I tried to create a table only with Django
I tried to draw a route map with Python
I tried to automatically generate a password with Python3
I got stuck when trying to specify a relative path with relative_to () in python
I tried to implement a volume moving average with Quantx
I got a Value Error when using JUMAN ++ with PyKNP
I tried to automatically create a report with Markov chain
I tried to solve a combination optimization problem with Qiskit
I tried to get started with Hy ・ Define a class
[Python] I tried to visualize tweets about Corona with WordCloud
I stumbled when I tried to install Basemap, so a memorandum
I tried to sort a random FizzBuzz column with bubble sort.
I tried to divide with a deep learning language model
I tried to organize about MCMC.
[3rd] I tried to make a certain authenticator-like tool with python
[Python] A memo that I tried to get started with asyncio
I tried to make a periodical process with Selenium and Python
A note I was addicted to when creating a table with SQLAlchemy
I tried to make a 2channel post notification application with Python
I tried to create Bulls and Cows with a shell program
I tried to make a todo application using bottle with python
[4th] I tried to make a certain authenticator-like tool with python
[1st] I tried to make a certain authenticator-like tool with python
I tried to make a strange quote for Jojo with LSTM
I tried to make a mechanism of exclusive control with Go
A story that didn't work when I tried to log in with the Python requests module
I tried to embed a protein-protein interaction network in hyperbolic space with Poincarē embeding of gensim
I tried to introduce a serverless chatbot linked with Rakuten API to Teams
Python: I tried to make a flat / flat_map just right with a generator
I tried to implement Autoencoder with TensorFlow
I tried to communicate with a remote server by Socket communication with Python.
[Python] When I tried to make a decompression tool with a zip file I just knew, I was addicted to sys.exit ()
I tried to create a linebot (preparation)
I tried to visualize AutoEncoder with TensorFlow
I tried to create a program to convert hexadecimal numbers to decimal numbers with python
I tried to get started with Hy
I tried to create a plug-in with HULFT IoT Edge Streaming [Development] (2/3)
I tried to make a calculator with Tkinter so I will write it
I tried to make "Sakurai-san" a LINE BOT with API Gateway + Lambda
I tried to draw a system configuration diagram with Diagrams on Docker
I tried to make a traffic light-like with Raspberry Pi 4 (Python edition)
I tried a functional language with Python
I tried to create a plug-in with HULFT IoT Edge Streaming [Execution] (3/3)
I tried to discriminate a 6-digit number with a number discrimination application made with python
I tried to implement CVAE with PyTorch
I tried to send a registration completion email from Gmail with django.
A reminder of what I got stuck when starting Atcoder with python
[Outlook] I tried to automatically create a daily report email with Python
I tried to make a Web API
I tried to solve TSP with QAOA
I tried to create a plug-in with HULFT IoT Edge Streaming [Setup] (1/3)
I tried to build a Mac Python development environment with pythonz + direnv
I tried to make a url shortening service serverless with AWS CDK