1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

AIX V7 にて chef-client を使用する際の integer 137438954242 too big to convert to `int' エラー

Last updated at Posted at 2018-08-15

#更新
少なくともchef-client 14.11.21では解消していることを確認

#問題

chef-client が 13.7.16 から 14.3.37 (2018/08/15現在の最新) の環境で、
test-kitchenのproxy driverとchef_zero provisionerを使用してAIX V7にChef cookbookの適用を行う場合、integer 137438954242 too big to convert to `int' としてエラーで失敗する可能性がある。

参考:

$ kitchen test 
-----> Starting Kitchen (v1.21.2)
-----> Cleaning up any prior instances of <p8126a-aix>
-----> Destroying <p8126a-aix>...
       Resetting instance state with command: exit 0
       Finished destroying <p8126a-aix> (0m0.38s).
-----> Testing <p8126a-aix>
-----> Creating <p8126a-aix>...
       Resetting instance state with command: exit 0
       Finished creating <p8126a-aix> (0m0.39s).
-----> Converging <p8126a-aix>...
$$$$$$ Running legacy converge for 'Proxy' Driver
       Preparing files for transfer
       Preparing dna.json
       Resolving cookbook dependencies with Berkshelf 7.0.2...
       Removing non-cookbook files before transfer
       Preparing validation.pem
       Preparing client.rb
       Transferring files to <p8126a-aix>
       Starting Chef Client, version 14.3.37
       Creating a new client identity for p8126a-aix using the validator key.
       
       ================================================================================
       Chef encountered an error attempting to create the client "p8126a-aix"
       ================================================================================
       
       System Info:
       ------------
       chef_version=14.3.37
       ruby=ruby 2.5.1p57 (2018-03-29 revision 63029) [powerpc-aix6.1.0.0]
       program_name=/bin/chef-client
       executable=/opt/chef/bin/chef-client
       
       
       Running handlers:
       [2018-08-15T16:41:11+09:00] ERROR: Running exception handlers
       [2018-08-15T16:41:11+09:00] ERROR: Running exception handlers
       Running handlers complete
       [2018-08-15T16:41:11+09:00] ERROR: Exception handlers complete
       [2018-08-15T16:41:11+09:00] ERROR: Exception handlers complete
       Chef Client failed. 0 resources updated in 05 seconds
       [2018-08-15T16:41:11+09:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
       [2018-08-15T16:41:11+09:00] FATAL: Stacktrace dumped to /tmp/kitchen/cache/chef-stacktrace.out
       [2018-08-15T16:41:11+09:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
       [2018-08-15T16:41:11+09:00] FATAL: Please provide the contents of the stacktrace.out file if you file a bug report
       [2018-08-15T16:41:11+09:00] FATAL: RangeError: integer 137438954242 too big to convert to `int'
       [2018-08-15T16:41:11+09:00] FATAL: RangeError: integer 137438954242 too big to convert to `int'

...

>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ActionFailed
>>>>>> Message: 1 actions failed.
>>>>>>     Converge failed on instance <p8126a-aix>.  Please see .kitchen/logs/p8126a-aix.log for more details
>>>>>> ----------------------
>>>>>> Please see .kitchen/logs/kitchen.log for more details
>>>>>> Also try running `kitchen diagnose --all` for configuration

また、通常のchef server/node構成においても、clientの登録時に同様の問題が発生すると思われる。

#原因
これは、以下の問題による。
api_client/registration.rb - integer 137438954242 too big to convert to `int' #6842

#test-kitchenの場合の回避方法

  • 回避方法1

.kitchen.yml の chef_zero provisioner から、client.rb に Chef::Config[:follow_client_key_symlink] = true を追記させる。

.kitchen.yml
---
driver:
  #name: vagrant
  name: proxy
  host: p8127a
  reset_command: 'exit 0'
  ssh_key: ~/.ssh/id_rsa
  sudo: false

provisioner:
  name: chef_zero
  # You may wish to disable always updating cookbooks in CI or other testing environments.
  # For example:
  #   always_update_cookbooks: <%= !ENV['CI'] %>
  always_update_cookbooks: true
  sudo: false
  product_name: chef
  install_strategy: skip
  client_rb:
    'Chef::Config[:follow_client_key_symlink] =': true

...

  • 回避方法2

対象AIXノードにrootでログイン後、以下を行い、/tmp/kitchen/client.pemを作成する。

# cd /tmp/kitchen/


# ls client.pem
client.pem not found


# echo 'Chef::Config[:follow_client_key_symlink] = true' >> client.rb

# chef-client -c client.rb -j dna.json -z 
Starting Chef Client, version 14.3.37
Creating a new client identity for p8126a-aix using the validator key.
resolving cookbooks for run list: ["install_chef_client::default"]
Synchronizing Cookbooks:
  - install_chef_client (0.1.0)
Installing Cookbook Gems:
Compiling Cookbooks...
Converging 0 resources

Running handlers:
Running handlers complete
Chef Client finished, 0/0 resources updated in 05 seconds

# ls client.pem 
client.pem

  • 回避方法3

AIX V7用のchef-client 13.6.4(まで)を使用する。
kitchen test を行なうと、/tmp/kitchen/client.pem が正しく作成され、以降使用可能となる。
なお、client.pemを削除しない前提で、chef-clientをバージョンアップ可能。

#chef server/node構成の場合の回避方法
なお、通常のchef server/node構成の場合には、同様に以下にて対応可能と思われる。

  • /etc/chef/client.rb に Chef::Config[:follow_client_key_symlink] = true を追記する

knife bootstrapを用いてノード構成をする場合には、以下で対応にて対応可能。
ChefTips: bootstrap時に カスタマイズした client.rb を配布する

  • AIX V7用のchef-client 13.6.4(まで)を使用してノードの追加を行う
1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?