Project

General

Profile

Problem to access "Settings" from Administration menu

Added by Thibaud GISSELMANN about 11 years ago

Hi,

I've setup a brand new redmine 2.2.3 plateform and everything's running fine but the "Settings" sub menu from "Administration" menu.
When I click on it, I've got an internal error (redmine error 500, see attached)

Thing is I had previously setup the same plateform on a test machine without this settings problem ...
I haven't seen something wrong with system rights ...

Here is my configuration :

RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.23
  - RUBY VERSION: 1.9.3 (2013-01-15 patchlevel 374) [x86_64-linux]
  - INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.9.1
  - RUBY EXECUTABLE: /usr/local/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/local/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /usr/local/lib/ruby/gems/1.9.1
     - /home/tgisselmann/.gem/ruby/1.9.1
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

Thank in advance for any help given !


Replies (22)

RE: Problem to access "Settings" from Administration menu - Added by Jan Niggemann (redmine.org team member) about 11 years ago

What do you see in your logfile (log/production.log for RAILS_ENV=production)?

RE: Problem to access "Settings" from Administration menu - Added by Thibaud GISSELMANN about 11 years ago

It seems to be an encoding problem ... (I'm using french langguage).
Here's the detailed error in the production.log.

Started GET "/settings" for 90.37.36.4 at 2013-02-26 10:43:10 +0100
Processing by SettingsController#index as HTML
  Current user: thibaud.gisselmann (id=3)
  Rendered settings/_general.html.erb (4.5ms)
  Rendered settings/_display.html.erb (2.6ms)
  Rendered common/_tabs.html.erb (9.8ms)
  Rendered settings/edit.html.erb within layouts/admin (10.1ms)
Completed 500 Internal Server Error in 14ms

ActionView::Template::Error (incompatible character encodings: UTF-8 and ASCII-8BIT):
    3: <div class="box tabular settings">
    4: <p><%= setting_select :ui_theme, Redmine::Themes.themes.collect {|t| [t.name, t.id]}, :blank => :label_default, :label => :label_theme %></p>
    5:
    6: <p><%= setting_select :default_language, lang_options_for_select(false) %></p>
    7:
    8: <p><%= setting_select :start_of_week, [[day_name(1),'1'], [day_name(6),'6'], [day_name(7),'7']], :blank => :label_language_based %></p>
    9: <% locale = User.current.language.blank? ? ::I18n.locale : User.current.language %>
  app/helpers/settings_helper.rb:40:in `setting_select'
  app/views/settings/_display.html.erb:6:in `block in _app_views_settings__display_html_erb__1123794839097802511_56490160'
  app/views/settings/_display.html.erb:1:in `_app_views_settings__display_html_erb__1123794839097802511_56490160'
  app/views/common/_tabs.html.erb:24:in `block in _app_views_common__tabs_html_erb___3823081105700043889_40425560'
  app/views/common/_tabs.html.erb:23:in `each'
  app/views/common/_tabs.html.erb:23:in `_app_views_common__tabs_html_erb___3823081105700043889_40425560'
  app/helpers/application_helper.rb:263:in `render_tabs'
  app/views/settings/edit.html.erb:3:in `_app_views_settings_edit_html_erb___4341174753229255487_40072260'
  app/controllers/settings_controller.rb:26:in `index'

RE: Problem to access "Settings" from Administration menu - Added by Toshi MARUYAMA about 11 years ago

It seems you use mysql on Ruby 1.9.
Please use mysql2 instead of mysql.

RE: Problem to access "Settings" from Administration menu - Added by Thibaud GISSELMANN about 11 years ago

Well, I thought mysql2 was already configured.
Here's my database.yml


production:
  adapter: mysql2
  database: redmine
  host: localhost
  username: redmine
  password: "redmine" 
  encoding: utf8

Maybe the db encoding is wrong ?

RE: Problem to access "Settings" from Administration menu - Added by Jan Niggemann (redmine.org team member) about 11 years ago

Thibaud GISSELMANN wrote:

Maybe the db encoding is wrong ?

Maybe, yes... Better check:

Charsets
show session variables like 'char%';
show global variables like 'char%';

Collations
show session variables like 'coll%';
show global variables like 'coll%';

Show columns with explicit character_sets
SELECT character_set_name, COUNT(*) AS anzahl
FROM information_schema.columns
WHERE character_set_name IS NOT NULL
GROUP BY character_set_name;

Which columns are explicitly set to 'latin1'?
SELECT table_catalog, table_schema, table_name, column_name
FROM information_schema.columns
WHERE character_set_name = 'latin1'
ORDER BY table_catalog, table_schema, table_name, column_name;

RE: Problem to access "Settings" from Administration menu - Added by Thibaud GISSELMANN about 11 years ago

Hi,

First, thanks again for the help given !
You're right, it seems that some of the paramameters are set to latin1 ...

mysql> show session variables like 'char%';
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8                       |
| character_set_connection | utf8                       |
| character_set_database   | latin1                     |
| character_set_filesystem | binary                     |
| character_set_results    | utf8                       |
| character_set_server     | latin1                     |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)

mysql> show global variables like 'char%';
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | latin1                     |
| character_set_connection | latin1                     |
| character_set_database   | latin1                     |
| character_set_filesystem | binary                     |
| character_set_results    | latin1                     |
| character_set_server     | latin1                     |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)

Should I set everything to utf8 ?
If yes, could you tell me how to do so ? in the mysql conf file ?
Thanks

RE: Problem to access "Settings" from Administration menu - Added by Thibaud GISSELMANN about 11 years ago

I have setup utf8 for character encoding in the mysql server conf addind the 2 lines below in the "mysqld" section and then restart the mysql server

[mysql]
character-set-server=utf8
skip-character-set-client-handshake

I have now utf8 everywhere :

mysql> show session variables like 'char%';
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8                       |
| character_set_connection | utf8                       |
| character_set_database   | utf8                       |
| character_set_filesystem | binary                     |
| character_set_results    | utf8                       |
| character_set_server     | utf8                       |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)

mysql> show global variables like 'char%';
+--------------------------+----------------------------+
| Variable_name            | Value                      |
+--------------------------+----------------------------+
| character_set_client     | utf8                       |
| character_set_connection | utf8                       |
| character_set_database   | utf8                       |
| character_set_filesystem | binary                     |
| character_set_results    | utf8                       |
| character_set_server     | utf8                       |
| character_set_system     | utf8                       |
| character_sets_dir       | /usr/share/mysql/charsets/ |
+--------------------------+----------------------------+
8 rows in set (0.00 sec)

Though, I still have errors while trying to reach "settings" page :

Started GET "/settings" for 127.0.0.1 at 2013-02-28 16:32:15 +0100
Processing by SettingsController#index as HTML
  Current user: thibaud.gisselmann (id=3)
  Rendered settings/_general.html.erb (4.3ms)
  Rendered settings/_display.html.erb (4.0ms)
  Rendered settings/_authentication.html.erb (3.4ms)
  Rendered settings/_projects.html.erb (4.0ms)
  Rendered common/_tabs.html.erb (20.5ms)
  Rendered settings/edit.html.erb within layouts/admin (20.9ms)
Completed 500 Internal Server Error in 25ms

ActionView::Template::Error (incompatible character encodings: ASCII-8BIT and UTF-8):
    21: </script>
    22:
    23: <% tabs.each do |tab| -%>
    24:   <%= content_tag('div', render(:partial => tab[:partial], :locals => {:tab => tab} ),
    25:                        :id => "tab-content-#{tab[:name]}",
    26:                        :style => (tab[:name] != selected_tab ? 'display:none' : nil),
    27:                        :class => 'tab-content') %>
  app/views/common/_tabs.html.erb:24:in `block in _app_views_common__tabs_html_erb__3481933225455220184_58687940'
  app/views/common/_tabs.html.erb:23:in `each'
  app/views/common/_tabs.html.erb:23:in `_app_views_common__tabs_html_erb__3481933225455220184_58687940'
  app/helpers/application_helper.rb:263:in `render_tabs'
  app/views/settings/edit.html.erb:3:in `_app_views_settings_edit_html_erb___3294240299437438855_50986840'
  app/controllers/settings_controller.rb:26:in `index'

I also have errors on "myaccount" page when I choose "France" for language display for my user.
I can get back to normal directly updating the language column in the users table to "en" but it's not a suitable solution ...

RE: Problem to access "Settings" from Administration menu - Added by Jan Niggemann (redmine.org team member) about 11 years ago

Did you convert the database? If not, then the data inside your DB may still be non-UTF-8...

RE: Problem to access "Settings" from Administration menu - Added by Gabriel Mazetto about 11 years ago

I've migrated here from 1.8.7 to 1.9.3 and I'm experiencing the same problem

RE: Problem to access "Settings" from Administration menu - Added by Gabriel Mazetto about 11 years ago

commenting the following line: <p><%= setting_select :default_language, lang_options_for_select(false) %></p> makes it show again.
This makes me think that may be there is a problem with one of the localization files.

RE: Problem to access "Settings" from Administration menu - Added by Gabriel Mazetto about 11 years ago

I've now found what's wrong...

language options cames from:

    def languages_options
      ActionController::Base.cache_store.fetch "i18n/languages_options" do
        valid_languages.map {|lang| [ll(lang.to_s, :general_lang_name), lang.to_s]}.sort {|x,y| x.first <=> y.first }
      end      
    end

It looks like it haven't cleared the cache generated from 1.8.7... I can't say for sure that it's the only thing to be done, but I also converted the database to UTF-8 (tables were already correct).

The database conversion itself didn't solve the problem, but doing a: rake tmp:clear solved for me.

RE: Problem to access "Settings" from Administration menu - Added by Toshi MARUYAMA about 11 years ago

Gabriel Mazetto wrote:

This makes me think that may be there is a problem with one of the localization files.

No.

You need to convert db data.
See:
http://www.redmine.org/boards/2/topics/35979?r=36082#message-36082

RE: Problem to access "Settings" from Administration menu - Added by Thibaud GISSELMANN about 11 years ago

You were right, my Redmine DB needed to be converted.
I followed the instruction given on the link below and everything's working fine now for my "settings" page

Thanks so much everyone for all the help given !!!

Though, I still have a problem whenever I choose french in "My account" options for my user language ...
While saving, I get to an error page "Redmine 500 Error" generating this error in the production.log :

Started GET "/my/account" for 127.0.0.1 at 2013-03-01 10:03:59 +0100
Processing by MyController#account as HTML
  Current user: thibaud.gisselmann (id=3)
  Rendered my/account.html.erb within layouts/base (3.1ms)
Completed 500 Internal Server Error in 7ms

ActionView::Template::Error (incompatible character encodings: UTF-8 and ASCII-8BIT):
    16:   <p><%= f.text_field :firstname, :required => true %></p>
    17:   <p><%= f.text_field :lastname, :required => true %></p>
    18:   <p><%= f.text_field :mail, :required => true %></p>
    19:   <p><%= f.select :language, lang_options_for_select %></p>
    20:   <% if Setting.openid? %>
    21:   <p><%= f.text_field :identity_url  %></p>
    22:   <% end %>
  app/views/my/account.html.erb:19:in `block in _app_views_my_account_html_erb___3534517581178388190_50879200'
  app/helpers/application_helper.rb:991:in `labelled_form_for'
  app/views/my/account.html.erb:9:in `_app_views_my_account_html_erb___3534517581178388190_50879200'

Is there some encoding option to set remaining somewhere ?

RE: Problem to access "Settings" from Administration menu - Added by Thibaud GISSELMANN about 11 years ago

In fact, if I set my language to french, I also have the problem with the amininistration/settings page ...

ActionView::Template::Error (incompatible character encodings: UTF-8 and ASCII-8BIT):
    3: <div class="box tabular settings">
    4: <p><%= setting_select :ui_theme, Redmine::Themes.themes.collect {|t| [t.name, t.id]}, :blank => :label_default, :label => :label_theme %></p>
    5:
    6: <p><%= setting_select :default_language, lang_options_for_select(false) %></p>
    7:
    8: <p><%= setting_select :start_of_week, [[day_name(1),'1'], [day_name(6),'6'], [day_name(7),'7']], :blank => :label_language_based %></p>
    9: <% locale = User.current.language.blank? ? ::I18n.locale : User.current.language %>
  app/helpers/settings_helper.rb:40:in `setting_select'
  app/views/settings/_display.html.erb:6:in `block in _app_views_settings__display_html_erb__2441569439100115724_50355060'
  app/views/settings/_display.html.erb:1:in `_app_views_settings__display_html_erb__2441569439100115724_50355060'
  app/views/common/_tabs.html.erb:24:in `block in _app_views_common__tabs_html_erb__2025364035434378966_34326060'
  app/views/common/_tabs.html.erb:23:in `each'
  app/views/common/_tabs.html.erb:23:in `_app_views_common__tabs_html_erb__2025364035434378966_34326060'
  app/helpers/application_helper.rb:263:in `render_tabs'
  app/views/settings/edit.html.erb:3:in `_app_views_settings_edit_html_erb__3627659075875757340_33528600'
  app/controllers/settings_controller.rb:26:in `index'

RE: Problem to access "Settings" from Administration menu - Added by Toshi MARUYAMA about 11 years ago

Thibaud GISSELMANN wrote:

In fact, if I set my language to french, I also have the problem with the amininistration/settings page ...
[...]

Did you run "rake tmp:clear"?

RE: Problem to access "Settings" from Administration menu - Added by Thibaud GISSELMANN about 11 years ago

Yes, I already did that ... with no effect .

RE: Problem to access "Settings" from Administration menu - Added by Toshi MARUYAMA about 11 years ago

Thibaud GISSELMANN wrote:

Yes, I already did that ... with no effect .

Did you restart Redmine?
What WebServer do you use? Passenger?

RE: Problem to access "Settings" from Administration menu - Added by Thibaud GISSELMANN about 11 years ago

Yes, I restarted my web server wihich is acutally apache2, confugurer with passenger to host redmine
No effect ...

Thing is I've setup with no problem redmine on a test local debian.
The only difference is that the local debian whas setup to be located in France (keyboard and so on) during setup.
At the contrary, the debian I'm trying to use for production was already setup in english environment by my provider, as it is a virtual private Server pre installed ...
Does the locale "French" has to be setup on my debian box in order to make it work ?

Thanks again for your help

RE: Problem to access "Settings" from Administration menu - Added by Jan Niggemann (redmine.org team member) about 11 years ago

Thibaud GISSELMANN wrote:

Does the locale "French" has to be setup on my debian box in order to make it work ?

I don't think so...

RE: Problem to access "Settings" from Administration menu - Added by Ondřej Surý about 11 years ago

JFTR I have the same problem with postgresql database when creating or accessing user accounts.

Editing a user:

Started GET "/users/107/edit" for 2001:1488:ac14:1400:79ab:40d8:87cb:6a80 at 2013-03-11 12:50:56 +0100
Processing by UsersController#edit as HTML
  Parameters: {"id"=>"107"}
  Current user: beda (id=10)
  Rendered users/_mail_notifications.html.erb (7.3ms)
  Rendered users/_preferences.html.erb (5.1ms)
  Rendered users/_form.html.erb (18.1ms)
  Rendered users/_general.html.erb (19.4ms)
  Rendered users/_groups.html.erb (8.5ms)
  Rendered users/_memberships.html.erb (76.5ms)
  Rendered common/_tabs.html.erb (107.4ms)
  Rendered users/edit.html.erb within layouts/admin (110.9ms)
Completed 500 Internal Server Error in 174ms

ActionView::Template::Error (incompatible character encodings: ASCII-8BIT and UTF-8):
    21: </script>
    22:
    23: <% tabs.each do |tab| -%>
    24:   <%= content_tag('div', render(:partial => tab[:partial], :locals => {:tab => tab} ),
    25:                        :id => "tab-content-#{tab[:name]}",
    26:                        :style => (tab[:name] != selected_tab ? 'display:none' : nil),
    27:                        :class => 'tab-content') %>
  app/views/common/_tabs.html.erb:24:in `block in _app_views_common__tabs_html_erb___2669574904331897537_40463380'
  app/views/common/_tabs.html.erb:23:in `each'
  app/views/common/_tabs.html.erb:23:in `_app_views_common__tabs_html_erb___2669574904331897537_40463380'
  app/helpers/application_helper.rb:263:in `render_tabs'
  app/views/users/edit.html.erb:9:in `_app_views_users_edit_html_erb__1292716952840611560_40398560'

Registering a new user:

Started POST "/account/register" for 2001:1488:ac14:1400:748b:e807:ee3f:35a9 at 2013-03-11 12:47:15 +0100
Processing by AccountController#register as HTML
  Parameters: {"utf8"=>"✓", "authenticity_token"=>"[FILTERED]", "user"=>{"login"=>"[FILTERED]", "password"=>"[FILTERED]", "password_confirmation"=>"[FILTERED]", "firstname"=>"[FILTERED]", "lastname"=>"[FILTERED]", "mail"=>"[FILTERED]", "language"=>"en", "identity_url"=>""}, "commit"=>"Submit"}
  Current user: anonymous
  Rendered account/register.html.erb within layouts/base (5.1ms)
Completed 500 Internal Server Error in 17ms

ActionView::Template::Error (incompatible character encodings: UTF-8 and ASCII-8BIT):
    16: <p><%= f.text_field :firstname, :required => true %></p>
    17: <p><%= f.text_field :lastname, :required => true %></p>
    18: <p><%= f.text_field :mail, :required => true %></p>
    19: <p><%= f.select :language, lang_options_for_select %></p>
    20:
    21: <% if Setting.openid? %>
    22:   <p><%= f.text_field :identity_url  %></p>
  app/views/account/register.html.erb:19:in `block in _app_views_account_register_html_erb__167052182036648489_43437100'
  app/helpers/application_helper.rb:991:in `labelled_form_for'
  app/views/account/register.html.erb:3:in `_app_views_account_register_html_erb__167052182036648489_43437100'

Creating a new user:

Started GET "/users/new" for 217.31.207.1 at 2013-03-11 12:58:29 +0100
Processing by UsersController#new as HTML
  Current user: oerdnj (id=3)
  Rendered users/_mail_notifications.html.erb (1.9ms)
  Rendered users/_preferences.html.erb (5.0ms)
  Rendered users/_form.html.erb (12.6ms)
  Rendered users/new.html.erb within layouts/admin (15.3ms)
  Rendered admin/_menu.html.erb (3.8ms)
  Rendered layouts/base.html.erb (94.9ms)
Completed 500 Internal Server Error in 122ms

ActionView::Template::Error (incompatible character encodings: UTF-8 and ASCII-8BIT):
    55:         <%= yield :sidebar %>
    56:         <%= view_layouts_base_sidebar_hook_response %>
    57:     </div>
    58: 
    59:     <div id="content">
    60:         <%= render_flash_messages %>
    61:         <%= yield %>
  app/views/layouts/base.html.erb:58:in `_app_views_layouts_base_html_erb___556530348464672222_26602040'
  app/views/layouts/admin.html.erb:8:in `_app_views_layouts_admin_html_erb___1166907481205184341_39459180'

RE: Problem to access "Settings" from Administration menu - Added by Thibaud GISSELMANN about 11 years ago

With the help of a linux admin, I finally made it.
The trouble comes from linux locale :
You'll have to install the locale used (for me, fr_FR.UTF-8 UTF-8), on a debian box

dpkg-reconfigure locales

Then, flush your cache (mine was in the /tmp directory, I simply moved the /tmp to /tmp_old and created a new one ...)

Then at last, restart your web server.
On my box using apache2+mod passenger :

/etc/init.d/apache2 restart

Works for me now !

RE: Problem to access "Settings" from Administration menu - Added by Aleksandar Pavic over 9 years ago

I just did

rake tmp:cache:clear


and it worked!
    (1-22/22)