Project

General

Profile

Troubleshooting plugins

Added by Alexander Kirillov almost 15 years ago

Hi guys,

I have a request from the management to install redmine and some plugins
on a department server (Centos 5). With some effort I managed to get
the required dependencies needed to run the latest stable redmine (0.8.2).
The basic package runs pretty well, but the plugins do not.
I believe the plugins must be tested against a stable version of redmine
to be of any use to corporate users which do not run the latest and greatest on their servers.
Right now I'm having troubles with the following plugins: Budget (0.1.0) and Schedules (0.3.2).
When I attempt to use any of them all I can see is "Internal Server Error" in the browser,
nothing in ./log/production.log under redmine root and the likes
of the following messages in httpd logs:

redmine.xxx.xx||||391||||xx.xx.xx.xx - - [02/Apr/2009:10:29:02 +0400]
"GET /deliverables/index/xxxx HTTP/1.1" 500 391 "https://redmine.xxx.xx/projects/show/xxxx" 
"Mozilla/5.0 (X11; U; Linux x86_64; ru; rv:1.9.0.6) Gecko/2009020414 CentOS/3.0.6-1.el5.centos Firefox/3.0.6" 
Error during failsafe response: closed stream
(originally closed stream)
[Thu Apr 02 10:29:02 2009] [error] [client xx.xx.xx.xx] Premature end of script headers: deliverables,
referer: https://redmine.xxx.xx/projects/show/xxxx
[ pid=28204 file=Hooks.cpp:508 time=2009-04-02 10:29:02.123 ]:
  Backend process 2373 did not return a valid HTTP response. It returned no data.

Eric, Brad,
any suggestions on how to start troubleshooting these issues?

Thanks,
Sasha


Replies (19)

RE: Troubleshooting plugins - Added by Alexander Kirillov almost 15 years ago

The reason I didn't get any usable output was that after running rake db:migrate_plugins as root
I didn't bother to change the permissions on the newly created and updated files.

RE: Troubleshooting plugins - Added by Brad Beattie almost 15 years ago

I'm not sure about the error messages that you're getting, but I'm pretty sure Schedules 0.3.2 requires the latest trunk of Redmine (I don't recall which revision number). I agree that isn't ideal and that my releases would be better served if they stayed in sync with Redmine's, but I haven't gotten around to that just yet.

nothing in ./log/production.log under redmine root and the likes

That seems unusual to me. I'd guess that something's wrong in the base configuration rather than the plugins, but it's difficult to say without knowing the specifics.

RE: Troubleshooting plugins - Added by Alexander Kirillov almost 15 years ago

Yea, that was a problem with wrong permissions on the files under RAILS_ROOT.
Since I solved it I'm getting somewhere in my attempts to make your
schedules-0.3.2 plugin work with redmine-0.8.2. Right now I'm stuck
with the following error in several places: undefined method `l_hours'

Showing vendor/plugins/redmine_schedules/app/views/schedules/details.html.erb where line #19 raised:

undefined method `l_hours' for #<ActionView::Base:0xb6b584dc>

