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

Generate the VAPID_PRIVATE_KEY and VAPID_PUBLIC_KEY with errors on newest docker & docker-compose #17297

Closed
tardar opened this issue Jan 15, 2022 · 1 comment · Fixed by #17338
Labels
bug Something isn't working

Comments

@tardar
Copy link

tardar commented Jan 15, 2022

Steps to reproduce the problem

  1. I tried to generate the keys with " docker-compose run --rm web bundle exec rake mastodon:webpush:generate_vapid_key"
  2. Error exists (I set latest mastodon release in docker-compose file --> v3.4.4)

This errors are shown:

/opt/ruby/lib/ruby/2.7.0/net/protocol.rb:66: warning: already initialized constant Net::ProtocRetryError
/opt/mastodon/vendor/bundle/ruby/2.7.0/gems/net-protocol-0.1.0/lib/net/protocol.rb:66: warning: previous definition of ProtocRetryError was here
/opt/ruby/lib/ruby/2.7.0/net/protocol.rb:206: warning: already initialized constant Net::BufferedIO::BUFSIZE
/opt/mastodon/vendor/bundle/ruby/2.7.0/gems/net-protocol-0.1.0/lib/net/protocol.rb:206: warning: previous definition of BUFSIZE was here
/opt/ruby/lib/ruby/2.7.0/net/protocol.rb:503: warning: already initialized constant Net::NetPrivate::Socket
/opt/mastodon/vendor/bundle/ruby/2.7.0/gems/net-protocol-0.1.0/lib/net/protocol.rb:503: warning: previous definition of Socket was here
rake aborted!
ArgumentError: `secret_key_base` for production environment must be a type of String`
/opt/mastodon/vendor/bundle/ruby/2.7.0/gems/railties-6.1.3.2/lib/rails/application.rb:594:in `validate_secret_key_base'
/opt/mastodon/vendor/bundle/ruby/2.7.0/gems/railties-6.1.3.2/lib/rails/application.rb:430:in `secret_key_base'
/opt/mastodon/vendor/bundle/ruby/2.7.0/gems/devise-4.8.0/lib/devise/secret_key_finder.rb:24:in `key_exists?'
/opt/mastodon/vendor/bundle/ruby/2.7.0/gems/devise-4.8.0/lib/devise/secret_key_finder.rb:16:in `find'
/opt/mastodon/vendor/bundle/ruby/2.7.0/gems/devise-4.8.0/lib/devise/rails.rb:37:in `block in <class:Engine>'
/opt/mastodon/vendor/bundle/ruby/2.7.0/gems/railties-6.1.3.2/lib/rails/initializable.rb:32:in `instance_exec'
/opt/mastodon/vendor/bundle/ruby/2.7.0/gems/railties-6.1.3.2/lib/rails/initializable.rb:32:in `run'
/opt/mastodon/vendor/bundle/ruby/2.7.0/gems/railties-6.1.3.2/lib/rails/initializable.rb:61:in `block in run_initializers'
/opt/mastodon/vendor/bundle/ruby/2.7.0/gems/railties-6.1.3.2/lib/rails/initializable.rb:60:in `run_initializers'
/opt/mastodon/vendor/bundle/ruby/2.7.0/gems/railties-6.1.3.2/lib/rails/application.rb:384:in `initialize!'
/opt/mastodon/config/environment.rb:5:in `<top (required)>'
/opt/mastodon/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.6.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require'
/opt/mastodon/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.6.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `block in require_with_bootsnap_lfi'
/opt/mastodon/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.6.0/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/opt/mastodon/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.6.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require_with_bootsnap_lfi'
/opt/mastodon/vendor/bundle/ruby/2.7.0/gems/bootsnap-1.6.0/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:31:in `require'
/opt/mastodon/vendor/bundle/ruby/2.7.0/gems/zeitwerk-2.4.2/lib/zeitwerk/kernel.rb:34:in `require'
/opt/mastodon/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.3.2/lib/active_support/dependencies.rb:332:in `block in require'
/opt/mastodon/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.3.2/lib/active_support/dependencies.rb:299:in `load_dependency'
/opt/mastodon/vendor/bundle/ruby/2.7.0/gems/activesupport-6.1.3.2/lib/active_support/dependencies.rb:332:in `require'
/opt/mastodon/vendor/bundle/ruby/2.7.0/gems/railties-6.1.3.2/lib/rails/application.rb:360:in `require_environment!'
/opt/mastodon/vendor/bundle/ruby/2.7.0/gems/railties-6.1.3.2/lib/rails/application.rb:526:in `block in run_tasks_blocks'
/opt/mastodon/vendor/bundle/ruby/2.7.0/gems/rake-13.0.3/exe/rake:27:in `<top (required)>'
/opt/ruby/bin/bundle:23:in `load'
/opt/ruby/bin/bundle:23:in `<main>'
Tasks: TOP => mastodon:webpush:generate_vapid_key => environment
(See full trace by running task with --trace)

I'm running on Ubuntu20.04 with versions of:

docker: Docker version 20.10.12, build e91ed57
docker-compose: Docker Compose version v2.2.3
GitHub commit of mastodon: b52fdb4

Thanks a lot for helping :)

Expected behaviour

I've expected to get the APID_PRIVATE_KEY and VAPID_PUBLIC_KEY

Actual behaviour

I got the error from message above

Specifications

v3.4.4

@tardar tardar added the bug Something isn't working label Jan 15, 2022
@ClearlyClaire
Copy link
Contributor

You need to first generate secrets for SECRET_KEY_BASE and OTP_SECRET (you can do that with bundle exec rake secret).

That being said, there is no real reason for that task to require a running environment, so I will change that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants