由于设备空间不足,无法重建 discourse

I get the aforementioned error while attempting to do an operation. I have no idea as to why this is happening.

2 个赞

Did you try just doing a

./docker rebuild app

and seeing what happens? I think git pull is no longer required first.

Otherwise it looks like you may need to review your app.conf file. Have you edited it recently?

1 个赞

No I haven’t edited it recently. The website crashed yesterday and I ran the cleanup and then ran
rm /var/discourse/shared/standalone/backups/default/*
Then I rebuilt using ./launcher rebuild app

The website started working again after that and now it’s back to being dead.

1 个赞

Sorry I meant

./launcher rebuild app

So you are doing the the right things.

1 个赞

Have you had a look at Discourse Doctor?

1 个赞

Okay, so it is a storage issue. How do I make space now? I’m sorry but I’m a beginner.

I just ran discourse-doctor and I was left with multiple lines stating that my storage was full.

1 个赞

Do you have anything else on the server? If not, it’s probably discourse backups that you can delete.

1 个赞

Can you go over the process of deleting backups coz I’ve never really understood the process. I wanna be sure once and for all because I’ve been having storage issues for a really long time.

No, I don’t have anything else on the server.

1 个赞

A good first step is to run

./launcher cleanup 

If that doesn’t work, try

./discourse-doctor

If you still have difficulties, you can look at deleting old backups from

/var/discourse/shared/standalone/backups/default

Let us know how these work out for you!

4 个赞

Hi @seshu_ram

Often, when containers are rebuilt, the process leaves orphan images. If you have rebuilt your container often, these images can take up a lot of space.

In fact, these orphan images recently took up nearly 100 GB + on our server until I deleted them. You can easily check.

Please post the output of:

docker images

Kindly post the output as text (copy-and-paste) using fenced markdown. Terminal screenshot images are hard to read on mobile.

Thanks.

Note:

Please note that launcher cleanup also prunes these orphans (based on 24 hours in the past, I think):

if tty >/dev/null; then
      read -p "Would you like to attempt to recover space by cleaning docker images and containers in the system? (y/N)" -n 1 -r
      echo
      if [[ $REPLY =~ ^[Yy]$ ]]
      then
        $docker_path container prune --force --filter until=1h >/dev/null
        $docker_path image prune --all --force --filter until=1h >/dev/null
        echo "If the cleanup was successful, you may try again now"
      fi
    fi
3 个赞

@neounix

local_discourse/app   latest              674fd54f165f        4 minutes ago       2.5GB
<none>                <none>              f3a4104c3f75        22 hours ago        2.5GB
discourse/base        2.0.20201221-2020   c0704d4ce2b4        11 days ago         2.11GB ```
1 个赞

This worked. My website is live now. Thank you so much. Thanks a lot for your time! That helped a lot.

@tobiaseigen

4 个赞

Hey @seshu_ram

FYI and FWIW: You can remove this orphan image and reclaim a bit more disk space:

 f3a4104c3f75   
docker image rm  f3a4104c3f75  

The launcher cleanup process does not (as I recall) remove images less than 24 hours old.

Or, you can run cleanup again in a few hours, as you please.

5 个赞

我注意到最近的 Discourse 命令行更新占用了相当多的磁盘空间。

root@endoffice-b:/var/discourse# ./launcher cleanup
WARNING! This will remove all stopped containers.
Are you sure you want to continue? [y/N] Y
Total reclaimed space: 0B
WARNING! This will remove all images without at least one container associated to them.
Are you sure you want to continue? [y/N] Y
Deleted Images:
deleted: sha256:284403a252ba061b3ab97f4bfe293ac5e8f05f39ada429d718f58e56191251c2
deleted: sha256:6b6899d54d4dd1f21568956b652975f7c0b9e439978b8cc53036efc46baaf971
untagged: discourse/base:2.0.20211118-0105
untagged: discourse/base@sha256:74b41fffd4f05433eb7c9b72954b1f5f8b15cd0e802bb724c96b7d699c3f6fa1
deleted: sha256:b6cc7cf8974a6ef7bb64c36f4592af261cda0d5565bd91da603568ce26968048
deleted: sha256:c1455b2fdbca024c36c4e75746051b77c3637020cfa1e36a41440292a8c39424
deleted: sha256:77b323d4ec74aad770337f99a60e862a64ccc53f4775b5f4945df0e606f78b90
untagged: discourse/base:2.0.20220128-1817
untagged: discourse/base@sha256:dcb4eb8e41a2e84f776f80587f308d167a54ad7ff4ba616199891828bbd4ddae

Total reclaimed space: 3.54GB

这在两个实例上都发生了,另一个是 3.538GB :wink:

我通常会非常规律地在每次 Discourse 更新后运行 ./launcher cleanup,我大约每个月更新一次,所以这告诉我上次更新 本身 就占用了近 4GB 的磁盘空间。cc @falco @sam 这是我们应该担心的吗?:thinking:

4 个赞

我认为在过去几个月里,我们已经不可避免地两次更新了基础镜像。我们对此无能为力。看起来您服务器上的清理工作减少了 2 个基础镜像。

3 个赞

@anon43908006,有一个指南:

它涵盖了更改域名的许多注意事项,请查看。:slight_smile:

1 个赞

澄清一下,是关于升级总体规模的增加没什么可做的,还是关于最近基础镜像活动激增(未来影响不大)没什么可做的?

我很惊讶,我有很多用户很少的微型 Discourse,最近一直遇到这个问题。没有上传或其他东西。我想知道我们是否即将达到云安装会推荐下一个尺寸的磁盘空间(即 2GB RAM/1vCPU/50GB SSD)的时候? :thinking:

5 个赞

我问了 @falco 关于这个问题,他说最近由于依赖项的更新,我们对基础镜像进行了很多更改,因此在过去约 6 个月的时间里,升级占用的磁盘空间比平时要多。

5 个赞

很抱歉听到您在更改域名时遇到了麻烦,@anon43908006

因为这是#support,我鼓励您创建一个新的主题来解释您的具体情况:您的情况可能需要比这个主题更多的讨论,这个主题更多的是我们注意到的一种普遍模式。

如果您愿意,可以提及我(@maiki),我很乐意与您讨论您的网站情况。:slight_smile:

6 个赞

当我尝试备份 Discourse 时,我遇到了相同的 No space left on device 错误:

[2022-11-15 08:23:38] EXCEPTION: /var/www/discourse/lib/discourse.rb:131:in `exec': Failed to gzip archive.

gzip: /var/www/discourse/public/backups/default/forum-leasehackr-2022-11-15-080439-v20221110175456.tar.gz: No space left on device

我的备份和图片上传都设置在 DigitalOcean 的 Spaces 上,并且在过去几年里一直运行良好,直到最近几个月。以下是我到目前为止尝试过的方法:

  1. 我清除了 DO Space 上所有隐藏的多部分上传。我的 DO Space 应该有超过 100GiB 的可用存储空间。
  2. 我尝试使用以下命令重建和清理:
cd /var/discourse
apt-get update
apt-get upgrade
apt-get autoclean
apt-get autoremove
./launcher rebuild app
./launcher cleanup

有人知道为什么我的备份仍然失败吗?谢谢!