Extracted source (around line #19):

16: <%= render :partial => 'date_range' %>
17: <% end %>
18: 
19: <div class="total-hours">
20: <p><%= l(:label_total) %>: <%= html_hours(l_hours(@total_hours)) %></p>
21: </div>
22: 

Can you suggest a workaround which will work with redmine-0.8.2?
I'm not 100% sure but have this funny feeling that these parts
of code were working for me before I either installed more plugins
or changed some settings.

Thanks for your attention.

RE: Troubleshooting plugins - Added by Brad Beattie almost 15 years ago

Workaround:

16: <%= render :partial => 'date_range' %>
17: <% end %>
18: 
19: <div class="total-hours">
20: <p><%= l(:label_total) %>: <%= @total_hours %></p>
21: </div>
22: 

Redmine recently changed the way it's dealing with internationalized strings, which is the source of this issue you're running into.

RE: Troubleshooting plugins - Added by Alexander Kirillov almost 15 years ago

It worked. Thanks.
Now it's down to undefined method `other_formats_links':

Showing vendor/plugins/redmine_schedules/app/views/schedules/report.html.erb where line #82 raised:

undefined method `other_formats_links' for #<ActionView::Base:0xb6c229f8>

Extracted source (around line #82):

79: </tbody>
80: </table>
81: 
82: <% other_formats_links do |f| %>
83:     <%= f.link_to 'CSV', :url => params %>
84: <% end %>
85: <% end %>

If there's no easy replacement I could probably just comment out these lines?

RE: Troubleshooting plugins - Added by Brad Beattie almost 15 years ago

Alexander Kirillov wrote:

It worked. Thanks.
Now it's down to undefined method `other_formats_links':
[...]
If there's no easy replacement I could probably just comment out these lines?

Yeah, just comment them out. That's fine.

RE: Troubleshooting plugins - Added by Alexander Kirillov almost 15 years ago

Almost there but two major problems remain:

1. Schedule editor (Edit Schedule) always opens on the prev week. This is probably due to the fact that in Russian locale a week begins on Monday and ends on Sunday.

2. When trying to save the changes to any other (than myself) user schedules the application crashes with the following error:

Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id

vendor/plugins/redmine_schedules/app/controllers/schedules_controller.rb:475:in `save_scheduled_entries'
vendor/plugins/redmine_schedules/app/controllers/schedules_controller.rb:450:in `each'
vendor/plugins/redmine_schedules/app/controllers/schedules_controller.rb:450:in `save_scheduled_entries'
vendor/plugins/redmine_schedules/app/controllers/schedules_controller.rb:447:in `each'
vendor/plugins/redmine_schedules/app/controllers/schedules_controller.rb:447:in `save_scheduled_entries'
vendor/plugins/redmine_schedules/app/controllers/schedules_controller.rb:444:in `each'
vendor/plugins/redmine_schedules/app/controllers/schedules_controller.rb:444:in `save_scheduled_entries'
vendor/plugins/redmine_schedules/app/controllers/schedules_controller.rb:417:in `save_entries'
vendor/rails/activesupport/lib/active_support/callbacks.rb:173:in `send'

After I login to redmine as this other user and edit the schedule for the same time period for him
I can later change already allocated time under my own account with no problem. But any attempt to enter value in a previously blank cell for another user will result in the above error.

If you could suggest workarounds or bug fixes for those two or at least for the last one I would consider my efforts complete.

Thank you
__

RE: Troubleshooting plugins - Added by Brad Beattie almost 15 years ago

Alexander Kirillov wrote:

Almost there but two major problems remain:

1. Schedule editor (Edit Schedule) always opens on the prev week. This is probably due to the fact that in Russian locale a week begins on Monday and ends on Sunday.

Mm. Good catch. I'll fix that for the next release.

2. When trying to save the changes to any other (than myself) user schedules the application crashes with the following error:

Hrm. I don't get that error with the latest versions of both Redmine and the plugin. Not quite sure how to solve that one.

RE: Troubleshooting plugins - Added by Brad Beattie almost 15 years ago

Alexander Kirillov wrote:

1. Schedule editor (Edit Schedule) always opens on the prev week. This is probably due to the fact that in Russian locale a week begins on Monday and ends on Sunday.

Hrm. Just took a look and can't confirm this. I told it to look at понедельник, апреля 6, which it did without issue (showing it as the first day in the week). I told it to look at воскресенье, апреля 5, which it did without issue (showing it as the last day in the week). Could you clarify your issue here?

Also while we're at it, if you could provide a localization of the schedule strings, that'd be sweet.

RE: Troubleshooting plugins - Added by Alexander Kirillov almost 15 years ago

Sure Brad.
I've attached lang/ru.yml

Steps to reproduce problem #1:

1. select Russian language in My account
2. click My schedule (see screenshot #1) and take notice of the date (Apr 8) in Date range selector
3. click Edit schedule (see screenshot #2)

The date in Date range selector is Apr 5 which is Sunday, the end of the previous week in Russian locale
(and the beginning of the current week in English locale).
As there're no dates in Editing schedule page a user has no idea he's actually editing
the schedule for the previous week.

ru.yml (2.3 KB) ru.yml Russian l10n
wrong_week1.jpg (107 KB) wrong_week1.jpg screenshot #1
wrong_week2.jpg (104 KB) wrong_week2.jpg screenshot #2

RE: Troubleshooting plugins - Added by Brad Beattie almost 15 years ago

Alexander Kirillov wrote:

Sure Brad.
I've attached lang/ru.yml

Thanks. Committed and pushed to github.

Steps to reproduce problem #1:

1. select Russian language in My account
2. click My schedule (see screenshot #1) and take notice of the date (Apr 8) in Date range selector
3. click Edit schedule (see screenshot #2)

The date in Date range selector is Apr 5 which is Sunday, the end of the previous week in Russian locale
(and the beginning of the current week in English locale).
As there're no dates in Editing schedule page a user has no idea he's actually editing
the schedule for the previous week.

Hrm. I see what you mean by your screenshots, but my local instance doesn't seem to have this issue. I gather you won't have this problem when you upgrade to the next release of Redmine.

RE: Troubleshooting plugins - Added by Alexander Kirillov almost 15 years ago

Upgrading to the next release of redmine whenever there's a problem with one of the plugins is not an option.
If plugin devs do not maintain compatibility with a stable version of redmine it's ever gonna be a real PITA to install and manage redmine and a number of plugins on an enterprise distro.
The provided patch seems to be a fix for problem #2.

RE: Troubleshooting plugins - Added by Brad Beattie almost 15 years ago

Alexander Kirillov wrote:

Upgrading to the next release of redmine whenever there's a problem with one of the plugins is not an option.
If plugin devs do not maintain compatibility with a stable version of redmine it's ever gonna be a real PITA to install and manage redmine and a number of plugins on an enterprise distro.
The provided patch seems to be a fix for problem #2.

Mmm. I get where you're coming from. Ideally, I'd like to maintain compatibility with the latest stable release. These few plugins I've written were just a bit of an experiment at first, but I do see them settling down as you suggest. It's just going to take a bit of time for them and the processes involved to mature.

Thanks for the patch. I'll see that it's pushed to github today.

RE: Troubleshooting plugins - Added by Eric Davis almost 15 years ago

Alexander Kirillov,

I try to keep released versions of my plugins working with the stable branch of Redmine (0.8) while making the current development version work with both stable and Redmine trunk. When I last checked, Budget was compatible with 0.8 but the latest development copy has some major changes and requires another plugin, Redmine Rate. I'll be releasing some new versions soon and will be testing against the latest 0.8.3 release.

Eric

RE: Troubleshooting plugins - Added by Alexander Kirillov almost 15 years ago

Hi Eric,

The solution for the problem I was having with budget-0.1.0 is here:
https://projects.littlestreamsoftware.com/issues/1910#note-2

There should be an easier way to install a stable version of redmine
and a number of plugins which would work with this particular version
without the necessity of tweaking the code.

Redmine itself is a fast moving target and official redmine releases
seem like good sync points for plugin devs. IMHO.

Thank you,
Sasha

RE: Troubleshooting plugins - Added by Eric Davis almost 15 years ago

Alexander Kirillov wrote:

The solution for the problem I was having with budget-0.1.0 is here:
https://projects.littlestreamsoftware.com/issues/1910#note-2

That was fixed back in January, but hasn't been packaged up into an official release yet. The latest version requires the Redmine Rate plugin which itself needs some development to be backwards compatible (it was developed for trunk).

Redmine itself is a fast moving target and official redmine releases
seem like good sync points for plugin devs. IMHO.

I agree wholeheartedly, but it takes a bit of time to test each plugin on the different versions of Redmine. Not to mention the work needed to make the plugin backwards compatible with previous versions. Multiply that by the number of plugins I have (25 that I see) and you can see why some aren't released right away. Right now I've got a list of releases to QA and put out over the next few days/weeks:

  1. Google Analytics plugin - update
  2. Rate plugin - new plugin
  3. Billing plugin - new plugin
  4. Budget plugin - update

Now if someone wants to step up and help me do some QA and patch the places to make them 0.8/trunk compatible, I'd welcome the help. All the code is on GitHub

Eric

RE: Troubleshooting plugins - Added by Alexander Kirillov almost 15 years ago

Brad,

The attached is a complete patchset for redmine_schedules-0.3.2 which provides redmine-0.8.2 compatibility and full russian l10n including hardcoded and missing labels.

Thanks for the plugin,
Sasha

redmine_schedules-0.3.2.patch.20090410 (16.9 KB) redmine_schedules-0.3.2.patch.20090410 redmine-0.8.2 compat and russian l10n patch

RE: Troubleshooting plugins - Added by Michael Smethurst almost 15 years ago

I'm having a problem with the schedules plugin.

I installed it and now am getting a 500 internal error on my server.

I installed redmine via rightscale/bitnami, and then installed schedules...

Now even when I delete the folder I can't get rid of the 500 error.

Also, when I do a rake db:migrate_plugins, I get an error

"Undefined method plugins for Rails!"
"Make sure engines plugin is installed"

ActionView::TemplateError (uninitialized constant Rails::Plugin::SchedulesController) on line #27 of layouts/base.rhtml:                                                                       
24:         <%= render_menu :account_menu -%>                                                                                                                                                  
25:     </div>                                                                                                                                                                                 
26:     <%= content_tag('div', "#{l(:label_logged_as)} #{User.current.login}", :id => 'loggedas') if User.current.logged? %>
27:     <%= render_menu :top_menu -%>                                                                                                                                                          
28: </div>                                                                                                                                                                                     
29:                                                                                                                                                                                            
30: <div id="header">                                                                                                                                                                          

    vendor/rails/activesupport/lib/active_support/dependencies.rb:478:in `const_missing'                                                                                                       
    vendor/plugins/redmine_schedules/redmine_schedules/init.rb:15:in `evaluate_init_rb'                                                                                                        
    lib/redmine/menu_manager.rb:74:in `call'                                                                                                                                                   
    lib/redmine/menu_manager.rb:74:in `render_menu'                                                                                                                                            
    lib/redmine/menu_manager.rb:73:in `each'
    lib/redmine/menu_manager.rb:73:in `render_menu'
    app/views/layouts/base.rhtml:27:in `_run_erb_47app47views47layouts47base46rhtml'                                                                                                           
    vendor/rails/actionpack/lib/action_view/base.rb:637:in `send'
    vendor/rails/actionpack/lib/action_view/base.rb:637:in `compile_and_render_template'
    vendor/rails/actionpack/lib/action_view/base.rb:365:in `render_template'                                                                                                                   
    vendor/rails/actionpack/lib/action_view/base.rb:316:in `render_file'
    vendor/rails/actionpack/lib/action_controller/layout.rb:268:in `render_without_benchmark'
    vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'
    /bitnami/redmine/ruby/lib/ruby/1.8/benchmark.rb:293:in `measure'
    vendor/rails/actionpack/lib/action_controller/benchmarking.rb:51:in `render'                                                                                                               
    app/controllers/issues_controller.rb:67:in `index'

RE: Troubleshooting plugins - Added by Brad Beattie almost 15 years ago

Alexander Kirillov wrote:

Brad,

The attached is a complete patchset for redmine_schedules-0.3.2 which provides redmine-0.8.2 compatibility and full russian l10n including hardcoded and missing labels.

Thanks for the plugin,
Sasha

Thanks Sasha. I wonder if the patch is largely necessary what with 0.8.3 out, which supports a lot of the label changes you implemented for 0.8.2 compatibility. Certainly the _calendar.html.erb hard coded string should have been a label (fixed) as should have the permission strings (fixed).

    (1-19/19)