【发布时间】:2020-06-06 03:16:32
【问题描述】:
我在 aws 服务器上使用我的应用程序,今天我达到了空间限制,它向我显示了以下消息 /home/ubuntu/.rbenv/libexec/rbenv-init: line 131: cannot create temp file for here-document: No space left on device ,我可以使用此 video 增加存储量,但仍然无法显示我的网页。
通过执行以下命令nginx -t 它显示以下内容
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
我的应用程序是在 ruby on rails 5 中使用乘客和 Nginx 开发的,以前它可以正常工作,但我不明白为什么它显示错误
更新:
我再次访问服务器,它继续向我发送以下警告:
/home/ubuntu/.rbenv/libexec/rbenv-init: line 131: cannot create temp file for here-document: No space left on device
我执行以下命令 df -h 并显示以下内容:
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
当在项目中使用tail -f log / production.log 时,它向我显示以下错误:
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'
更新 2
当执行命令df -hP /tmp 时,我明白了:
Filesystem Size Used Avail Use% Mounted on
overflow 1.0M 108K 916K 11% /tmp
它告诉我 temp 是一个不同的分区,它是 1 mb,我注意到错误只出现在我进行查询的家中,我想它带来的数据大于 1 mb。我正在寻找如何将根用于临时文件而不是 / temp 分区,但我没有办法做到这一点,根据this 页面我可以在这里禁用它们 /etc/fstab 但我在文件中看不到 /temp 行,只有这个:
LABEL=cloudimg-rootfs / ext4 defaults,discard 0 0
/dev/xvdb /mnt auto defaults,nobootwait,comment=cloudconfig 0 2
【问题讨论】:
标签: ruby-on-rails amazon-web-services nginx amazon-ec2 lets-encrypt