Bug #280

undefined method `l' for Buildbot:Module

Added by Here I. Come over 1 year ago. Updated over 1 year ago.

Status:Feedback Start date:2012-01-31
Priority:Normal Due date:
Assignee:Christoph Kappel % Done:

0%

Category:-
Target version:-
Votes: 0

Description

Getting

ERROR: undefined method `l' for Buildbot:Module

when doing

rake 'redmine_buildbot:fetch' RAILS_ENV=production

Redmine version 1.1.2.

History

Updated by Christoph Kappel over 1 year ago

Hum, can you post the whole backtrace and not just the error?

Updated by Here I. Come over 1 year ago

That's the only thing I get:

root@srv:/usr/share/redmine# rake 'redmine_buildbot:fetch' RAILS_ENV=production

(in /usr/share/redmine)

ERROR: undefined method `l' for Buildbot:Module

Update complete

Please, provide with instructions for further investigations. I'm on Debian Squeeze with Redmine installed from debian-backports. Checked out the lasted code for your plugin with hg.

Clicking 'update builds' from redmine interface gives a 500 internal server error:

Processing BuildbotController#update (for ip_address_here at 2012-02-01 17:36:19) [GET]
  Parameters: {"project_id"=>"project_id_here", "action"=>"update", "authenticity_token"=>"auth_token_here=", "controller"=>"buildbot"}

SocketError (getaddrinfo: Name or service not known):
  /usr/lib/ruby/1.8/net/http.rb:560:in `initialize'
  /usr/lib/ruby/1.8/net/http.rb:560:in `open'
  /usr/lib/ruby/1.8/net/http.rb:560:in `connect'
  /usr/lib/ruby/1.8/timeout.rb:67:in `timeout'
  /usr/lib/ruby/1.8/timeout.rb:101:in `timeout'
  /usr/lib/ruby/1.8/net/http.rb:560:in `connect'
  /usr/lib/ruby/1.8/net/http.rb:553:in `do_start'
  /usr/lib/ruby/1.8/net/http.rb:548:in `start'
  /usr/lib/ruby/1.8/xmlrpc/client.rb:535:in `do_rpc'
  /usr/lib/ruby/1.8/xmlrpc/client.rb:420:in `call2'
  /usr/lib/ruby/1.8/xmlrpc/client.rb:410:in `call'
  vendor/plugins/redmine_buildbot/app/controllers/buildbot_controller.rb:65:in `update'
  /usr/lib/ruby/1.8/action_controller/base.rb:1331:in `send'
  /usr/lib/ruby/1.8/action_controller/base.rb:1331:in `perform_action_without_filters'
  /usr/lib/ruby/1.8/action_controller/filters.rb:617:in `call_filters'
  /usr/lib/ruby/1.8/action_controller/filters.rb:610:in `perform_action_without_benchmark'
  /usr/lib/ruby/1.8/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
  /usr/lib/ruby/1.8/action_controller/benchmarking.rb:68:in `perform_action_without_rescue'
  /usr/lib/ruby/1.8/action_controller/rescue.rb:160:in `perform_action_without_flash'
  /usr/lib/ruby/1.8/action_controller/flash.rb:146:in `perform_action'
  /usr/lib/ruby/1.8/action_controller/base.rb:532:in `send'
  /usr/lib/ruby/1.8/action_controller/base.rb:532:in `process_without_filters'
  /usr/lib/ruby/1.8/action_controller/filters.rb:606:in `process'
  /usr/lib/ruby/1.8/action_controller/base.rb:391:in `process'
  /usr/lib/ruby/1.8/action_controller/base.rb:386:in `call'
  /usr/lib/ruby/1.8/action_controller/routing/route_set.rb:437:in `call'
  /usr/lib/ruby/1.8/action_controller/dispatcher.rb:87:in `dispatch'
  /usr/lib/ruby/1.8/action_controller/dispatcher.rb:121:in `_call'
  /usr/lib/ruby/1.8/action_controller/dispatcher.rb:130:in `build_middleware_stack'
  /usr/lib/ruby/1.8/active_record/query_cache.rb:29:in `call'
  /usr/lib/ruby/1.8/active_record/query_cache.rb:29:in `call'
  /usr/lib/ruby/1.8/active_record/connection_adapters/abstract/query_cache.rb:34:in `cache'
  /usr/lib/ruby/1.8/active_record/query_cache.rb:9:in `cache'
  /usr/lib/ruby/1.8/active_record/query_cache.rb:28:in `call'
  /usr/lib/ruby/1.8/active_record/connection_adapters/abstract/connection_pool.rb:361:in `call'
  /usr/lib/ruby/1.8/action_controller/string_coercion.rb:25:in `call'
  /usr/lib/ruby/1.8/rack/head.rb:9:in `call'
  /usr/lib/ruby/1.8/rack/methodoverride.rb:24:in `call'
  /usr/lib/ruby/1.8/action_controller/params_parser.rb:15:in `call'
  /usr/lib/ruby/1.8/action_controller/session/cookie_store.rb:93:in `call'
  /usr/lib/ruby/1.8/action_controller/failsafe.rb:26:in `call'
  /usr/lib/ruby/1.8/rack/lock.rb:11:in `call'
  /usr/lib/ruby/1.8/rack/lock.rb:11:in `synchronize'
  /usr/lib/ruby/1.8/rack/lock.rb:11:in `call'
  /usr/lib/ruby/1.8/action_controller/dispatcher.rb:106:in `call'
  /usr/lib/ruby/1.8/phusion_passenger/rack/request_handler.rb:92:in `process_request'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_request_handler.rb:207:in `main_loop'
  /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:418:in `start_request_handler'
  /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:358:in `handle_spawn_application'
  /usr/lib/ruby/1.8/phusion_passenger/utils.rb:184:in `safe_fork'
  /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:354:in `handle_spawn_application'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `__send__'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `main_loop'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:163:in `start'
  /usr/lib/ruby/1.8/phusion_passenger/railz/application_spawner.rb:213:in `start'
  /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:262:in `spawn_rails_application'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:126:in `lookup_or_add'
  /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:256:in `spawn_rails_application'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:80:in `synchronize'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server_collection.rb:79:in `synchronize'
  /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:255:in `spawn_rails_application'
  /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:154:in `spawn_application'
  /usr/lib/ruby/1.8/phusion_passenger/spawn_manager.rb:287:in `handle_spawn_application'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `__send__'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:352:in `main_loop'
  /usr/lib/ruby/1.8/phusion_passenger/abstract_server.rb:196:in `start_synchronously'
  /usr/lib/phusion_passenger/passenger-spawn-server:61

Rendering /usr/share/redmine/public/500.html (500 Internal Server Error)

Thank you for your quick answer!

Updated by Christoph Kappel over 1 year ago

Ok, now I just need the exact ruby and rails version and I can start with a try to figure that out.

Updated by Here I. Come over 1 year ago

ruby version 4.5
rails version 2.3.5-1.2+squeeze2

Updated by Christoph Kappel over 1 year ago

Here I. Come wrote:

ruby version 4.5 rails version 2.3.5-1.2+squeeze2

Uhm, ruby 4.5 is certainly not the version you are using. From the backtrace I assume some 1.8.x release so please supply the proper version.

Updated by Here I. Come over 1 year ago

Oh, I'm sorry.

user@host:~$ ruby --version
ruby 1.8.7 (2010-08-16 patchlevel 302) [i486-linux]

Updated by Christoph Kappel over 1 year ago

  • Status changed from Unconfirmed to Closed
  • Assignee set to Christoph Kappel

The error is a case I never tested, when you use rake you need to pass the name of the project to update to rake or otherwise this error appears. Apparently, I cannot use the localization stuff of redmine there so I fixed that and commited the changes.

When you want to update your project you need to do it properly like written in the wiki:

1 ENV=production rake "redmine_buildbot:fetch[NAME_OF_YOUR_PROJECT]"

Updated by Here I. Come over 1 year ago

I've just updated the sources with hg and the problem is still here.

Updated by Christoph Kappel over 1 year ago

Did you read my last post and did exactly what I suggested?

Updated by Here I. Come over 1 year ago

Looks like yes:

RAILS_ENV=production rake "redmine_buildbot:fetch[MY awesome project]" 
(in /usr/share/redmine)
Loaded 0 builder(s)
ERROR: getaddrinfo: Name or service not known
Update complete

Project with the name 'MY awesome project' exists in redmine(the name really does contain spaces).

By the way, I don't understand why you take project name into consideration instead of it's identifier(which seems to be a common pratice in redmine).

Updated by Christoph Kappel over 1 year ago

And you are sure you setup the host correctly?

Updated by Here I. Come over 1 year ago

Yeah, pretty sure about that.

Have a thought: how does your plugin know how project is named in buildbot configuration? I mean 'project name' != 'project-identifier', and for my case 'project-identifier' == 'project-identifier-in-buildbot'.

Updated by Christoph Kappel over 1 year ago

Here I. Come wrote:

Have a thought: how does your plugin know how project is named in buildbot configuration? I mean 'project name' != 'project-identifier', and for my case 'project-identifier' == 'project-identifier-in-buildbot'.

Well, I never considered that because I never use a different values for project name and identifier. I added identifier now and the plugin checks both for a match.

And so far buildbot just supports a single project, at least in the version the plugin is intended for.

Updated by Here I. Come over 1 year ago

Thanks for a fix, but 'getaddrinfo: Name or service not known' problem is still here :-(

Updated by Christoph Kappel over 1 year ago

Are you sure that the host is valid, tried to ping it manually, what did you enter there exactly?

Updated by Here I. Come over 1 year ago

The host is fully functional and there's nothing suspicious about it's network connectivity and other things.

What I did exactly:

root@srv:/usr/share/redmine# RAILS_ENV=production rake "redmine_buildbot:fetch[bam]" 
(in /usr/share/redmine)
Loaded 0 builder(s)
ERROR: getaddrinfo: Name or service not known
Update complete

Updated by Christoph Kappel over 1 year ago

Well, I cannot help, when you don't want to tell me what you've entered. I don't see an error here on my side and my buildbot and the plugin work properly.

Updated by Here I. Come over 1 year ago

I'm pretty sorry that have caused some form of misunderstanding... To be honest, I don't get what you want to see when ask for showing 'what you have entered' :-) thought you want a log for a shell command, that was already shown several times.

Anyway still thanks, will try to dig the issue myself, though knowledge of ruby is the poorest possible...

Updated by Christoph Kappel over 1 year ago

I just want to see what you've inserted in the host field. I don't care if you alter the domain and/or TLD, just want to see what exactly like if there's a https in front of it.

Updated by Here I. Come over 1 year ago

Redmine buildbot settings host field contains the following string: "192.168.1.23:8010", no 'https' or 'http'. Just a plain ip address followed by a colon and a port number.

Updated by Christoph Kappel over 1 year ago

Ah ok, I updated the uri handling and it should work now.

Updated by Here I. Come over 1 year ago

Thank you for your effort, but it's still not over(I'm aware that this is getting on your nerves) :-)

# RAILS_ENV=production rake "redmine_buildbot:fetch[project]" 
(in /usr/share/redmine)
Loaded 0 builder(s)
ERROR: bad URI(is not URI?): 192.168.1.23:8010
Update complete

Updated by Christoph Kappel over 1 year ago

Meh, just add a http:// to the host in the settings. ;)

Updated by Here I. Come over 1 year ago

That's very strange, but I cannot add 'http://'. I can add practically anything: ftp, https, whatever, but not http. If I supply 'http://' at the beginning it reverts the URI back to just plain IP address and port number after pressing 'save' button(this requires going back to settings to check that).

P.S. I'm editing preferences from web interface.

Updated by Here I. Come over 1 year ago

Although, I quite don't know, Ruby, did the dirty hack myself... I'm sure now you'll understand what the real problem was(URI module does not know how to parse something like 172.16.31.27:8080 in my version of Ruby, 1.8.7):

 1 diff -r d5133f3bf44b lib/buildbot/buildbot.rb
 2 --- a/lib/buildbot/buildbot.rb  Fri Feb 03 23:39:24 2012 +0100
 3 +++ b/lib/buildbot/buildbot.rb  Mon Feb 06 17:53:09 2012 +0400
 4 @@ -13,6 +13,12 @@
 5  require "redmine/i18n" 
 6  require "uri" 
 7 
 8 +class String
 9 +  def starts_with_digit?()
10 +    self.match(/^d/) ? true : false
11 +  end
12 +end
13 +
14  module Buildbot
15    # Error classes
16    class ConnectionRefused < StandardError; end
17 @@ -54,7 +60,9 @@
18      $stderr.puts "Loaded #{builders.size} builder(s)" if verbose
19 
20      # Parse URI
21 -    u = URI.parse(settings.host)
22 +    hst = settings.host
23 +    hst.starts_with_digit?() ? hst = "http://" + hst : {}
24 +    u = URI.parse(hst)
25 
26      # Query buildbot via xmlrpc
27      client = XMLRPC::Client.new(u.host, "/xmlrpc",

But. That's not the end of the tragedy. The real problem now is: http://trac.buildbot.net/ticket/832 and that's an epic fail :-D

Updated by Christoph Kappel over 1 year ago

I know that the uri module cannot do that, but the real problem was the lack of information. It took me several tries until you told me what you've entered there and then it was a local address.

Until the buildbot guys provide sane docs about the new system I won't update all my buildbots and this plugin, sorry.

Updated by Here I. Come over 1 year ago

Christoph Kappel wrote:

Until the buildbot guys provide sane docs about the new system I won't update all my buildbots and this plugin, sorry.

Really bad news, because currently I do not have free time for digging Ruby further, unless my employee pays for that... :-(

Updated by Christoph Kappel over 1 year ago

Here I. Come wrote:

Really bad news, because currently I do not have free time for digging Ruby further, unless my employee pays for that... :-(

Well, I have the same problem - reworking the plugin surely takes lots of time and I never liked their decision in the first place. You can see my complaints in the ticket you've linked. I'll see, if there are finally some docs about.

Updated by Here I. Come over 1 year ago

Christoph Kappel wrote:

I'll see, if there are finally some docs about.

Had a quick look at /json/help on my installation and docs seem pretty enough to emplement it in your architecture. Only one thing needed: a wrapper(it's better, I think, because the plugin can support old and newer versions of buildbot) or a rewrite of XML-RPC to fit with JSON interface.

Updated by Christoph Kappel over 1 year ago

The docs still suck, apparently there is no replacement for the getAllBuildsInIntervall call of the older xmlrpc interface. Need to ask in the project channel. Using both in parallel is no problem I guess.

Updated by Christoph Kappel over 1 year ago

  • Status changed from Closed to Feedback

I added a ticket, we'll see. http://trac.buildbot.net/ticket/2193

Also available in: Atom PDF