I am using my application on an aws server, today I reach the space limit and it showed me the following message /home/ubuntu/.rbenv/libexec/rbenv-init: line 131: cannot create temp file for here-document: No space left on device
, I could increase the storage volume with this video but still cannot display my web page.
by doing the following command nginx -t
It show the following
nginx: [warn] the "user" directive makes sense only if the master process runs with super-user privileges, ignored in /etc/nginx/nginx.conf:1
nginx: [emerg] BIO_new_file("/etc/letsencrypt/live/nace.network/fullchain.pem") failed (SSL: error:0200100D:system library:fopen:Permission denied:fopen('/etc/letsencrypt/live/nace.network/fullchain.pem','r') error:2006D002:BIO routines:BIO_new_file:system lib)
nginx: configuration file /etc/nginx/nginx.conf test failed
my application is developed in ruby on rails 5 with passenger and nginx, previously it worked without any problem but I don't understand why it shows me that error
UPDATE:
I accessed the server again and it continues to send me the following warning:
/home/ubuntu/.rbenv/libexec/rbenv-init: line 131: cannot create temp file for here-document: No space left on device
I execute the following command df -h
and it shows me the following:
Filesystem Size Used Avail Use% Mounted on
udev 2.0G 12K 2.0G 1% /dev
tmpfs 396M 364K 395M 1% /run
/dev/xvda1 26G 15G 9.5G 62% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
none 5.0M 0 5.0M 0% /run/lock
none 2.0G 0 2.0G 0% /run/shm
none 100M 0 100M 0% /run/user
overflow 1.0M 1.0M 0 100% /tmp
and when use tail -f log / production.log
into the project, it shows me the following error:
I, [2020-02-21T18:50:38.283374 #12760] INFO -- : [5636754d-ca36-43f2-afcf-b0a025d3adca] Started GET "/" for 190.198.232.67 at 2020-02-21 18:50:38 +0000
I, [2020-02-21T18:50:38.284158 #12760] INFO -- : [5636754d-ca36-43f2-afcf-b0a025d3adca] Processing by HomeController#index as HTML
D, [2020-02-21T18:50:38.285317 #12760] DEBUG -- : [5636754d-ca36-43f2-afcf-b0a025d3adca] (0.1ms) SELECT COUNT(*) FROM `users`
D, [2020-02-21T18:50:38.355268 #12760] DEBUG -- : [5636754d-ca36-43f2-afcf-b0a025d3adca] (69.4ms) SELECT COUNT(*) AS count_all, `users`.`city` AS users_city FROM `users` GROUP BY `users`.`city`
I, [2020-02-21T18:50:38.355476 #12760] INFO -- : [5636754d-ca36-43f2-afcf-b0a025d3adca] Completed 500 Internal Server Error in 71ms (ActiveRecord: 69.6ms)
F, [2020-02-21T18:50:38.356099 #12760] FATAL -- : [5636754d-ca36-43f2-afcf-b0a025d3adca]
F, [2020-02-21T18:50:38.356136 #12760] FATAL -- : [5636754d-ca36-43f2-afcf-b0a025d3adca] ActiveRecord::StatementInvalid (Mysql2::Error: Error writing file '/tmp/MYkVaUQs' (Errcode: 28 "No space left on device"): SELECT COUNT(*) AS count_all, `users`.`city` AS users_city FROM `users` GROUP BY `users`.`city`):
F, [2020-02-21T18:50:38.356157 #12760] FATAL -- : [5636754d-ca36-43f2-afcf-b0a025d3adca]
F, [2020-02-21T18:50:38.356179 #12760] FATAL -- : [5636754d-ca36-43f2-afcf-b0a025d3adca] app/controllers/home_controller.rb:12:in `index'
UPDATE 2
when executing the command df -hP /tmp
I get this:
Filesystem Size Used Avail Use% Mounted on
overflow 1.0M 108K 916K 11% /tmp
it shows me that temp is a different partition and that it is 1 mb, what I have noticed is that the error appears only in the home where I make a query, I suppose that the data that it brings is larger than 1 mb . I'm looking for what to do to use the root for temporary files instead of the / temp partition but I haven't got the way to do it, according to this page I can disable them here /etc/fstab but I don't see the /temp line in the file, only this:
LABEL=cloudimg-rootfs / ext4 defaults,discard 0 0
/dev/xvdb /mnt auto defaults,nobootwait,comment=cloudconfig 0 2