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

Runtime issue on Synology #67

Closed
jeremymeyers opened this issue Feb 25, 2023 · 9 comments
Closed

Runtime issue on Synology #67

jeremymeyers opened this issue Feb 25, 2023 · 9 comments

Comments

@jeremymeyers
Copy link

jeremymeyers commented Feb 25, 2023

When trying to run the Docker version, it throws the following error:

rssbox
date,stream,content
2023-02-25 15:21:22,stdout,	from /usr/local/ruby/bin/bundle:25:in `<main>'
2023-02-25 15:21:22,stdout,	from /usr/local/ruby/bin/bundle:25:in `load'
2023-02-25 15:21:22,stdout,	from /usr/local/ruby/lib/ruby/gems/3.2.0/gems/bundler-2.4.3/exe/bundle:33:in `<top (required)>'
2023-02-25 15:21:22,stdout,	from /usr/local/ruby/lib/ruby/site_ruby/3.2.0/bundler/friendly_errors.rb:117:in `with_friendly_errors'
2023-02-25 15:21:22,stdout,	from /usr/local/ruby/lib/ruby/gems/3.2.0/gems/bundler-2.4.3/exe/bundle:45:in `block in <top required)>'
2023-02-25 15:21:22,stdout,	from /usr/local/ruby/lib/ruby/site_ruby/3.2.0/bundler/cli.rb:28:in `start'
2023-02-25 15:21:22,stdout,	from /usr/local/ruby/lib/ruby/site_ruby/3.2.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
2023-02-25 15:21:22,stdout,	from /usr/local/ruby/lib/ruby/site_ruby/3.2.0/bundler/cli.rb:34:in `dispatch'
2023-02-25 15:21:22,stdout,	from /usr/local/ruby/lib/ruby/site_ruby/3.2.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
2023-02-25 15:21:22,stdout,	from /usr/local/ruby/lib/ruby/site_ruby/3.2.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
2023-02-25 15:21:22,stdout,	from /usr/local/ruby/lib/ruby/site_ruby/3.2.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
2023-02-25 15:21:22,stdout,	from /usr/local/ruby/lib/ruby/site_ruby/3.2.0/bundler/cli.rb:491:in `exec'
2023-02-25 15:21:22,stdout,	from /usr/local/ruby/lib/ruby/site_ruby/3.2.0/bundler/cli/exec.rb:23:in `run'
2023-02-25 15:21:22,stdout,	from /usr/local/ruby/lib/ruby/site_ruby/3.2.0/bundler/cli/exec.rb:58:in `kernel_load'
2023-02-25 15:21:22,stdout,	from /usr/local/ruby/lib/ruby/site_ruby/3.2.0/bundler/cli/exec.rb:58:in `load'
2023-02-25 15:21:22,stdout,	from /app/vendor/bundle/ruby/3.2.0/bin/puma:25:in `<top (required)>'
2023-02-25 15:21:22,stdout,	from /app/vendor/bundle/ruby/3.2.0/bin/puma:25:in `load'
2023-02-25 15:21:22,stdout,	from /app/vendor/bundle/ruby/3.2.0/gems/puma-6.0.2/bin/puma:10:in `<top (required)>'
2023-02-25 15:21:22,stdout,	from /app/vendor/bundle/ruby/3.2.0/gems/puma-6.0.2/lib/puma/cli.rb:75:in `run'
2023-02-25 15:21:22,stdout,	from /app/vendor/bundle/ruby/3.2.0/gems/puma-6.0.2/lib/puma/launcher.rb:186:in `run'
2023-02-25 15:21:22,stdout,	from /app/vendor/bundle/ruby/3.2.0/gems/puma-6.0.2/lib/puma/single.rb:44:in `run'
2023-02-25 15:21:22,stdout,	from /app/vendor/bundle/ruby/3.2.0/gems/puma-6.0.2/lib/puma/runner.rb:158:in `load_and_bind'
2023-02-25 15:21:22,stdout,	from /app/vendor/bundle/ruby/3.2.0/gems/puma-6.0.2/lib/puma/configuration.rb:286:in `app'
2023-02-25 15:21:22,stdout,	from /app/vendor/bundle/ruby/3.2.0/gems/puma-6.0.2/lib/puma/configuration.rb:364:in `load_rackup'
2023-02-25 15:21:22,stdout,	from /app/vendor/bundle/ruby/3.2.0/gems/rack-2.2.5/lib/rack/builder.rb:66:in `parse_file'
2023-02-25 15:21:22,stdout,	from /app/vendor/bundle/ruby/3.2.0/gems/rack-2.2.5/lib/rack/builder.rb:105:in `load_file'
2023-02-25 15:21:22,stdout,	from /app/vendor/bundle/ruby/3.2.0/gems/rack-2.2.5/lib/rack/builder.rb:116:in `new_from_string'
2023-02-25 15:21:22,stdout,	from /app/vendor/bundle/ruby/3.2.0/gems/rack-2.2.5/lib/rack/builder.rb:116:in `eval'
2023-02-25 15:21:22,stdout,	from config.ru:3:in `block in <main>'
2023-02-25 15:21:22,stdout,	from config.ru:3:in `require'
2023-02-25 15:21:22,stdout,	from /app/app.rb:4:in `<top (required)>'
2023-02-25 15:21:22,stdout,	from /app/app.rb:4:in `require'
2023-02-25 15:21:22,stdout,	from /app/vendor/bundle/ruby/3.2.0/gems/sinatra-3.0.5/lib/sinatra.rb:3:in `<top (required)>'
2023-02-25 15:21:22,stdout,	from /app/vendor/bundle/ruby/3.2.0/gems/sinatra-3.0.5/lib/sinatra.rb:3:in `require'
2023-02-25 15:21:22,stdout,	from /app/vendor/bundle/ruby/3.2.0/gems/sinatra-3.0.5/lib/sinatra/main.rb:3:in `<top (required)>'
2023-02-25 15:21:22,stdout,	from /app/vendor/bundle/ruby/3.2.0/gems/sinatra-3.0.5/lib/sinatra/main.rb:28:in `<module:Sinatra>'
2023-02-25 15:21:22,stdout,	from /app/vendor/bundle/ruby/3.2.0/gems/sinatra-3.0.5/lib/sinatra/main.rb:28:in `require'
2023-02-25 15:21:22,stdout,	from /app/vendor/bundle/ruby/3.2.0/gems/sinatra-3.0.5/lib/sinatra/base.rb:20:in `<top (required)>'
2023-02-25 15:21:22,stdout,	from /app/vendor/bundle/ruby/3.2.0/gems/sinatra-3.0.5/lib/sinatra/base.rb:908:in `<module:Sinatra>'
2023-02-25 15:21:22,stdout,	from /app/vendor/bundle/ruby/3.2.0/gems/sinatra-3.0.5/lib/sinatra/base.rb:1840:in `<class:Base>'
2023-02-25 15:21:22,stdout,	from /usr/local/ruby/lib/ruby/3.2.0/random/formatter.rb:94:in `hex'
2023-02-25 15:21:22,stdout,	from /usr/local/ruby/lib/ruby/3.2.0/random/formatter.rb:74:in `random_bytes'
2023-02-25 15:21:22,stdout,	from /usr/local/ruby/lib/ruby/3.2.0/securerandom.rb:55:in `gen_random_openssl'
2023-02-25 15:21:22,stdout,/usr/local/ruby/lib/ruby/3.2.0/securerandom.rb:55:in `urandom': �[1mfailed to get urandom (�[1;4mRuntimeError�[m�[1m)�[m
2023-02-25 15:21:22,stdout,�[31mbundler: failed to load command: puma (/app/vendor/bundle/ruby/3.2.0/bin/puma)�[0m
2023-02-25 15:21:22,stdout,! Unable to load application: RuntimeError: failed to get urandom
2023-02-25 15:21:21,stdout,*          PID: 6
2023-02-25 15:21:21,stdout,*  Environment: production
2023-02-25 15:21:21,stdout,*  Max threads: 5
2023-02-25 15:21:21,stdout,*  Min threads: 0
2023-02-25 15:21:21,stdout,* Puma version: 6.0.2 (ruby 3.2.0-p0) ("Sunflower")
2023-02-25 15:21:21,stdout,Puma starting in single mode...
2023-02-25 15:21:14,stdout,http://localhost:3000/
@stefansundin
Copy link
Owner

stefansundin commented Feb 25, 2023

Hello,

Thanks for reporting. It looks like your device is missing urandom which sinatra tries to use. I filed a PR with sinatra that might fix it: sinatra/sinatra#1888

I also prepared a special docker image for you which has the fix from that PR. It would be great if you could try it just to see if there are any other problems (maybe there are other gems that try to use urandom). If it works then you (or I) can report the success in the PR, which should hopefully make them merge the fix faster.

The fixed image is under the missing-urandom-fix tag. So the full image name is stefansundin/rssbox:missing-urandom-fix. Please give it a try and let me know if it works or if you get another error. :)

Thanks!


I added this to the Dockerfile to make it patch the file during the build after running bundle install:

RUN sed -i '1841s/$/, RuntimeError/' /app/vendor/bundle/ruby/3.2.0/gems/sinatra-3.0.5/lib/sinatra/base.rb

@stefansundin
Copy link
Owner

Also, could you please let us know exactly what Synology model you are using? And if possible what version of the Linux kernel it is using?

@jeremymeyers
Copy link
Author

hey! Synology DSM7 runs linux kernel 4.4.180.

Happy to try any custom images/dockerfiles (tho might not get to it today)

@jeremymeyers
Copy link
Author

its a DS216+II

@stefansundin
Copy link
Owner

They already merged the fix but I will have to wait for them to release a new version of sinatra before I can include it. In the mean time the special image I prepared should hopefully work. But it is conceivable that some other part of the app could be broken for the same reason, so it would be great if you could test the image at some point so we can confirm that. There's no rush, so please don't feel like you have to get to it any time soon.

I'll keep this issue open until we've confirmed that no other part of the app has the same problem, and until there's a fixed sinatra version. At that point I'll also delete the temporary docker image.

@jeremymeyers
Copy link
Author

Will do. Maybe an opportunity to put in some checks in the Dockerfile to make sure requirements are met before install?

@jeremymeyers
Copy link
Author

Hey, just ran the new image and it launches just fine. Looks like the missing dependency was the issue. Thanks for addressing! (now if only soundcloud would start giving out dev tokens again...sigh.

@dentarg
Copy link

dentarg commented Apr 13, 2023

The fix sinatra/sinatra#1888 was released in Sinatra 3.0.6.

@stefansundin
Copy link
Owner

I've upgraded sinatra and pushed a new docker image so this issue should be resolved now.

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

3 participants