Bug #718
closed
redmine: unable to register a new account
Added by Pierre-Louis Bonicoli almost 4 years ago.
Updated over 3 years ago.
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'
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.
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
- Status changed from New to Resolved
- Assignee set to Pierre-Louis Bonicoli
- % Done changed from 0 to 100
- 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.
Without changing anything yet I tried to register and did not get any recaptcha.
So this works and I'm going to update the Ansible rules now.
- Status changed from In Progress to Resolved
- Description updated (diff)
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.
- Related to Bug #776: Users are unable to register to projects.duckcorp.org added
Also available in: Atom
PDF