southbridgeio / redmine_2fa

Two-factor (sms/telegram) authentication for Redmine
https://southbridge.io
MIT License
42 stars 17 forks source link

Installation ok but Redmine won't start after #98

Open raphaelbkt opened 2 years ago

raphaelbkt commented 2 years ago

Hi,

This is my first install of the 2FA module for an existing Redmine deployment. Environment: Redmine version 4.2.2.stable Ruby version 2.7.4-p191 (2021-07-07) [x86_64-linux] Rails version 5.2.6

I have installed libcurl-devel, then module redmine_sidekiq, opened local port 6379 on firewall (local), installed redmine_bots and then installed redmine_2fa.

Installation is ok (I had to disable rotp and rqrcode from Gemfile ) via bundle install.

Bundle exec rake ends with an error but I did not have any previous ^module deployment nor configuration.

When I try to restart Redmine (via a service) I have these messages and the application does not start:

janv. 04 11:39:03 bash[21119]: /usr/local/rvm/gems/ruby-2.7.4/gems/dry-configurable-0.13.0/lib/dry/configurable/dsl.rb>
janv. 04 11:39:03 bash[21119]: Provide a `default:` keyword argument instead
janv. 04 11:39:03 bash[21119]: /usr/local/rvm/gems/ruby-2.7.4/gems/dry-configurable-0.13.0/lib/dry/configurable/dsl.rb>
janv. 04 11:39:03 bash[21119]: Provide a `default:` keyword argument instead

I notice the dry-configurable has changed this on version 0.13 : https://github.com/dry-rb/dry-configurable/blob/master/CHANGELOG.md

Deprecated the setting default provided as the second positional argument. Provide it via the default: keyword argument instead. (#112 and #121 by @waiting-for-dev & @timriley)

setting :path, default: "some/default/path"

Can you please check this ? I am able to make testing if needed.

Thanks

Raphaël

cheegui commented 2 years ago

UPDATE: Haha, it turns out 2FA with TOTP Auth is already built-in in Redmine. So this plugin is not needed if you only want Google Auth and not SMS or Telegram.

UPDATE: The invalid barcode error was "fixed" by this poster ryota-saito-0309:

UPDATE : The problem turned out to be the cache on Chrome browser. We are able to login to our Redmine site now on another browser.
But we have another issue. Cannot scan the QR code with Google Authenticator on Iphone or andOTP and 2FA Authenticator on Android. Got this error in Google Authenticator: Invalid barcode The barcode 'otpath://totp/server3.example.com:john?issuer=server3.example.com" is not a valid authentication token barcode.

And just Invalid QR Code in andOTP and 2FA Authenticator on Andriod.

Saw this on production.log which led us to think it is a browser cache problem.

tail -n 40 production.log
Creating scope :system. Overwriting existing method Enumeration.system.
MailHandler: missing information from John: Unable to determine target project
Creating scope :sorted. Overwriting existing method Group.sorted.

We have similar problem.

puma.stderr.log

Provide a `default:` keyword argument instead

/usr/local/rvm/gems/ruby-2.7.2/gems/dry-configurable-0.14.0/lib/dry/configurable/dsl.rb:28:in `initialize' [dry-configurable] default value as positional argument to settings is deprecated and will be removed in the next major version
Provide a `default:` keyword argument instead

/var/log/nginx/error.log

2022/01/13 23:43:49 [error] 1296#1296: *1 connect() to unix:/var/www/redmine/tmp/sockets/puma.sock failed (111: Connection refused) while connecting to upstream, client: 192.168.5.103, server: localhost, request: "GET / HTTP/1.1", upstream: "http://unix:/var/www/redmine/tmp/sockets/puma.sock:/", host: "server3.example.com" 
2022/01/13 23:43:49 [error] 1296#1296: *1 connect() to unix:/var/www/redmine/tmp/sockets/puma.sock failed (111: Connection refused) while connecting to upstream, client: 192.168.5.103, server: localhost, request: "GET /favicon.ico HTTP/1.1", upstream: "http://unix:/var/www/redmine/tmp/sockets/puma.sock:/favicon.ico", host: "server3.example.com", referrer: "https://server3.example.com/" 
root@server3:/var/log/nginx

puma.stdout.log

[2493] /usr/local/rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/logger/log_device.rb:95:in `initialize'
[2493] Early termination of worker
[2489] ! Unable to start worker
[2489] /usr/local/rvm/rubies/ruby-2.7.2/lib/ruby/2.7.0/logger/log_device.rb:95:in `initialize'
[2489] Early termination of worker

Our system Redmine version 4.2.3.stable Ruby version 2.7.2-p137 (2020-10-01) [x86_64-linux] Rails version 5.2.6 Environment production Database adapter Mysql2 Mailer queue ActiveJob::QueueAdapters::AsyncAdapter Mailer delivery smtp

Server: Ubuntu 16.04

We did these during the installation: /var/www/redmine# vi Gemfile

# TOTP-based 2-factor authentication
#gem 'rotp'
gem 'rotp', '~> 4.0'
gem 'rqrcode', '~> 1.0'
#gem 'rqrcode'
cp -Rp redmine_2fa /var/www/redmine/plugins/
cp -Rp redmine_bots /var/www/redmine/plugins/
cp -Rp redmine_sidekiq /var/www/redmine/plugins/
apt-get install libcurl3-dev
apt-get install redis-server
bundle
bundle exec rake redmine:plugins:migrate RAILS_ENV=production

output of bundle exec rake redmine:plugins:migrate RAILS_ENV=production

/usr/local/rvm/gems/ruby-2.7.2/gems/dry-configurable-0.14.0/lib/dry/configurable/dsl.rb:28:in `initialize' [dry-configurable] passing a constructor as a block is deprecated and will be removed in the next major version
Provide a `constructor:` keyword argument instead

Thank you very much