Skip to content

Fix production boot crash: install libffi8 in Railway runtime image - #1869

Merged
Yanchek99 merged 2 commits into
masterfrom
fix-railway-libffi
Aug 19, 2026
Merged

Fix production boot crash: install libffi8 in Railway runtime image#1869
Yanchek99 merged 2 commits into
masterfrom
fix-railway-libffi

Conversation

@Yanchek99

Copy link
Copy Markdown
Owner

Summary

  • web and worker have been crashing on boot in production since 2026-08-19 02:48 UTC with LoadError: libffi.so.8: cannot open shared object file, originating from the ffi gem's native extension (pulled in transitively via sassc -> sassc-rails, required in config/application.rb).
  • ffi (1.15.5) has been unchanged in Gemfile.lock for a long time and no recent app commit touches it, ruby version, or sassc — the three deploys since the last successful one (2026-08-17 14:40) all fail identically at container start, and a cache-cleared rebuild-from-source reproduces the same failure. This points to a change on Railway's builder (Railpack) side that stopped carrying libffi.so.8 into the runtime image.
  • Railpack auto-detects apt packages for some native gems (pg, mysql2, imagemagick, vips, charlock_holmes) but has no built-in mapping for the ffi gem, so this needs to be declared explicitly.
  • Adds railpack.json declaring libffi8 as an additional deploy.aptPackages entry (extending, not replacing, Railpack's auto-detected list via the "..." syntax), so the runtime image has the shared library the compiled ffi_c.so extension links against.

Test plan

  • Confirm Railway's ephemeral PR environment for this PR builds and boots successfully (web serves requests, worker doesn't crash) instead of hitting the libffi.so.8 LoadError.
  • After merge, confirm production web and worker deploy and start cleanly on Railway.

🤖 Generated with Claude Code

web and worker have been crashing on boot since 2026-08-19 with
LoadError: libffi.so.8: cannot open shared object file, from the ffi
gem's native extension (required transitively via sassc -> sassc-rails).
Railpack doesn't auto-detect libffi as a runtime dependency for Ruby's
ffi gem, and something changed on Railway's builder side that stopped
carrying libffi.so.8 into the deploy image. Explicitly declaring it in
railpack.json's deploy.aptPackages restores it.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@railway-app

railway-app Bot commented Aug 19, 2026

Copy link
Copy Markdown

🚅 Deployed to the wod-tracker-pr-1869 environment in wod-tracker

Service Status Web Updated (UTC)
web ✅ Success (View Logs) Web Aug 19, 2026 at 3:17 pm
worker ✅ Success (View Logs) Aug 19, 2026 at 3:17 pm

@railway-app
railway-app Bot temporarily deployed to wod-tracker / wod-tracker-pr-1869 August 19, 2026 14:51 Destroyed
Explains the ffi -> sassc -> sassc-rails -> rails_admin chain and the
Railpack v0.37.0 Debian 13 migration that dropped libffi.so.8 from the
runtime image, so this doesn't look like an arbitrary apt package pin.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@railway-app
railway-app Bot temporarily deployed to wod-tracker / wod-tracker-pr-1869 August 19, 2026 15:16 Destroyed
@Yanchek99
Yanchek99 merged commit 6283966 into master Aug 19, 2026
8 checks passed
@Yanchek99
Yanchek99 deleted the fix-railway-libffi branch August 19, 2026 15:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant