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

Update for installation failure in Solaris #233

Closed
wants to merge 6 commits into from

Conversation

ayushbhatt29
Copy link

Signed-off-by: ayushbhatt29 [email protected]

Description

These changes fix installation failure of updated chef-client in Solaris when using this cookbook.

Issues Resolved

Fixes #226

ayushbhatt29 added 2 commits June 9, 2021 13:39
Signed-off-by: ayushbhatt29 <[email protected]>
Signed-off-by: ayushbhatt29 <[email protected]>
@ayushbhatt29
Copy link
Author

Removed delivery.yml as these tests no longer exists.

@ayushbhatt29
Copy link
Author

Please review this @lamont-granquist .

@@ -1,16 +0,0 @@
name: delivery
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this being removed?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was a delivery local mode config which is still used by chef projects

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review @tas50 , i will revert this commit.

@ayushbhatt29 ayushbhatt29 added the Expeditor: Bump Version Minor Used by github.minor_bump_labels to bump the Minor version number. label Sep 17, 2021
ayushbhatt29 added 3 commits September 17, 2021 11:12
Signed-off-by: ayushbhatt29 <[email protected]>
Signed-off-by: ayushbhatt29 <[email protected]>
Signed-off-by: ayushbhatt29 <[email protected]>
@lamont-granquist
Copy link
Contributor

What is actually being fixed here and what is the bug and what is being held onto and not released on solaris in the chef-client installation?

It seems like we're fairly randomly adding a move_opt_chef and then having three copy_opt_chefs added with no explanation of why they're necessary or what underlying bug is actually being worked around.

@ayushbhatt29
Copy link
Author

Hi @lamont-granquist, thank you for reviewing the PR

The real issue was that the chef-client installation at the time of updating through chef_client_cookbook in Solaris was getting corrupted because of /etc/chef folder being present at the time of installation for updated chef-client version which is fixing this issue for installing new version and I have used already defined mov_opt_chef and copy_opt_chef methods to copy & move /etc/chef.

So in this fix I moved /etc/chef directory to an /etc/chef.upgrade directory just as we move /opt/chef at the time of installation and moving it back to /etc/chef after the installation is done.

chef-client command were not working properly because the installation was not happening properly.
I have given below before and after fix of chef-client -v command when we are updating chef-client version through chef_client cookbook.

Before Fix

Starting Chef Infra Client, version 16.8.9
Patents: https://www.chef.io/patents
[2022-01-06T02:37:24-05:00] WARN: Run List override has been provided.
[2022-01-06T02:37:24-05:00] WARN: Original Run List: []
[2022-01-06T02:37:24-05:00] WARN: Overridden Run List: [recipe[chef_client_updater]]
resolving cookbooks for run list: ["chef_client_updater"]
Synchronizing Cookbooks:
  - chef_client_updater (3.12.2)
Installing Cookbook Gems:
Compiling Cookbooks...
Converging 1 resources
Recipe: chef_client_updater::default
  * chef_client_updater[update chef-client] action update
    * chef_gem[mixlib-install] action install
      - install version ~> 3.12 of package mixlib-install
    - move all files under /opt/chef to /opt/chef.upgrade
    - upgrade chef 16.8.9 to 16.9.16[2022-01-06T02:38:18-05:00] WARN: New Chef Infra Client installed and client process exit is allowed and/or specified. Now forcing Chef Infra Client to exit. Disregard any failure messages.


chef-client -v
-bash: /usr/bin/chef-client: /opt/chef/embedded/bin/ruby: bad interpreter: No such file or directory

After fix

Starting Chef Infra Client, version 16.8.9
Patents: https://www.chef.io/patents
[2022-01-06T02:55:24-05:00] WARN: Run List override has been provided.
[2022-01-06T02:55:24-05:00] WARN: Original Run List: []
[2022-01-06T02:55:24-05:00] WARN: Overridden Run List: [recipe[chef_client_updater]]
resolving cookbooks for run list: ["chef_client_updater"]
Synchronizing Cookbooks:
  - chef_client_updater (3.12.0)
Installing Cookbook Gems:
Compiling Cookbooks...
Converging 1 resources
Recipe: chef_client_updater::default
  * chef_client_updater[update chef-client] action update
    * chef_gem[mixlib-install] action install
      - install version ~> 3.12 of package mixlib-install
    - move all files under /etc/chef to /etc/chef.upgrade
    - upgrade chef 16.8.9 to 16.9.16
    - move all files under /etc/chef.upgrade to /etc/chef[2022-01-06T02:56:07-05:00] WARN: New Chef Infra Client installed and client process exit is allowed and/or specified. Now forcing Chef Infra Client to exit. Disregard any failure messages.

chef-client -v
Chef Infra Client: 16.9.16

@lamont-granquist
Copy link
Contributor

That doesn't look like the right fix. Nothing in /etc/chef should be causing /opt/chef/embedded/bin/ruby to throw a "bad interpreter" from the shell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Expeditor: Bump Version Minor Used by github.minor_bump_labels to bump the Minor version number.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cookbook hangs when upgrading on Solaris
3 participants