Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

securerandom.rb:75:in `urandom': failed to get urandom (RuntimeError) #1312

Closed
dblock opened this issue Jun 13, 2022 · 2 comments
Closed

securerandom.rb:75:in `urandom': failed to get urandom (RuntimeError) #1312

dblock opened this issue Jun 13, 2022 · 2 comments

Comments

@dblock
Copy link

dblock commented Jun 13, 2022

I am using dokku, which uses herokuish, which uses heroku-buildpack-ruby (v240). I did a dokku upgrade via apt (Ubuntu, dokku version 0.19.12) and all my deploys fail with this:

-----> Ruby app detected
remote: /tmp/tmp.QJdgokaA3p/lib/ruby/3.1.0/securerandom.rb:75:in `urandom': failed to get urandom (RuntimeError)
remote: 	from /tmp/tmp.QJdgokaA3p/lib/ruby/3.1.0/securerandom.rb:75:in `singleton class'
remote: 	from /tmp/tmp.QJdgokaA3p/lib/ruby/3.1.0/securerandom.rb:42:in `<module:SecureRandom>'
remote: 	from /tmp/tmp.QJdgokaA3p/lib/ruby/3.1.0/securerandom.rb:41:in `<top (required)>'
remote: 	from <internal:/tmp/tmp.QJdgokaA3p/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
remote: 	from <internal:/tmp/tmp.QJdgokaA3p/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
remote: 	from /tmp/buildpacks/01_buildpack-ruby/lib/language_pack/rails41.rb:1:in `<top (required)>'
remote: 	from <internal:/tmp/tmp.QJdgokaA3p/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
remote: 	from <internal:/tmp/tmp.QJdgokaA3p/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
remote: 	from /tmp/buildpacks/01_buildpack-ruby/lib/language_pack.rb:44:in `<top (required)>'
remote: 	from <internal:/tmp/tmp.QJdgokaA3p/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
remote: 	from <internal:/tmp/tmp.QJdgokaA3p/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
remote: 	from /tmp/buildpacks/01_buildpack-ruby/bin/support/ruby_compile:11:in `<main>'
remote: 2022/06/12 22:02:56 exit status 1 

It also fails to ps:rebuild, but doesn’t output an error.

Setup:

Linux dblock-plum 3.13.0-71-generic #114-Ubuntu SMP Tue Dec 1 02:34:22 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
# docker version
Client:
 Version:      17.05.0-ce
 API version:  1.29
 Go version:   go1.7.5
 Git commit:   89658be
 Built:        Thu May  4 22:06:06 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.05.0-ce
 API version:  1.29 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   89658be
 Built:        Thu May  4 22:06:06 2017
 OS/Arch:      linux/amd64
 Experimental: false
# docker run -ti gliderlabs/herokuish:latest herokuish version
herokuish: 0.5.36
buildpacks:
  heroku-buildpack-multi     v1.2.0
  heroku-buildpack-ruby      v240
  heroku-buildpack-nodejs    v196
  heroku-buildpack-clojure   v87
  heroku-buildpack-python    v211
  heroku-buildpack-java      v70
  heroku-buildpack-gradle    v36
  heroku-buildpack-scala     v92
  heroku-buildpack-play      v26
  heroku-buildpack-php       v218
  heroku-buildpack-go        v162
  heroku-buildpack-nginx     v16
  buildpack-null             v3

I'm stuck. Ruby 3.1.0 works fine on the machine, including SecureRandom.hex and SecureRandom.bytes(n).

I don't know how to downgrade the buildpack to see in which version this started happening, would be willing to try.

Update: I downgraded herokuish with sudo apt install herokuish=0.5.34 which used heroku-buildpack-ruby v236 and the problem went away. Hope this helps narrow it down.

@edmorley
Copy link
Member

edmorley commented Jun 13, 2022

Searching I came across solectrus/hosting/issues/4 which suggests this might be related to ulimits or old kernel versions?

Also Docker 17.05.0-ce is very old - have you tried newer? Even Ubuntu's own APT-provided Docker are all newer than this :-)

@edmorley
Copy link
Member

Closing since this seems like an issue with the machine Dokku is being run on.

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

No branches or pull requests

2 participants