Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Could not generate xml when using supervisord #61

Open
albundy83 opened this issue Feb 11, 2015 · 5 comments
Open

Could not generate xml when using supervisord #61

albundy83 opened this issue Feb 11, 2015 · 5 comments

Comments

@albundy83
Copy link

Hello,

here the problem I encounter when I use supervisord :

[2015-02-11T08:59:36+01:00] ERROR: === could not generate xml for {"name"=>"XXXXXXXXX", "chef_environment"=>"int", "run_list"=>#<Chef::RunList:0x00000002bf58e0 @run_list_items=[#<Chef::RunList::RunListItem:0x00000002be13b8 @Version=nil, @type=:role, @name="base">, #<Chef::RunList::RunListItem:0x00000002be12f0 @Version=nil, @type=:role, @name="load_balancer">]>, "recipes"=>[], "roles"=>["base", "load_balancer"], "fqdn"=>"XXXXXXXXX", "hostname"=>"XXXXXXXXX", "kernel_machine"=>"x86_64", "kernel_os"=>"GNU/Linux", "platform"=>"debian", "platform_version"=>"7.8", "tags"=>[]}: undefined method unpack' for nil:NilClass [2015-02-11T08:59:36+01:00] ERROR: === could not generate xml for {"name"=>"XXXXXXXXX", "chef_environment"=>"int", "run_list"=>#<Chef::RunList:0x00000002be02b0 @run_list_items=[#<Chef::RunList::RunListItem:0x00000002ba4260 @version=nil, @type=:role, @name="base">, #<Chef::RunList::RunListItem:0x00000002ba40d0 @version=nil, @type=:role, @name="tomcat">, #<Chef::RunList::RunListItem:0x00000002ba4328 @version=nil, @type=:role, @name="backend">]>, "recipes"=>[], "roles"=>["base", "tomcat", "backend"], "fqdn"=>"XXXXXXXXX", "hostname"=>"XXXXXXXXX", "kernel_machine"=>"x86_64", "kernel_os"=>"GNU/Linux", "platform"=>"debian", "platform_version"=>"7.8", "tags"=>[]}: undefined methodunpack' for nil:NilClass

I have configured chef-rundeck like this in supervisord :
[program:chef-rundeck-test]
command=/usr/local/rvm/gems/ruby-2.2.0/wrappers/chef-rundeck -c /etc/chef/knife.rb -p 9981 --timeout 80
redirect_stderr=true
stdout_logfile=/var/log/chef-rundeck-int.log

(It works perfectly when I start in in command line...)

Thanks a lot for your help and your great tool.

@albundy83
Copy link
Author

And is it possible to run 2 or 3 chef-rundeck instances in // ?
Something like :
/usr/local/rvm/gems/ruby-2.2.0/wrappers/chef-rundeck -c /etc/chef/knife-1.rb -p 9980 --timeout 80
/usr/local/rvm/gems/ruby-2.2.0/wrappers/chef-rundeck -c /etc/chef/knife-2.rb -p 9981 --timeout 80

@jeunito
Copy link

jeunito commented Jun 11, 2015

Happens to me too using upstart

@jeunito
Copy link

jeunito commented Jun 11, 2015

@albundy83 what did you end up doing? This worked for me via upstart:

script
exec su - ops -c "chef-rundeck -o 0.0.0.0 -c /path/to/knife.rb -t 3600"
end script

@albundy83
Copy link
Author

Hello,
I have create an init.d script :

#/bin/sh
### BEGIN INIT INFO
# Provides:          chef-rundeck
# Required-Start:    
# Required-Stop:     
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Starts chef-rundeck at boot time
# Description:       Starts chef-rundeck at boot time 
### END INIT INFO

chefrundeck=/usr/local/rvm/gems/ruby-2.2.0/wrappers/chef-rundeck
keyspath=/etc/chef_servers/keys
pidpath=/var/lib/rundeck/var/run/chef-rundeck

case "$1" in
    start)
        echo "Starting chef-rundeck for all environments"
        nohup ${chefrundeck} -c ${keyspath}/vault13.gcn-lab.fr_knife.rb -p 9982 --timeout 80 -i dev -u root -P ${pidpath} 2>&1 >> /var/log/chefrundeck-dev.log &
        nohup ${chefrundeck} -c ${keyspath}/int-chef.gcn-eibp.com_knife.rb -p 9981 --timeout 80 -i int -u root -P ${pidpath} 2>&1 >> /var/log/chefrundeck-int.log &
        nohup ${chefrundeck} -c ${keyspath}/chef.gcn-eibp.com_knife.rb -p 9980 --timeout 80 -i prod -u root -P ${pidpath} 2>&1 >> /var/log/chefrundeck-prod.log &

        ;;
    stop)
        echo "Killing all chef-rundeck instances"
        for port in 9980 9981 9982
        do
            if [ -f ${pidpath}-${port}.pid ];
            then
                kill `cat ${pidpath}-${port}.pid`
            fi
        done

        ;;
    restart)
        $0 stop
        $0 start
        ;;
    status)
        echo "Current chef-rundeck running :"
        ;;
    *)
        echo 'Usage: $0 {start|stop|restart|status}'
        exit 1
esac 

@nhuff
Copy link

nhuff commented May 10, 2016

I just ran into this with runit and the problem turned out to be that chef-rundeck tries to get the username from the USER environment variable if you don't set it explicitly with -u. If USER is cleared or not set by the supervisor you get the above error unless you specify the user with -u.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants