R
Railway•12mo ago
yrnsmth

LoadError on build

ProjectId: 1e4b0651-0174-42a1-aac8-4081f16bb807 Related to an earlier issue (https://discord.com/channels/713503345364697088/1178533909047291914) It was suggested I add postgres to the nix packages. Now my project is crashing on build, not after publish 😆 . Full error message is:
#16 1.392 LoadError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_ABI_DT_RELR' not found (required by /nix/store/aw2fw9ag10wr9pf0qk4nk5sxi0q0bn56-glibc-2.37-8/lib/libpthread.so.0) - /usr/local/rvm/gems/ruby-3.0.0/gems/pg-1.2.3/lib/pg_ext.so
#16 1.392 LoadError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_ABI_DT_RELR' not found (required by /nix/store/aw2fw9ag10wr9pf0qk4nk5sxi0q0bn56-glibc-2.37-8/lib/libpthread.so.0) - /usr/local/rvm/gems/ruby-3.0.0/gems/pg-1.2.3/lib/pg_ext.so
I have done a bunch of googling and looking in the nixpacks docs - but can't seem to find the answer.. I added glibc to the nixPkgs - but it throws the same error. The specific step this is happening on is building my assets:precompile rake task. This completes successfully if I remove the postgresql nix package. Googling the constant GLIBC_ABI_DT_RELR didn't reveal much - but did bring up the following github issue... which seems tangentally related - though I can't find the nixpkgs-ruby mentioned in the NixOS search - nor nixpkgs-unstable (which sounds lke a bad idea - anyway). So now I'm at a loss again! Full dump in comments.
Solution:
Opening the kimono here, go easy! Here's my nixpacks.toml which works
Jump to solution
21 Replies
Percy
Percy•12mo ago
Project ID: 1e4b0651-0174-42a1-aac8-4081f16bb807
yrnsmth
yrnsmthOP•12mo ago
#16 [stage-0 12/16] RUN bundle exec rake assets:precompile

#16 2.078 rake aborted!

#16 2.078 LoadError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_ABI_DT_RELR' not found (required by /nix/store/aw2fw9ag10wr9pf0qk4nk5sxi0q0bn56-glibc-2.37-8/lib/libpthread.so.0) - /usr/local/rvm/gems/ruby-3.0.0/gems/pg-1.2.3/lib/pg_ext.so

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bootsnap-1.10.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:28:in `require'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bootsnap-1.10.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:28:in `require'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/activesupport-6.1.4.4/lib/active_support/dependencies.rb:332:in `block in require'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/activesupport-6.1.4.4/lib/active_support/dependencies.rb:299:in `load_dependency'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/activesupport-6.1.4.4/lib/active_support/dependencies.rb:332:in `require'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/pg-1.2.3/lib/pg.rb:5:in `<main>'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bootsnap-1.10.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:28:in `require'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bootsnap-1.10.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:28:in `require'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/runtime.rb:66:in `block (2 levels) in require'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/runtime.rb:61:in `each'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/runtime.rb:61:in `block in require'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/runtime.rb:50:in `each'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/runtime.rb:50:in `require'
#16 [stage-0 12/16] RUN bundle exec rake assets:precompile

#16 2.078 rake aborted!

#16 2.078 LoadError: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_ABI_DT_RELR' not found (required by /nix/store/aw2fw9ag10wr9pf0qk4nk5sxi0q0bn56-glibc-2.37-8/lib/libpthread.so.0) - /usr/local/rvm/gems/ruby-3.0.0/gems/pg-1.2.3/lib/pg_ext.so

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bootsnap-1.10.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:28:in `require'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bootsnap-1.10.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:28:in `require'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/activesupport-6.1.4.4/lib/active_support/dependencies.rb:332:in `block in require'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/activesupport-6.1.4.4/lib/active_support/dependencies.rb:299:in `load_dependency'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/activesupport-6.1.4.4/lib/active_support/dependencies.rb:332:in `require'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/pg-1.2.3/lib/pg.rb:5:in `<main>'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bootsnap-1.10.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:28:in `require'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bootsnap-1.10.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:28:in `require'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/runtime.rb:66:in `block (2 levels) in require'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/runtime.rb:61:in `each'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/runtime.rb:61:in `block in require'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/runtime.rb:50:in `each'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/runtime.rb:50:in `require'
#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler.rb:174:in `require'

#16 2.078 /app/config/application.rb:20:in `<top (required)>'

#16 2.078 /app/Rakefile:4:in `require_relative'

#16 2.078 /app/Rakefile:4:in `<top (required)>'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/cli/exec.rb:63:in `load'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/cli/exec.rb:63:in `kernel_load'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/cli/exec.rb:28:in `run'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/cli.rb:497:in `exec'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/cli.rb:30:in `dispatch'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler.rb:174:in `require'

#16 2.078 /app/config/application.rb:20:in `<top (required)>'

#16 2.078 /app/Rakefile:4:in `require_relative'

#16 2.078 /app/Rakefile:4:in `<top (required)>'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/cli/exec.rb:63:in `load'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/cli/exec.rb:63:in `kernel_load'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/cli/exec.rb:28:in `run'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/cli.rb:497:in `exec'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/cli.rb:30:in `dispatch'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/cli.rb:24:in `start'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/exe/bundle:49:in `block in <top (required)>'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/friendly_errors.rb:130:in `with_friendly_errors'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/exe/bundle:37:in `<top (required)>'

#16 2.078 /root/.rbenv/versions/3.0.0/bin/bundle:23:in `load'

#16 2.078 /root/.rbenv/versions/3.0.0/bin/bundle:23:in `<main>'

#16 2.078 (See full trace by running task with --trace)

#16 ERROR: process "/bin/bash -ol pipefail -c bundle exec rake assets:precompile" did not complete successfully: exit code: 1

-----

> [stage-0 12/16] RUN bundle exec rake assets:precompile:

2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'

2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/cli.rb:30:in `dispatch'

2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'

2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/cli.rb:24:in `start'

2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/exe/bundle:49:in `block in <top (required)>'

2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/friendly_errors.rb:130:in `with_friendly_errors'

2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/exe/bundle:37:in `<top (required)>'

2.078 /root/.rbenv/versions/3.0.0/bin/bundle:23:in `load'

2.078 /root/.rbenv/versions/3.0.0/bin/bundle:23:in `<main>'

2.078 (See full trace by running task with --trace)
#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/cli.rb:24:in `start'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/exe/bundle:49:in `block in <top (required)>'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/friendly_errors.rb:130:in `with_friendly_errors'

#16 2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/exe/bundle:37:in `<top (required)>'

#16 2.078 /root/.rbenv/versions/3.0.0/bin/bundle:23:in `load'

#16 2.078 /root/.rbenv/versions/3.0.0/bin/bundle:23:in `<main>'

#16 2.078 (See full trace by running task with --trace)

#16 ERROR: process "/bin/bash -ol pipefail -c bundle exec rake assets:precompile" did not complete successfully: exit code: 1

-----

> [stage-0 12/16] RUN bundle exec rake assets:precompile:

2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'

2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/cli.rb:30:in `dispatch'

2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'

2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/cli.rb:24:in `start'

2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/exe/bundle:49:in `block in <top (required)>'

2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/lib/bundler/friendly_errors.rb:130:in `with_friendly_errors'

2.078 /usr/local/rvm/gems/ruby-3.0.0/gems/bundler-2.2.3/exe/bundle:37:in `<top (required)>'

2.078 /root/.rbenv/versions/3.0.0/bin/bundle:23:in `load'

2.078 /root/.rbenv/versions/3.0.0/bin/bundle:23:in `<main>'

2.078 (See full trace by running task with --trace)
-----

Dockerfile:27

-------------------

25 | # build phase

26 | COPY . /app/.

27 | >>> RUN bundle exec rake assets:precompile

28 | RUN bundle exec bootsnap precompile app/ lib/

29 |

-------------------

ERROR: failed to solve: process "/bin/bash -ol pipefail -c bundle exec rake assets:precompile" did not complete successfully: exit code: 1

Error: Docker build failed
-----

Dockerfile:27

-------------------

25 | # build phase

26 | COPY . /app/.

27 | >>> RUN bundle exec rake assets:precompile

28 | RUN bundle exec bootsnap precompile app/ lib/

29 |

-------------------

ERROR: failed to solve: process "/bin/bash -ol pipefail -c bundle exec rake assets:precompile" did not complete successfully: exit code: 1

Error: Docker build failed
bump 👆
Brody
Brody•12mo ago
don't know why I didn't see this, but please use this https://bookmarklets.up.railway.app/log-downloader/
yrnsmth
yrnsmthOP•12mo ago
Probably because I posted last night (Aussie time) 🙃 Will do!
nickmacavoy
nickmacavoy•12mo ago
I experienced this today too. I had to add a few libraries "manually" rather than through nixpacks:
[phases.postgres]
dependsOn = ['setup']
cmds = [
'''sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' && wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - && sudo apt-get update && sudo apt-get -y --no-install-recommends install libpq-dev postgresql-client-16''',
]
[phases.postgres]
dependsOn = ['setup']
cmds = [
'''sudo sh -c 'echo "deb https://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list' && wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - && sudo apt-get update && sudo apt-get -y --no-install-recommends install libpq-dev postgresql-client-16''',
]
Brody
Brody•12mo ago
you couldnt just do aptPkgs = ['...', 'libpq-dev', 'postgresql-client-16']?
nickmacavoy
nickmacavoy•12mo ago
Nope, had to add the PostgreSQL repo first and couldn't find a way to do that before the build phase note that i'm adding PostgreSQL v16
Brody
Brody•12mo ago
did you get /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_ABI_DT_RELR not found too?
nickmacavoy
nickmacavoy•12mo ago
Yes
Brody
Brody•12mo ago
ruby too?
nickmacavoy
nickmacavoy•12mo ago
Yes
Solution
nickmacavoy
nickmacavoy•12mo ago
Opening the kimono here, go easy! Here's my nixpacks.toml which works
nickmacavoy
nickmacavoy•12mo ago
Actually maybe, I really tried to do this but couldn't find a way to go the repo added first. My nixpacks.toml leaves the postgres apt-get as late as possible for optimal caching (which with Ruby builds isn't all that optimal)
yrnsmth
yrnsmthOP•12mo ago
Sorry for posting so late. My web browser was blockign the script, and luch was finishing up.
yrnsmth
yrnsmthOP•12mo ago
Thanks @nickmacavoy for your experience. How did you 'manually' add this? I'm still unsure how to get into whaever is being spun up.
Brody
Brody•12mo ago
it's a nixpacks.toml file add their nixpacks.toml file to your project and redeploy
yrnsmth
yrnsmthOP•12mo ago
Oops, that'll teach me for skim reading. Sorry, long day. So it's been up for ~20 minutes and hasn't crashed yet. Thanks for your help guys!
Brody
Brody•12mo ago
dont think they mentioned it being a nixpacks.toml file, so all good! happy its fixed now!!
nickmacavoy
nickmacavoy•12mo ago
Great stuff. Though it's worth noting the above is a workaround, it'd be nice to properly implement PostgreSQL using a Nix package for speed and caching. If you're reading this from the future and manage to get it working, please post your findings here!
Brody
Brody•12mo ago
railway maintains nixpacks, though nix packages is not affiliated with railway
yrnsmth
yrnsmthOP•12mo ago
Hi, sorry to resurrect this old discussion! I'm looking to modify my build to spin up a rake task for resque... and I see you have comments about 'custom build.sh' and 'custom start.sh... but I can't find any reference to the actual files... are these the default Railway ones? Part of an apt-pkg being installed? For me to implement myself? I'm not sure how it's even building or starting without these? Sorry for the newbie questions!
Want results from more Discord servers?
Add your server