libvips 升级错误

在升级 docker(discourse/discourse)时遇到了问题,从 2026.7.3 升级到 2026.7.4 时出现问题(2026.11.0-latest 版本也有同样的问题):

#<Thread:0x00007f7bea3d8430 /var/www/discourse/lib/discourse.rb:1342 run> terminated with exception (report_on_exception is true):

/var/www/discourse/lib/discourse_vips/client.rb:50:in 'block in DiscourseVips::Client.call': libvips operation failed (DiscourseVips::Error)

	from /var/www/discourse/lib/image_processing/instrumentation.rb:6:in 'ImageProcessing::Instrumentation.instrument'

	from /var/www/discourse/lib/discourse_vips/client.rb:40:in 'DiscourseVips::Client.call'

	from /var/www/discourse/lib/discourse_vips.rb:14:in 'DiscourseVips.version'

	from /var/www/discourse/lib/letter_avatar.rb:140:in 'LetterAvatar.vips_version'

	from /var/www/discourse/lib/letter_avatar.rb:36:in 'LetterAvatar.version'

	from /var/www/discourse/lib/discourse.rb:1343:in 'block in Discourse.preload_rails!'

/var/www/discourse/lib/discourse_vips/client.rb:50:in 'block in DiscourseVips::Client.call': libvips operation failed (DiscourseVips::Error)

	from /var/www/discourse/lib/image_processing/instrumentation.rb:6:in 'ImageProcessing::Instrumentation.instrument'

	from /var/www/discourse/lib/discourse_vips/client.rb:40:in 'DiscourseVips::Client.call'

	from /var/www/discourse/lib/discourse_vips.rb:14:in 'DiscourseVips.version'

	from /var/www/discourse/lib/letter_avatar.rb:140:in 'LetterAvatar.vips_version'

	from /var/www/discourse/lib/letter_avatar.rb:36:in 'LetterAvatar.version'

	from /var/www/discourse/lib/discourse.rb:1343:in 'block in Discourse.preload_rails!'

