voxpupuli / puppet_webhook

Sinatra-based application that triggers puppet-related commands from VCS Webhook calls
Apache License 2.0
13 stars 7 forks source link

ArgumentError - wrong number of arguments (given 1, expected 2) #136

Closed bastelfreak closed 4 years ago

bastelfreak commented 4 years ago

I configured the webhook to receive data from github enterprise 2.21.0. The puppet module repositories send them to /api/v1/r10k/module and the controlrepository to /api/v1/r10k/environment. I see the following error in my journal

Jul 21 08:39:38 puppetwebhook bundle[6379]: 2020-07-21 08:39:38 - ArgumentError - wrong number of arguments (given 1, expected 2): 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/puppet_webhook/parsers.rb:22:in `initialize' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/app/controllers/api/v1/r10k/module_controller.rb:12:in `new' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/app/controllers/api/v1/r10k/module_controller.rb:12:in `block in <class:ModuleController>' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1636:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1636:in `block in compile!' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:987:in `block (3 levels) in route!' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1006:in `route_eval' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:987:in `block (2 levels) in route!' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1035:in `block in process_route' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1033:in `catch' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1033:in `process_route' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:985:in `block in route!' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:984:in `each' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:984:in `route!' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1098:in `block in dispatch!' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1072:in `block in invoke' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1072:in `catch' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1072:in `invoke' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1095:in `dispatch!' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:919:in `block in call!' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1072:in `block in invoke' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1072:in `catch' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1072:in `invoke' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:919:in `call!' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:908:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/rack-protection-2.0.8.1/lib/rack/protection/xss_header.rb:18:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/rack-protection-2.0.8.1/lib/rack/protection/path_traversal.rb:16:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/rack-protection-2.0.8.1/lib/rack/protection/json_csrf.rb:26:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/rack-protection-2.0.8.1/lib/rack/protection/base.rb:50:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/rack-protection-2.0.8.1/lib/rack/protection/base.rb:50:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/rack-protection-2.0.8.1/lib/rack/protection/frame_options.rb:31:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/rack-2.0.8/lib/rack/null_logger.rb:9:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/rack-2.0.8/lib/rack/head.rb:12:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:194:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1951:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:966:in `forward' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1052:in `route_missing' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1001:in `route!' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:997:in `route!' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:997:in `route!' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1098:in `block in dispatch!' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1072:in `block in invoke' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1072:in `catch' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1072:in `invoke' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1095:in `dispatch!' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:919:in `block in call!' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1072:in `block in invoke' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1072:in `catch' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1072:in `invoke' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:919:in `call!' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:908:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/rack-protection-2.0.8.1/lib/rack/protection/xss_header.rb:18:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/rack-protection-2.0.8.1/lib/rack/protection/path_traversal.rb:16:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/rack-protection-2.0.8.1/lib/rack/protection/json_csrf.rb:26:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/rack-protection-2.0.8.1/lib/rack/protection/base.rb:50:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/rack-protection-2.0.8.1/lib/rack/protection/base.rb:50:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/rack-protection-2.0.8.1/lib/rack/protection/frame_options.rb:31:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/rack-2.0.8/lib/rack/null_logger.rb:9:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/rack-2.0.8/lib/rack/head.rb:12:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:194:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1951:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:966:in `forward' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1052:in `route_missing' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1001:in `route!' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:997:in `route!' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:997:in `route!' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1098:in `block in dispatch!' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1072:in `block in invoke' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1072:in `catch' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1072:in `invoke' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1095:in `dispatch!' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:919:in `block in call!' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1072:in `block in invoke' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1072:in `catch' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1072:in `invoke' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:919:in `call!' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:908:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/warden-1.2.8/lib/warden/manager.rb:36:in `block in call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/warden-1.2.8/lib/warden/manager.rb:34:in `catch' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/warden-1.2.8/lib/warden/manager.rb:34:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/rack-protection-2.0.8.1/lib/rack/protection/xss_header.rb:18:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/rack-protection-2.0.8.1/lib/rack/protection/path_traversal.rb:16:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/rack-protection-2.0.8.1/lib/rack/protection/json_csrf.rb:26:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/rack-protection-2.0.8.1/lib/rack/protection/base.rb:50:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/rack-protection-2.0.8.1/lib/rack/protection/base.rb:50:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/rack-protection-2.0.8.1/lib/rack/protection/frame_options.rb:31:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/rack-2.0.8/lib/rack/null_logger.rb:9:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/rack-2.0.8/lib/rack/head.rb:12:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:194:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/sinatra-2.0.8.1/lib/sinatra/base.rb:1951:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/rack-2.0.8/lib/rack/urlmap.rb:68:in `block in call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/rack-2.0.8/lib/rack/urlmap.rb:53:in `each' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/rack-2.0.8/lib/rack/urlmap.rb:53:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/puma-4.3.5/lib/puma/configuration.rb:228:in `call' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/puma-4.3.5/lib/puma/server.rb:713:in `handle_request' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/puma-4.3.5/lib/puma/server.rb:472:in `process_client' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/puma-4.3.5/lib/puma/server.rb:328:in `block in run' 
Jul 21 08:39:38 puppetwebhook bundle[6379]: /opt/voxpupuli/webhook/lib/ruby/gems/2.6.0/gems/puma-4.3.5/lib/puma/thread_pool.rb:134:in `block in spawn_thread'

I enabled the 'send all events' option on GitHub. I'm not sure if that caused the errors. But still the app should not crash. I now selected the 'send only push events' and will check if it now works properly.

bastelfreak commented 4 years ago

I can confirm that I see this error on a push event to a module repository.