solectrus / hosting

Step-by-stypes guides for installing and hosting Solectrus
9 stars 4 forks source link

Problem to start the app after moving to a new Synology #36

Closed bennysweb closed 8 months ago

bennysweb commented 8 months ago

After moving to a new Synology NAS with the Synology Migration Assistant I'm not able to start the Solectrus app anymore. All records in InfluxDB are available and correct, the Senec Collector and all the other containers are working fine. Just the app container has a problem.

Here is what I can find in the logs:

app_1                 | Database is ready!
app_1                 | Puma starting in single mode...
app_1                 | * Puma version: 6.4.0 (ruby 3.2.2-p53) ("The Eagle of Durango")
app_1                 | *  Min threads: 5
app_1                 | *  Max threads: 5
app_1                 | *  Environment: production
app_1                 | *          PID: 10
app_1                 | ! Unable to load application: RuntimeError: failed to get urandom
app_1                 | bundler: failed to load command: puma (/usr/local/bundle/bin/puma)
app_1                 | /usr/local/lib/ruby/3.2.0/securerandom.rb:55:in `urandom': failed to get urandom (RuntimeError)
app_1                 |     from /usr/local/lib/ruby/3.2.0/securerandom.rb:55:in `gen_random_openssl'
app_1                 |     from /usr/local/lib/ruby/3.2.0/random/formatter.rb:74:in `random_bytes'
app_1                 |     from /usr/local/lib/ruby/3.2.0/random/formatter.rb:94:in `hex'
app_1                 |     from /usr/local/bundle/gems/zeitwerk-2.6.12/lib/zeitwerk/loader/config.rb:89:in `initialize'
app_1                 |     from /usr/local/bundle/gems/zeitwerk-2.6.12/lib/zeitwerk/loader.rb:100:in `initialize'
app_1                 |     from /usr/local/bundle/gems/zeitwerk-2.6.12/lib/zeitwerk/gem_loader.rb:20:in `initialize'
app_1                 |     from /usr/local/bundle/gems/zeitwerk-2.6.12/lib/zeitwerk/gem_loader.rb:15:in `new'
app_1                 |     from /usr/local/bundle/gems/zeitwerk-2.6.12/lib/zeitwerk/gem_loader.rb:15:in `__new'
app_1                 |     from /usr/local/bundle/gems/zeitwerk-2.6.12/lib/zeitwerk/registry.rb:90:in `loader_for_gem'
app_1                 |     from /usr/local/bundle/gems/zeitwerk-2.6.12/lib/zeitwerk/loader.rb:340:in `for_gem'
app_1                 |     from /usr/local/bundle/gems/actioncable-7.1.2/lib/action_cable.rb:30:in `<main>'
app_1                 |     from <internal:/usr/local/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
app_1                 |     from <internal:/usr/local/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
app_1                 |     from /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
app_1                 |     from /usr/local/bundle/gems/actioncable-7.1.2/lib/action_cable/engine.rb:4:in `<main>'
app_1                 |     from <internal:/usr/local/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
app_1                 |     from <internal:/usr/local/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:37:in `require'
app_1                 |     from /usr/local/bundle/gems/bootsnap-1.17.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:32:in `require'
app_1                 |     from /app/config/application.rb:14:in `<top (required)>'
app_1                 |     from /app/config/environment.rb:2:in `require_relative'
app_1                 |     from /app/config/environment.rb:2:in `<top (required)>'
app_1                 |     from config.ru:3:in `require_relative'
app_1                 |     from config.ru:3:in `block in <main>'
app_1                 |     from /usr/local/bundle/gems/rack-3.0.8/lib/rack/builder.rb:103:in `eval'
app_1                 |     from /usr/local/bundle/gems/rack-3.0.8/lib/rack/builder.rb:103:in `new_from_string'
app_1                 |     from /usr/local/bundle/gems/rack-3.0.8/lib/rack/builder.rb:94:in `load_file'
app_1                 |     from /usr/local/bundle/gems/rack-3.0.8/lib/rack/builder.rb:64:in `parse_file'
app_1                 |     from /usr/local/bundle/gems/puma-6.4.0/lib/puma/configuration.rb:368:in `load_rackup'
app_1                 |     from /usr/local/bundle/gems/puma-6.4.0/lib/puma/configuration.rb:290:in `app'
app_1                 |     from /usr/local/bundle/gems/puma-6.4.0/lib/puma/runner.rb:162:in `load_and_bind'
app_1                 |     from /usr/local/bundle/gems/puma-6.4.0/lib/puma/single.rb:44:in `run'
app_1                 |     from /usr/local/bundle/gems/puma-6.4.0/lib/puma/launcher.rb:194:in `run'
app_1                 |     from /usr/local/bundle/gems/puma-6.4.0/lib/puma/cli.rb:75:in `run'
app_1                 |     from /usr/local/bundle/gems/puma-6.4.0/bin/puma:10:in `<top (required)>'
app_1                 |     from /usr/local/bundle/bin/puma:25:in `load'
app_1                 |     from /usr/local/bundle/bin/puma:25:in `<top (required)>'
app_1                 |     from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler/cli/exec.rb:58:in `load'
app_1                 |     from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler/cli/exec.rb:58:in `kernel_load'
app_1                 |     from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler/cli/exec.rb:23:in `run'
app_1                 |     from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler/cli.rb:492:in `exec'
app_1                 |     from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
app_1                 |     from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
app_1                 |     from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler/vendor/thor/lib/thor.rb:527:in `dispatch'
app_1                 |     from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler/cli.rb:34:in `dispatch'
app_1                 |     from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
app_1                 |     from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler/cli.rb:28:in `start'
app_1                 |     from /usr/local/bundle/gems/bundler-2.4.22/exe/bundle:37:in `block in <top (required)>'
app_1                 |     from /usr/local/bundle/gems/bundler-2.4.22/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
app_1                 |     from /usr/local/bundle/gems/bundler-2.4.22/exe/bundle:29:in `<top (required)>'
app_1                 |     from /usr/local/bundle/bin/bundle:25:in `load'
app_1                 |     from /usr/local/bundle/bin/bundle:25:in `<main>'
solectrus_app_1 exited with code 1

... then the app starts again and again with the same problem. Can you give me a hint? I have tried to download a new docker-compose file and created a new .env without success.

ledermann commented 8 months ago

The error RuntimeError: failed to get urandom indicates that the Linux kernel on your machine is too old. SOLECTRUS requires v4 or later. Please check your kernel with this command.

uname -r

If the result is less than 4, SOLECTRUS will not run on this machine. I've encountered this a few times in the past, and it's unfixable. The only option is to update the machine to a v4 kernel - but as far as I know, Synology does not support updating the kernel.

bennysweb commented 8 months ago

Okay, you're right. Fortunately I have used this NAS just transitional and the "real" new one has version 4. So after migrating back the app should run properly again.