You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jclouds.apache.org by Jayant Kaushal <aw...@gmail.com> on 2014/01/11 17:17:55 UTC

Error Running mysql from jclouds

I am trying to execute mysql::server  on ubuntu precise image. some how the
recipes are not getting executed through jclouds api's. if i execute the
role going inside the vm
it works absolutely fine. but with jclouds api's it fails. please check the
output from jcloud's API.

this is my role
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
{"name": "mysql-RNFcW3-Role","description":"mysql-RNFW2-Role: created by
Jayant","default_attributes":{},"override_attributes":{"mysql":
{"server_debian_password":"randomly
generated","server_repl_password":"randomly
generated","server_root_password":"randomly
generated"}},"json_class":"Chef::Role","chef_type":"role","run_list":["recipe[mysql]","recipe[mysql::server]"]}
~
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
here is the stack trace.

{RegionOne/99ebf04c-6e23-4b2e-b603-0e8b4cb4834c={output=[2014-01-11T15:51:30+00:00]
INFO: Forking chef instance to converge...
[2014-01-11T15:51:30+00:00] INFO: *** Chef 11.8.2 ***
[2014-01-11T15:51:30+00:00] INFO: Chef-client pid: 12664
[2014-01-11T15:51:30+00:00] INFO: Setting the run_list to
["role[mysql-RNFW2-Role]"] from JSON
[2014-01-11T15:51:30+00:00] INFO: Run List is [role[mysql-RNFW2-Role]]
[2014-01-11T15:51:30+00:00] INFO: Run List expands to [mysql, mysql::server]
[2014-01-11T15:51:30+00:00] INFO: Starting Chef Run for mysql-RNFW2-Node
[2014-01-11T15:51:30+00:00] INFO: Running start handlers
[2014-01-11T15:51:30+00:00] INFO: Start handlers complete.
[2014-01-11T15:51:30+00:00] WARN: Cloning resource attributes for
directory[/var/lib/mysql] from prior resource (CHEF-3694)
[2014-01-11T15:51:30+00:00] WARN: Previous directory[/var/lib/mysql]:
/var/chef/cookbooks/mysql/recipes/server.rb:108:in `block in from_file'
[2014-01-11T15:51:30+00:00] WARN: Current  directory[/var/lib/mysql]:
/var/chef/cookbooks/mysql/recipes/server.rb:108:in `block in from_file'
[2014-01-11T15:51:30+00:00] INFO: Could not find previously defined
grants.sql resource
[2014-01-11T15:51:30+00:00] WARN: Cloning resource attributes for
service[mysql] from prior resource (CHEF-3694)
[2014-01-11T15:51:30+00:00] WARN: Previous service[mysql]:
/var/chef/cookbooks/mysql/recipes/server.rb:154:in `from_file'
[2014-01-11T15:51:30+00:00] WARN: Current  service[mysql]:
/var/chef/cookbooks/mysql/recipes/server.rb:218:in `from_file'
[2014-01-11T15:51:30+00:00] INFO: Processing package[mysql-client] action
install (mysql::client line 46)
[2014-01-11T15:51:30+00:00] INFO: SIGHUP received, reconfiguring
[2014-01-11T15:51:30+00:00] INFO: Running queued delayed notifications
before re-raising exception
[2014-01-11T15:51:30+00:00] ERROR: Running exception handlers
[2014-01-11T15:51:30+00:00] ERROR: Exception handlers complete
[2014-01-11T15:51:30+00:00] FATAL: Stacktrace dumped to
/var/chef/chef-stacktrace.out
[2014-01-11T15:51:30+00:00] ERROR: package[mysql-client] (mysql::client
line 46) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected
process to exit with [0], but received ''
---- Begin output of apt-cache policy mysql-client ----
STDOUT:
STDERR:
---- End output of apt-cache policy mysql-client ----
Ran apt-cache policy mysql-client returned

================================================================================
Error executing action `install` on resource
'package[mysql-client]'
================================================================================


Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received ''
---- Begin output of apt-cache policy mysql-client ----
STDOUT:
STDERR:
---- End output of apt-cache policy mysql-client ----
Ran apt-cache policy mysql-client returned 


Resource Declaration:
---------------------
# In /var/chef/cookbooks/mysql/recipes/client.rb

 46:   package mysql_pack do
 47:     action :install
 48:   end
 49: end



Compiled Resource:
------------------
# Declared in /var/chef/cookbooks/mysql/recipes/client.rb:46:in `block in
from_file'

package("mysql-client") do
  action [:install]
  retries 0
  retry_delay 2
  package_name "mysql-client"
  cookbook_name :mysql
  recipe_name "client"
end



[2014-01-11T15:51:30+00:00] INFO: Forking chef instance to converge...
[2014-01-11T15:51:30+00:00] INFO: SIGHUP received, reconfiguring
[2014-01-11T15:51:30+00:00] FATAL: Chef::Exceptions::ChildConvergeError:
Chef run process exited unsuccessfully (exit code 1)
, error=, exitStatus=1}}

-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
What does this mean.please help.

Regards
Jayant Kaushal

Re: Error Running mysql from jclouds

Posted by Jayant Kaushal <aw...@gmail.com>.
Adding chef dev lists as well.

Regards
Jayant Kaushal



On Sat, Jan 11, 2014 at 9:47 PM, Jayant Kaushal <aw...@gmail.com>wrote:

> I am trying to execute mysql::server  on ubuntu precise image. some how
> the recipes are not getting executed through jclouds api's. if i execute
> the role going inside the vm
> it works absolutely fine. but with jclouds api's it fails. please check
> the output from jcloud's API.
>
> this is my role
>
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> {"name": "mysql-RNFcW3-Role","description":"mysql-RNFW2-Role: created by
> Jayant","default_attributes":{},"override_attributes":{"mysql":
> {"server_debian_password":"randomly
> generated","server_repl_password":"randomly
> generated","server_root_password":"randomly
> generated"}},"json_class":"Chef::Role","chef_type":"role","run_list":["recipe[mysql]","recipe[mysql::server]"]}
> ~
>
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> here is the stack trace.
>
> {RegionOne/99ebf04c-6e23-4b2e-b603-0e8b4cb4834c={output=[2014-01-11T15:51:30+00:00]
> INFO: Forking chef instance to converge...
> [2014-01-11T15:51:30+00:00] INFO: *** Chef 11.8.2 ***
> [2014-01-11T15:51:30+00:00] INFO: Chef-client pid: 12664
> [2014-01-11T15:51:30+00:00] INFO: Setting the run_list to
> ["role[mysql-RNFW2-Role]"] from JSON
> [2014-01-11T15:51:30+00:00] INFO: Run List is [role[mysql-RNFW2-Role]]
> [2014-01-11T15:51:30+00:00] INFO: Run List expands to [mysql,
> mysql::server]
> [2014-01-11T15:51:30+00:00] INFO: Starting Chef Run for mysql-RNFW2-Node
> [2014-01-11T15:51:30+00:00] INFO: Running start handlers
> [2014-01-11T15:51:30+00:00] INFO: Start handlers complete.
> [2014-01-11T15:51:30+00:00] WARN: Cloning resource attributes for
> directory[/var/lib/mysql] from prior resource (CHEF-3694)
> [2014-01-11T15:51:30+00:00] WARN: Previous directory[/var/lib/mysql]:
> /var/chef/cookbooks/mysql/recipes/server.rb:108:in `block in from_file'
> [2014-01-11T15:51:30+00:00] WARN: Current  directory[/var/lib/mysql]:
> /var/chef/cookbooks/mysql/recipes/server.rb:108:in `block in from_file'
> [2014-01-11T15:51:30+00:00] INFO: Could not find previously defined
> grants.sql resource
> [2014-01-11T15:51:30+00:00] WARN: Cloning resource attributes for
> service[mysql] from prior resource (CHEF-3694)
> [2014-01-11T15:51:30+00:00] WARN: Previous service[mysql]:
> /var/chef/cookbooks/mysql/recipes/server.rb:154:in `from_file'
> [2014-01-11T15:51:30+00:00] WARN: Current  service[mysql]:
> /var/chef/cookbooks/mysql/recipes/server.rb:218:in `from_file'
> [2014-01-11T15:51:30+00:00] INFO: Processing package[mysql-client] action
> install (mysql::client line 46)
> [2014-01-11T15:51:30+00:00] INFO: SIGHUP received, reconfiguring
> [2014-01-11T15:51:30+00:00] INFO: Running queued delayed notifications
> before re-raising exception
> [2014-01-11T15:51:30+00:00] ERROR: Running exception handlers
> [2014-01-11T15:51:30+00:00] ERROR: Exception handlers complete
> [2014-01-11T15:51:30+00:00] FATAL: Stacktrace dumped to
> /var/chef/chef-stacktrace.out
> [2014-01-11T15:51:30+00:00] ERROR: package[mysql-client] (mysql::client
> line 46) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected
> process to exit with [0], but received ''
> ---- Begin output of apt-cache policy mysql-client ----
> STDOUT:
> STDERR:
> ---- End output of apt-cache policy mysql-client ----
> Ran apt-cache policy mysql-client returned
>  [0m
> ================================================================================
> [0m
> [31mError executing action `install` on resource 'package[mysql-client]'
> [0m
> ================================================================================
> [0m
>
> [0m
> Mixlib::ShellOut::ShellCommandFailed [0m
> ------------------------------------ [0m
> Expected process to exit with [0], but received ''
> ---- Begin output of apt-cache policy mysql-client ----
> STDOUT:
> STDERR:
> ---- End output of apt-cache policy mysql-client ----
> Ran apt-cache policy mysql-client returned [0m
>
> [0m
> Resource Declaration: [0m
> --------------------- [0m
> # In /var/chef/cookbooks/mysql/recipes/client.rb
>
>  46:   package mysql_pack do
>  47:     action :install
>  48:   end
>  49: end
>  [0m
>
> [0m
> Compiled Resource: [0m
> ------------------ [0m
> # Declared in /var/chef/cookbooks/mysql/recipes/client.rb:46:in `block in
> from_file'
>
> package("mysql-client") do
>   action [:install]
>   retries 0
>   retry_delay 2
>   package_name "mysql-client"
>   cookbook_name :mysql
>   recipe_name "client"
> end
> [0m
>
> [0m
> [2014-01-11T15:51:30+00:00] INFO: Forking chef instance to converge...
> [2014-01-11T15:51:30+00:00] INFO: SIGHUP received, reconfiguring
> [2014-01-11T15:51:30+00:00] FATAL: Chef::Exceptions::ChildConvergeError:
> Chef run process exited unsuccessfully (exit code 1)
> , error=, exitStatus=1}}
>
>
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> What does this mean.please help.
>
> Regards
> Jayant Kaushal
>
>

Re: Error Running mysql from jclouds

Posted by Jayant Kaushal <aw...@gmail.com>.
yes. made it work.thanks man.


Regards
Jayant Kaushal



On Sun, Jan 12, 2014 at 12:59 PM, Ignasi Barrera
<ig...@gmail.com>wrote:

> So you are using ChefSolo.
>
> Cloud you try removimg the InstallRuby and the InstallChefGems statements
> and using the InstallChefUsingOmnibus instead to install Chef?
> El 12/01/2014 08:21, "Jayant Kaushal" <aw...@gmail.com> escribió:
>
> I am using jclouds 1.7
>> i found the issue last night about apt cookbook( ur morning may be).
>> added all 3 recipes of apt.somehow it worked as well.
>> here is my piece of code.
>>
>>   if(jsonAttributes != null && StringUtils.isNotBlank(jsonAttributes)) {
>>       attributes = getOverridableAttributes(jsonAttributes);
>>     }
>>
>>     if(attributes != null && StringUtils.isNotBlank(attributes)) {
>>       //apply override attributes with role
>>       Role role = prepareRole(recipeList, chefBuilder, jsonAttributes,
>> roleName);
>>
>> bootstrapBuilder.add(chefBuilder.cookbookPath(cookBookPath).defineRole(role).runlist(RunList.builder().role(roleName).build()).build());
>>     } else {
>>
>> bootstrapBuilder.add(chefBuilder.cookbookPath(cookBookPath).runlist(RunList.builder().recipes(recipeList).build()).build());
>>     }
>>
>>     // Build the statement that will perform all the operations above
>>     StatementList bootstrap = new StatementList(bootstrapBuilder.build());
>>
>>     if(log.isDebugEnabled()) {
>>       log.debug("{} - about to run chef solo RunList", contextKey);
>>     }
>>     // Run the script in the nodes of the group
>>     scriptOptions.overrideAuthenticateSudo(true);
>>     String output = runScriptOnNodes(allNodes, computeService,
>> scriptOptions, bootstrap);
>>
>>     // on a successful install, read the environment back
>>     if(log.isDebugEnabled()) {
>>       log.debug("{} - Executed RunList successfully - {} ", contextKey,
>> recipes);
>>     }
>> is there any thing to be done
>> with  scriptOptions.overrideAuthenticateSudo(true);
>>
>> also the InstallRuby,InstallRubyGems and InstallChefGems is failing for
>> the amazon ami-1bf9de5e
>>
>>
>>
>> Regards
>> Jayant Kaushal
>>
>>
>>
>> On Sun, Jan 12, 2014 at 12:40 PM, Ignasi Barrera <
>> ignasi.barrera@gmail.com> wrote:
>>
>>> As suggested in the chef user list, have you tried to add the "apt"
>>> cookbook to tbe runlist?
>>>
>>> Which jclouds/jclouds-chef versions are you using? Could you also share
>>> the code you use to configure chef and run it on the node?  Is it running
>>> as root (or with sudo)?
>>>
>>> I.
>>> El 11/01/2014 20:09, "Jayant Kaushal" <aw...@gmail.com> escribió:
>>>
>>> Adding Ahmed. i guess you also made some progress on this
>>>>
>>>> Regards
>>>> Jayant Kaushal
>>>>
>>>>
>>>>
>>>> On Sat, Jan 11, 2014 at 11:15 PM, Andrew Phillips <an...@apache.org>wrote:
>>>>
>>>>>  [2014-01-11T15:51:30+00:00] ERROR: package[mysql-client]
>>>>>>> (mysql::client
>>>>>>> line 46) had an error: Mixlib::ShellOut::ShellCommandFailed:
>>>>>>> Expected
>>>>>>> process to exit with [0], but received ''
>>>>>>>
>>>>>>
>>>>> If you run the process on the machine itself, what is its exit code
>>>>> [1]? If you want to invoke it through jclouds, it needs to return an exit
>>>>> code of 0 if successful (as per Unix convention).
>>>>>
>>>>> ap
>>>>>
>>>>> [1] http://www.cyberciti.biz/faq/shell-how-to-determine-the-
>>>>> exit-status-of-linux-and-unix-command/
>>>>>
>>>>
>>>>
>>

Re: Error Running mysql from jclouds

Posted by Ignasi Barrera <ig...@gmail.com>.
So you are using ChefSolo.

Cloud you try removimg the InstallRuby and the InstallChefGems statements
and using the InstallChefUsingOmnibus instead to install Chef?
El 12/01/2014 08:21, "Jayant Kaushal" <aw...@gmail.com> escribió:

> I am using jclouds 1.7
> i found the issue last night about apt cookbook( ur morning may be). added
> all 3 recipes of apt.somehow it worked as well.
> here is my piece of code.
>
>  if(jsonAttributes != null && StringUtils.isNotBlank(jsonAttributes)) {
>       attributes = getOverridableAttributes(jsonAttributes);
>     }
>
>     if(attributes != null && StringUtils.isNotBlank(attributes)) {
>       //apply override attributes with role
>       Role role = prepareRole(recipeList, chefBuilder, jsonAttributes,
> roleName);
>
> bootstrapBuilder.add(chefBuilder.cookbookPath(cookBookPath).defineRole(role).runlist(RunList.builder().role(roleName).build()).build());
>     } else {
>
> bootstrapBuilder.add(chefBuilder.cookbookPath(cookBookPath).runlist(RunList.builder().recipes(recipeList).build()).build());
>     }
>
>     // Build the statement that will perform all the operations above
>     StatementList bootstrap = new StatementList(bootstrapBuilder.build());
>
>     if(log.isDebugEnabled()) {
>       log.debug("{} - about to run chef solo RunList", contextKey);
>     }
>     // Run the script in the nodes of the group
>     scriptOptions.overrideAuthenticateSudo(true);
>     String output = runScriptOnNodes(allNodes, computeService,
> scriptOptions, bootstrap);
>
>     // on a successful install, read the environment back
>     if(log.isDebugEnabled()) {
>       log.debug("{} - Executed RunList successfully - {} ", contextKey,
> recipes);
>     }
> is there any thing to be done
> with  scriptOptions.overrideAuthenticateSudo(true);
>
> also the InstallRuby,InstallRubyGems and InstallChefGems is failing for
> the amazon ami-1bf9de5e
>
>
>
> Regards
> Jayant Kaushal
>
>
>
> On Sun, Jan 12, 2014 at 12:40 PM, Ignasi Barrera <ignasi.barrera@gmail.com
> > wrote:
>
>> As suggested in the chef user list, have you tried to add the "apt"
>> cookbook to tbe runlist?
>>
>> Which jclouds/jclouds-chef versions are you using? Could you also share
>> the code you use to configure chef and run it on the node?  Is it running
>> as root (or with sudo)?
>>
>> I.
>> El 11/01/2014 20:09, "Jayant Kaushal" <aw...@gmail.com> escribió:
>>
>> Adding Ahmed. i guess you also made some progress on this
>>>
>>> Regards
>>> Jayant Kaushal
>>>
>>>
>>>
>>> On Sat, Jan 11, 2014 at 11:15 PM, Andrew Phillips <an...@apache.org>wrote:
>>>
>>>>  [2014-01-11T15:51:30+00:00] ERROR: package[mysql-client] (mysql::client
>>>>>> line 46) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected
>>>>>> process to exit with [0], but received ''
>>>>>>
>>>>>
>>>> If you run the process on the machine itself, what is its exit code
>>>> [1]? If you want to invoke it through jclouds, it needs to return an exit
>>>> code of 0 if successful (as per Unix convention).
>>>>
>>>> ap
>>>>
>>>> [1] http://www.cyberciti.biz/faq/shell-how-to-determine-the-
>>>> exit-status-of-linux-and-unix-command/
>>>>
>>>
>>>
>

Re: Error Running mysql from jclouds

Posted by Jayant Kaushal <aw...@gmail.com>.
I am using jclouds 1.7
i found the issue last night about apt cookbook( ur morning may be). added
all 3 recipes of apt.somehow it worked as well.
here is my piece of code.

 if(jsonAttributes != null && StringUtils.isNotBlank(jsonAttributes)) {
      attributes = getOverridableAttributes(jsonAttributes);
    }

    if(attributes != null && StringUtils.isNotBlank(attributes)) {
      //apply override attributes with role
      Role role = prepareRole(recipeList, chefBuilder, jsonAttributes,
roleName);

bootstrapBuilder.add(chefBuilder.cookbookPath(cookBookPath).defineRole(role).runlist(RunList.builder().role(roleName).build()).build());
    } else {

bootstrapBuilder.add(chefBuilder.cookbookPath(cookBookPath).runlist(RunList.builder().recipes(recipeList).build()).build());
    }

    // Build the statement that will perform all the operations above
    StatementList bootstrap = new StatementList(bootstrapBuilder.build());

    if(log.isDebugEnabled()) {
      log.debug("{} - about to run chef solo RunList", contextKey);
    }
    // Run the script in the nodes of the group
    scriptOptions.overrideAuthenticateSudo(true);
    String output = runScriptOnNodes(allNodes, computeService,
scriptOptions, bootstrap);

    // on a successful install, read the environment back
    if(log.isDebugEnabled()) {
      log.debug("{} - Executed RunList successfully - {} ", contextKey,
recipes);
    }
is there any thing to be done
with  scriptOptions.overrideAuthenticateSudo(true);

also the InstallRuby,InstallRubyGems and InstallChefGems is failing for the
amazon ami-1bf9de5e



Regards
Jayant Kaushal



On Sun, Jan 12, 2014 at 12:40 PM, Ignasi Barrera
<ig...@gmail.com>wrote:

> As suggested in the chef user list, have you tried to add the "apt"
> cookbook to tbe runlist?
>
> Which jclouds/jclouds-chef versions are you using? Could you also share
> the code you use to configure chef and run it on the node?  Is it running
> as root (or with sudo)?
>
> I.
> El 11/01/2014 20:09, "Jayant Kaushal" <aw...@gmail.com> escribió:
>
> Adding Ahmed. i guess you also made some progress on this
>>
>> Regards
>> Jayant Kaushal
>>
>>
>>
>> On Sat, Jan 11, 2014 at 11:15 PM, Andrew Phillips <an...@apache.org>wrote:
>>
>>>  [2014-01-11T15:51:30+00:00] ERROR: package[mysql-client] (mysql::client
>>>>> line 46) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected
>>>>> process to exit with [0], but received ''
>>>>>
>>>>
>>> If you run the process on the machine itself, what is its exit code [1]?
>>> If you want to invoke it through jclouds, it needs to return an exit code
>>> of 0 if successful (as per Unix convention).
>>>
>>> ap
>>>
>>> [1] http://www.cyberciti.biz/faq/shell-how-to-determine-the-
>>> exit-status-of-linux-and-unix-command/
>>>
>>
>>

Re: Error Running mysql from jclouds

Posted by Ignasi Barrera <ig...@gmail.com>.
As suggested in the chef user list, have you tried to add the "apt"
cookbook to tbe runlist?

Which jclouds/jclouds-chef versions are you using? Could you also share the
code you use to configure chef and run it on the node?  Is it running as
root (or with sudo)?

I.
El 11/01/2014 20:09, "Jayant Kaushal" <aw...@gmail.com> escribió:

> Adding Ahmed. i guess you also made some progress on this
>
> Regards
> Jayant Kaushal
>
>
>
> On Sat, Jan 11, 2014 at 11:15 PM, Andrew Phillips <an...@apache.org>wrote:
>
>>  [2014-01-11T15:51:30+00:00] ERROR: package[mysql-client] (mysql::client
>>>> line 46) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected
>>>> process to exit with [0], but received ''
>>>>
>>>
>> If you run the process on the machine itself, what is its exit code [1]?
>> If you want to invoke it through jclouds, it needs to return an exit code
>> of 0 if successful (as per Unix convention).
>>
>> ap
>>
>> [1] http://www.cyberciti.biz/faq/shell-how-to-determine-the-
>> exit-status-of-linux-and-unix-command/
>>
>
>

Re: Error Running mysql from jclouds

Posted by Jayant Kaushal <aw...@gmail.com>.
Adding Ahmed. i guess you also made some progress on this

Regards
Jayant Kaushal



On Sat, Jan 11, 2014 at 11:15 PM, Andrew Phillips <an...@apache.org>wrote:

> [2014-01-11T15:51:30+00:00] ERROR: package[mysql-client] (mysql::client
>>> line 46) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected
>>> process to exit with [0], but received ''
>>>
>>
> If you run the process on the machine itself, what is its exit code [1]?
> If you want to invoke it through jclouds, it needs to return an exit code
> of 0 if successful (as per Unix convention).
>
> ap
>
> [1] http://www.cyberciti.biz/faq/shell-how-to-determine-the-
> exit-status-of-linux-and-unix-command/
>

Re: Error Running mysql from jclouds

Posted by Andrew Phillips <an...@apache.org>.
>> [2014-01-11T15:51:30+00:00] ERROR: package[mysql-client] (mysql::client
>> line 46) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected
>> process to exit with [0], but received ''

If you run the process on the machine itself, what is its exit code  
[1]? If you want to invoke it through jclouds, it needs to return an  
exit code of 0 if successful (as per Unix convention).

ap

[1]  
http://www.cyberciti.biz/faq/shell-how-to-determine-the-exit-status-of-linux-and-unix-command/

Re: Error Running mysql from jclouds

Posted by Andrew Phillips <an...@apache.org>.
[moving to user@j.a.o...]

ap

> I am trying to execute mysql::server  on ubuntu precise image. some how the
> recipes are not getting executed through jclouds api's. if i execute the
> role going inside the vm
> it works absolutely fine. but with jclouds api's it fails. please check the
> output from jcloud's API.
>
> this is my role
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> {"name": "mysql-RNFcW3-Role","description":"mysql-RNFW2-Role: created by
> Jayant","default_attributes":{},"override_attributes":{"mysql":
> {"server_debian_password":"randomly
> generated","server_repl_password":"randomly
> generated","server_root_password":"randomly
> generated"}},"json_class":"Chef::Role","chef_type":"role","run_list":["recipe[mysql]","recipe[mysql::server]"]}
> ~
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> here is the stack trace.
>
> {RegionOne/99ebf04c-6e23-4b2e-b603-0e8b4cb4834c={output=[2014-01-11T15:51:30+00:00]
> INFO: Forking chef instance to converge...
> [2014-01-11T15:51:30+00:00] INFO: *** Chef 11.8.2 ***
> [2014-01-11T15:51:30+00:00] INFO: Chef-client pid: 12664
> [2014-01-11T15:51:30+00:00] INFO: Setting the run_list to
> ["role[mysql-RNFW2-Role]"] from JSON
> [2014-01-11T15:51:30+00:00] INFO: Run List is [role[mysql-RNFW2-Role]]
> [2014-01-11T15:51:30+00:00] INFO: Run List expands to [mysql, mysql::server]
> [2014-01-11T15:51:30+00:00] INFO: Starting Chef Run for mysql-RNFW2-Node
> [2014-01-11T15:51:30+00:00] INFO: Running start handlers
> [2014-01-11T15:51:30+00:00] INFO: Start handlers complete.
> [2014-01-11T15:51:30+00:00] WARN: Cloning resource attributes for
> directory[/var/lib/mysql] from prior resource (CHEF-3694)
> [2014-01-11T15:51:30+00:00] WARN: Previous directory[/var/lib/mysql]:
> /var/chef/cookbooks/mysql/recipes/server.rb:108:in `block in from_file'
> [2014-01-11T15:51:30+00:00] WARN: Current  directory[/var/lib/mysql]:
> /var/chef/cookbooks/mysql/recipes/server.rb:108:in `block in from_file'
> [2014-01-11T15:51:30+00:00] INFO: Could not find previously defined
> grants.sql resource
> [2014-01-11T15:51:30+00:00] WARN: Cloning resource attributes for
> service[mysql] from prior resource (CHEF-3694)
> [2014-01-11T15:51:30+00:00] WARN: Previous service[mysql]:
> /var/chef/cookbooks/mysql/recipes/server.rb:154:in `from_file'
> [2014-01-11T15:51:30+00:00] WARN: Current  service[mysql]:
> /var/chef/cookbooks/mysql/recipes/server.rb:218:in `from_file'
> [2014-01-11T15:51:30+00:00] INFO: Processing package[mysql-client] action
> install (mysql::client line 46)
> [2014-01-11T15:51:30+00:00] INFO: SIGHUP received, reconfiguring
> [2014-01-11T15:51:30+00:00] INFO: Running queued delayed notifications
> before re-raising exception
> [2014-01-11T15:51:30+00:00] ERROR: Running exception handlers
> [2014-01-11T15:51:30+00:00] ERROR: Exception handlers complete
> [2014-01-11T15:51:30+00:00] FATAL: Stacktrace dumped to
> /var/chef/chef-stacktrace.out
> [2014-01-11T15:51:30+00:00] ERROR: package[mysql-client] (mysql::client
> line 46) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected
> process to exit with [0], but received ''
> ---- Begin output of apt-cache policy mysql-client ----
> STDOUT:
> STDERR:
> ---- End output of apt-cache policy mysql-client ----
> Ran apt-cache policy mysql-client returned
> 
> ================================================================================
> Error executing action `install` on resource
> 'package[mysql-client]'
> ================================================================================
>
> 
> Mixlib::ShellOut::ShellCommandFailed
> ------------------------------------
> Expected process to exit with [0], but received ''
> ---- Begin output of apt-cache policy mysql-client ----
> STDOUT:
> STDERR:
> ---- End output of apt-cache policy mysql-client ----
> Ran apt-cache policy mysql-client returned 
>
> 
> Resource Declaration:
> ---------------------
> # In /var/chef/cookbooks/mysql/recipes/client.rb
>
>  46:   package mysql_pack do
>  47:     action :install
>  48:   end
>  49: end
> 
>
> 
> Compiled Resource:
> ------------------
> # Declared in /var/chef/cookbooks/mysql/recipes/client.rb:46:in `block in
> from_file'
>
> package("mysql-client") do
>   action [:install]
>   retries 0
>   retry_delay 2
>   package_name "mysql-client"
>   cookbook_name :mysql
>   recipe_name "client"
> end
> 
>
> 
> [2014-01-11T15:51:30+00:00] INFO: Forking chef instance to converge...
> [2014-01-11T15:51:30+00:00] INFO: SIGHUP received, reconfiguring
> [2014-01-11T15:51:30+00:00] FATAL: Chef::Exceptions::ChildConvergeError:
> Chef run process exited unsuccessfully (exit code 1)
> , error=, exitStatus=1}}
>
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> What does this mean.please help.
>
> Regards
> Jayant Kaushal