Troubleshooting

No one is lucky enough to never have an issue with an application. So, it's essential for a user to know where to ask for assistance, how to do it, and what information should be provided to make the issue as clear as possible. That's what we'll discuss now.

Before asking a question, it's always worth ensuring that no one has asked it before and that the answer has not been given yet. Besides Google, you can search for issues similar to the one that you experience on http://www.redmine.org/, using the search form http://www.redmine.org/search. Check the following screenshot:

Troubleshooting

In most cases, the answer—if it exists—is found in Issues or Messages. The answer to a frequently asked question can also be found in Wiki pages.

If you can't find the answer using this search form, the first thing to check is whether the issue is really related to Redmine itself. Thus, it can be related to one of the plugins that you are using. The easiest way to check this is to try to disable all plugins (or to disable them one by one to determine which plugin causes the issue). This can be done by simply renaming the plugins' init.rb files, using the following command for example:

$ mv redmine_scm/init.rb  redmine_scm/init.rb.bck

This command should be executed for each subdirectory (redmine_scm is such a subdirectory) of Redmine's plugins directory (this is where plugins are located). Also, don't forget to restart Redmine after executing this command.

If it appears to be an issue in a third-party plugin, contact its author or the community. To find the home page of the plugin check out the Plugins page in the Administration menu (but note that not all plugins specify the home page). Alternatively, you can try finding the contact details for the plugin using the already mentioned search form (choose Redmine plugins).

Now it's the time to prepare the details. Let's start with getting information about the environment under which we are running Redmine. Execute the following command:

$ RAILS_ENV=production ruby bin/about

For http://mastering-redmine.com/, this command currently gives the following output:

Environment:
  Redmine version                3.1.1.stable
  Ruby version                      1.9.3-p484 (2013-11-22) [x86_64-linux]
  Rails version                      4.2.4
  Environment                      production
  Database adapter              Mysql2
SCM:
  Subversion                        1.8.8
  Filesystem                     
Redmine plugins:
  no plugin installed

Keep this information, as it should be provided in the issue that you are going to report to developers.

Before asking Redmine developers or the community to help you with your issue, you should also check out the Redmine log files. In many cases, logs can give you a hint about the source of the problem, so you can even understand how to resolve it on your own. Anyway, error messages from your log files, if any, should be always given to the people whom you ask for help.

Usually, Redmine stores its logs under the own log directory. However, if you use the Redmine package from the Debian/Ubuntu repository to install Redmine, the log files will be under the redmine subdirectory of /var/log. The name of the file that contains logs should be production.log (for the production environment).

Normally, a log file consists of blocks like this:

Started GET "/admin/plugins" for 23.197.12.199 at 2015-10-30 20:45:06 -0500
Processing by AdminController#plugins as HTML
  Current user: s-andy (id=1)
  Rendered admin/plugins.html.erb within layouts/admin (4.6ms)
  Rendered admin/_menu.html.erb (7.6ms)
  Rendered layouts/base.html.erb (21.0ms)
Completed 200 OK in 49ms (Views: 38.9ms | ActiveRecord: 1.2ms)

This is a block without errors.

An erroneous block looks like the following:

Started GET "/users/1" for 192.168.0.1 at 2015-10-30 14:13:17 +0000
Processing by UsersController#show as HTML
  Parameters: {"id"=>"1"}
  Current user: s-andy (id=1)
  Rendered users/show.html.erb within layouts/base (4.3ms)
Completed 500 Internal Server Error in 277ms (ActiveRecord: 19.3ms)

ActionView::Template::Error (undefined method `mail' for #<User:0x00000007a420c0>):
    10:     <li><%=l(:field_login)%>: <%= @user.login %></li>
    11:   <% end %>
    12:   <% unless @user.pref.hide_mail %>
    13:     <li><%=l(:field_mail)%>: <%= mail_to(@user.mail, nil, :encode => 'javascript') %></li>
    14:   <% end %>
    15:   <% @user.visible_custom_field_values.each do |custom_value| %>
    16:   <% if !custom_value.value.blank? %>
  app/views/users/show.html.erb:13:in `_app_views_users_show_html_erb___801144951909033840_62290640'
  app/controllers/users_controller.rb:77:in `block (2 levels) in show'
  app/controllers/users_controller.rb:73:in `show'
  lib/redmine/sudo_mode.rb:63:in `sudo_mode'

If you are getting something like this, then it's definitely an error in the code.

Usually such an error is accompanied by the following message in the browser:

Troubleshooting

Or it will be something like this if you use Passenger:

Troubleshooting

So, if you get such messages, look for errors in your logs!

Tip

If the error message says could not find gem, try running bundle install. If the stack trace contains a plugin's file (a file under the plugins directory), then the error could be caused by this plugin.

If your issue is not yet resolved, go to http://www.redmine.org/ and create a new issue or post a message on its forums.

But if you find a possible security vulnerability, report it to instead.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset