Project

General

Profile

Actions

Bug #718

closed

redmine: unable to register a new account

Added by Pierre-Louis Bonicoli about 3 years ago. Updated over 2 years ago.

Status:
Resolved
Priority:
Normal
Category:
Service :: Web
Start date:
2021-02-12
Due date:
% Done:

100%

Estimated time:
Patch Available:
Confirmed:
Yes
Branch:
Entity:
DuckCorp
Security:
No
Help Needed:

Description

https://www.redmine.org/account/register https://projects.duckcorp.org/account/register displays an HTTP 500 error.

Redmine logs (/var/log/redmine/dc/production.log) contains:

Processing by WelcomeController#index as HTML
  Current user: anonymous
  Rendering plugins/recaptcha/app/views/account/register.html.erb within layouts/base
  Rendered plugins/recaptcha/app/views/account/register.html.erb within layouts/base (70.2ms)
Completed 500 Internal Server Error in 232ms (ActiveRecord: 8.6ms)

ActionView::Template::Error (No site key specified.):
    26:   <p><%= custom_field_tag_with_label :user, value %></p>
    27: <% end %>
    28:
    29: <%= recaptcha_tags :hl=>current_language, :public_key => Setting.plugin_recaptcha['recaptcha_public_key'] %>
    30: </div>
    31:
    32: <%= submit_tag l(:button_submit) %>

plugins/recaptcha/app/views/account/register.html.erb:29:in `block in _plugins_recaptcha_app_views_account_register_html_erb___990786606388501379_47129660060800'
app/helpers/application_helper.rb:1242:in `labelled_form_for'
plugins/recaptcha/app/views/account/register.html.erb:3:in `_plugins_recaptcha_app_views_account_register_html_erb___990786606388501379_47129660060800'
lib/redmine/sudo_mode.rb:63:in `sudo_mode'


Related issues 2 (0 open2 closed)

Related to DuckCorp Infrastructure - Enhancement #732: passenger: a better path for restart.txtResolvedPierre-Louis Bonicoli2021-09-12

Actions
Related to DuckCorp Infrastructure - Bug #776: Users are unable to register to projects.duckcorp.orgResolved2022-07-10

Actions
Actions #1

Updated by Pierre-Louis Bonicoli about 3 years ago

I added this file /usr/share/redmine/config/initializers/recaptcha.rb:

Recaptcha.configure do |config|
  config.site_key   = Setting.plugin_recaptcha['recaptcha_public_key']
  config.secret_key = Setting.plugin_recaptcha['recaptcha_private_key']
end

and restarted apache2 (systemctl restart apache2.service) in order to fix this issue. I don't know why /var/lib/redmine/dc/tmp/restart.txt wasn't sufficient.

First I try to put the file below /var/lib/redmine/dc/config/initializers/ but it wasn't taken in account.

Actions #2

Updated by Pierre-Louis Bonicoli about 3 years ago

I added the following file (/root/patches/redmine/recaptcha.patch):

--- /dev/null    2021-02-10 12:46:26.160848555 +0100
+++ config/initializers/recaptcha.rb    2021-02-12 00:23:03.424350312 +0100
@@ -0,0 +1,4 @@
+Recaptcha.configure do |config|
+  config.site_key   = Setting.plugin_recaptcha['recaptcha_public_key']
+  config.secret_key = Setting.plugin_recaptcha['recaptcha_private_key']
+end

Actions #3

Updated by Pierre-Louis Bonicoli about 3 years ago

  • Status changed from New to Resolved
  • Assignee set to Pierre-Louis Bonicoli
  • % Done changed from 0 to 100
Actions #4

Updated by Marc Dequènes about 3 years ago

  • Status changed from Resolved to In Progress
  • Assignee changed from Pierre-Louis Bonicoli to Marc Dequènes

Considering information about the patch and versioning that I clarified in #719, there is an old patch redmine_recaptcha_api_change.patch that was created for Buster compatibility and reverts the plugin code for the API that is supported in Debian at the time. Now ruby-recaptcha is version 4.11.1-2 and I believe this is not needed anymore. Currently the old patch is fully applied, so maybe simply unapplying it would suffice and your patch might not be necessary. Reopening to test this.

Actions #5

Updated by Marc Dequènes about 3 years ago

Without changing anything yet I tried to register and did not get any recaptcha.

Actions #6

Updated by Marc Dequènes about 3 years ago

Frack, I followed your link to www.redmine.org… this is not our instance.

Actions #7

Updated by Marc Dequènes about 3 years ago

So this works and I'm going to update the Ansible rules now.

Actions #8

Updated by Marc Dequènes about 3 years ago

  • Status changed from In Progress to Resolved
Actions #9

Updated by Pierre-Louis Bonicoli about 3 years ago

  • Description updated (diff)
Actions #10

Updated by Pierre-Louis Bonicoli over 2 years ago

Pierre-Louis Bonicoli wrote:

I added this file /usr/share/redmine/config/initializers/recaptcha.rb:
[...]

and restarted apache2 (systemctl restart apache2.service) in order to fix this issue. I don't know why /var/lib/redmine/dc/tmp/restart.txt wasn't sufficient.

First I try to put the file below /var/lib/redmine/dc/config/initializers/ but it wasn't taken in account.

Using strace, I looked for the path used by redmine. The result is: /usr/share/redmine/tmp/restart.txt (incidentally i discovered the /usr/share/redmine/tmp/always_restart.txt path).

I checked the Passenger source code, in order to use a better restart.txt path:
  • either application root path (PassengerAppRoot) should be defined
  • or the PassengerRestartDir should be defined as an absolute path

I will open another issue for that.

Actions #11

Updated by Pierre-Louis Bonicoli over 2 years ago

Actions #12

Updated by Pierre-Louis Bonicoli over 1 year ago

  • Related to Bug #776: Users are unable to register to projects.duckcorp.org added
Actions

Also available in: Atom PDF