E, [2026-11-09T11:44:20.275076 #11010] ERROR -- : mold gen=0 pid=11013 reaped (#<Process::Status: pid 11013 exit 1>)

I, [2026-11-09T11:44:20.275357 #11010]  INFO -- : reaped unknown subprocess #<Process::Status: pid 11063 SIGKILL (signal 9)>

/var/www/discourse/vendor/bundle/ruby/4.0.0/gems/pitchfork-0.18.2/lib/pitchfork/http_server.rb:179:in 'Pitchfork::HttpServer#start': The initial mold failed to boot (Pitchfork::BootFailure)

	from /var/www/discourse/vendor/bundle/ruby/4.0.0/gems/pitchfork-0.18.2/exe/pitchfork:110:in '<top (required)>'

	from /usr/local/lib/ruby/4.0.0/rubygems.rb:305:in 'Kernel#load'

	from /usr/local/lib/ruby/4.0.0/rubygems.rb:305:in 'Gem.activate_and_load_bin_path'

	from /var/www/discourse/vendor/bundle/ruby/4.0.0/bin/pitchfork:25:in '<main>'

./config/unicorn_launcher: line 93: kill: (11010) - No such process

./config/unicorn_launcher: line 13: kill: (11010) - No such process

(10949) exiting

请问能否检查一下构建包?

你使用的是标准安装吗?

你好 David,
我使用的是 Docker Hub 上的 version discourse/discourse (discourse/discourse - Docker Image),配合 “redis:7-alpine” 和 “discourse/postgres:latest”。

以下是我当前的配置(使用 docker compose):

services:
  redis:
    image: redis:7-alpine
    container_name: redis
    volumes:
      - /volume1/docker/discourse/redis_data:/data:rw
    ports:
      - '6379:6379'
    command: "redis-server --appendonly yes"
    restart: unless-stopped
    labels:
      - 'wud.tag.include=^([0-9]\d*)\-alpine$$'
      - 'wud.watch.digest=true'
      - 'wud.display.name=DiscourseRedis'
      - 'wud.display.icon=mdi:map-search'

  discourse_db:
    image: discourse/postgres:latest
    container_name: discourse_db
    volumes:
      - /volume1/docker/discourse/discourse_postgres:/var/lib/postgresql:rw
      - /volume1/docker/discourse/discourse_postgres_data:/var/lib/postgresql/data:rw
    environment:
      POSTGRES_DB: discourse
      POSTGRES_USER: admin
      POSTGRES_PASSWORD: "***"
      DB_USER: discourse_user
      DB_PASSWORD: "***"
    restart: unless-stopped
    labels:
      - 'wud.watch.digest=true'
      - 'wud.display.name=DiscoursePostgres'
      - 'wud.display.icon=mdi:map-search'

  discourse:
    image: discourse/discourse:2026.7.3
    container_name: discourse
    depends_on:
      - discourse_db
      - redis
    ports:
      - '8093:80'
    volumes:
      - /volume1/docker/discourse/discourse_data:/shared
    environment:
      DISCOURSE_HOSTNAME: my.host.name
      DISCOURSE_DEVELOPER_EMAILS: "my@email.eu"
      DISCOURSE_DB_HOST: discourse_db
      DISCOURSE_DB_PORT: 5432
      DISCOURSE_DB_NAME: discourse
      DISCOURSE_DB_USERNAME: discourse_user
      DISCOURSE_DB_PASSWORD: "***"
      DISCOURSE_REDIS_HOST: redis
      DISCOURSE_REDIS_PORT: 6379
      DISCOURSE_SMTP_ADDRESS: 10.10.x.x
      DISCOURSE_SMTP_PORT: 587
      DISCOURSE_SMTP_ENABLE_START_TLS: true
      DISCOURSE_SMTP_USER_NAME: my
      DISCOURSE_SMTP_PASSWORD: "****"
      #DISCOURSE_SMTP_FORCE_TLS: true
      DISCOURSE_SMTP_DOMAIN: my.domain
      DISCOURSE_SMTP_AUTHENTICATION: login
      DISCOURSE_SMTP_OPENSSL_VERIFY_MODE: none
      DISCOURSE_NOTIFICATION_EMAIL: noreply@email.eu
      LANG: it_IT.UTF-8
    restart: unless-stopped
    labels:
      - 'wud.tag.include=^([0-9]\d*)\.([0-9]\d*)\.([0-9]\d*)$$'
      - 'wud.watch.digest=true'
      - 'wud.display.name=Discourse'
      - 'wud.display.icon=mdi:map-search'

discourse/discourse 镜像仍属于实验性内容,我们不会对其进行常规测试。不过,我已在内部提及此事,我们将看看是否有人能查看一下。

对于生产环境安装,我们建议使用标准安装流程。

Discourse 无法在非标准端口上运行,并且需要 HTTPS。它不能在 8093 端口上运行。

抱歉,但它一直都能正常工作,因为这只是 Docker 容器的端口映射。此外,SSL 封装由 NGINX 提供,这对 Discourse 来说应该不是问题。

我在 10 月底的发布版本中遇到的错误是由于 libvips 作为图像处理器发生了变化,而不是套接字相关的问题 :thinking:

我刚刚尝试了最新发布的 2026.7.5 版本,但 libvips 错误仍然存在:

#<Thread:0x00007f7ebef58d88 /var/www/discourse/lib/discourse.rb:1309 run> terminated with exception (report_on_exception is true):

/var/www/discourse/lib/discourse_vips/client.rb:50:in 'block in DiscourseVips::Client.call': libvips operation failed: Landlock child setup failed: Landlock::SyscallError: seccomp(SECCOMP_SET_MODE_FILTER) failed: Invalid argument (DiscourseVips::Error)

	from /var/www/discourse/lib/image_processing/instrumentation.rb:6:in 'ImageProcessing::Instrumentation.instrument'

	from /var/www/discourse/lib/discourse_vips/client.rb:40:in 'DiscourseVips::Client.call'

	from /var/www/discourse/lib/discourse_vips.rb:14:in 'DiscourseVips.version'

	from /var/www/discourse/lib/letter_avatar.rb:140:in 'LetterAvatar.vips_version'

	from /var/www/discourse/lib/letter_avatar.rb:36:in 'LetterAvatar.version'

	from /var/www/discourse/lib/discourse.rb:1310:in 'block in Discourse.preload_rails!'

/var/www/discourse/lib/discourse_vips/client.rb:50:in 'block in DiscourseVips::Client.call': libvips operation failed: Landlock child setup failed: Landlock::SyscallError: seccomp(SECCOMP_SET_MODE_FILTER) failed: Invalid argument (DiscourseVips::Error)

	from /var/www/discourse/lib/image_processing/instrumentation.rb:6:in 'ImageProcessing::Instrumentation.instrument'

	from /var/www/discourse/lib/discourse_vips/client.rb:40:in 'DiscourseVips::Client.call'

	from /var/www/discourse/lib/discourse_vips.rb:14:in 'DiscourseVips.version'

	from /var/www/discourse/lib/letter_avatar.rb:140:in 'LetterAvatar.vips_version'

	from /var/www/discourse/lib/letter_avatar.rb:36:in 'LetterAvatar.version'

	from /var/www/discourse/lib/discourse.rb:1310:in 'block in Discourse.preload_rails!'

E, [2026-11-11T09:08:04.096537 #1021] ERROR -- : mold gen=0 pid=1024 reaped (#<Process::Status: pid 1024 exit 1>)

I, [2026-11-11T09:08:04.096668 #1021]  INFO -- : reaped unknown subprocess #<Process::Status: pid 1085 SIGKILL (signal 9)>

/var/www/discourse/vendor/bundle/ruby/4.0.0/gems/pitchfork-0.18.2/lib/pitchfork/http_server.rb:179:in 'Pitchfork::HttpServer#start': The initial mold failed to boot (Pitchfork::BootFailure)

	from /var/www/discourse/vendor/bundle/ruby/4.0.0/gems/pitchfork-0.18.2/exe/pitchfork:110:in '<top (required)>'

	from /usr/local/lib/ruby/4.0.0/rubygems.rb:305:in 'Kernel#load'

	from /usr/local/lib/ruby/4.0.0/rubygems.rb:305:in 'Gem.activate_and_load_bin_path'

	from /var/www/discourse/vendor/bundle/ruby/4.0.0/bin/pitchfork:25:in '<main>'

./config/unicorn_launcher: line 93: kill: (1021) - No such process

./config/unicorn_launcher: line 13: kill: (1021) - No such process

(949) exiting
Landlock::SyscallError: seccomp(SECCOMP_SET_MODE_FILTER) 失败:无效的参数 (DiscourseVips::Error)

你在什么机器上运行 Discourse?它是否拥有最新版本的 Linux 内核?是否有使用特殊的虚拟化技术?

它是一台 Synology NAS,运行 fw DSM 7.4.1-90080 Update 1(当前最新可用版本),像所有 Synology NAS 一样,它基于较旧的内核版本(4.4.302)运行。

这可能是导致问题的原因吗?

旧内核版本意味着您无法运行 “Landlock” 沙箱。但这应该会优雅地降级,并在管理面板中显示一条大幅警告。

这里的问题似乎在于 “seccomp” 保护,我们试图在所有情况下应用它。如果群晖 NAS 内核缺少 seccomp 支持(这听起来很可信),那就能解释失败的原因了。

我们或许能让它更优雅地失败,但这样您论坛的图像处理功能将在完全没有沙箱保护的情况下运行。

因此,无论哪种情况,我都强烈建议您寻找一个更最新、更安全的环境来运行您的论坛,尤其是当它暴露在公共互联网上时。近几个月来,图像处理正日益成为常见的攻击载体,这也是我们添加沙箱的原因。

感谢澄清,我将把论坛主机迁移到一台运行 Proxmox 的小型 PC 上。

谢谢!

在此说明一下,该错误已修复并已向后移植:FIX: Allow startup when image sandboxing is unavailable - Pull Request #46025 - discourse/discourse - GitHub