MyMiniCity踏んでください!!

ただいま絶賛MyMiniCity参加中です.是非リンクを踏んでください!!(笑
November 23rd, 2013

chef-ruby_build経由でruby-buildの更新をしようとしてハマったこと

(Read: 99876)
Add to Hatena Bookmark

参照: Chef Cookbook: ruby_build - Opscode Community

Rubyを使う某プロジェクトで勉強も兼ねてChef solo w/ knifeを使っているのですが,その際rbenv,ruby-buildを使うためにクックブックとしてchef-ruby_buildを利用しています.

っでRubyが更新された際にそれに追従したいんだけどどうしてもいつも期待通りいかない. その理由はまだわからないのですが,事象に遭遇したときの暫定対処法がやっとわかりました.

ruby-buildをあるブランチに同期させる場合,ruby_buildのupgrade ⇒ "sync" or Trueを指定します. っで,そうすると頻繁にこのようなエラーが出てきました.

  * package[tar] action install (up to date)
  * package[bash] action install (up to date)
  * package[curl] action install (up to date)
  * package[git] action install (skipped due to not_if)
  * execute[Install ruby-build] action nothing (skipped due to action :nothing)
  * directory[/tmp/chef-solo] action create (up to date)
  * git[/tmp/chef-solo/ruby-build] action sync
================================================================================
Error executing action `sync` on resource 'git[/tmp/chef-solo/ruby-build]'
================================================================================


Mixlib::ShellOut::ShellCommandFailed
------------------------------------
Expected process to exit with [0], but received '128'
---- Begin output of git remote add origin https://github.com/sstephenson/ruby-build.git ----
STDOUT:
STDERR: fatal: Not a git repository (or any of the parent directories): .git
---- End output of git remote add origin https://github.com/sstephenson/ruby-build.git ----
Ran git remote add origin https://github.com/sstephenson/ruby-build.git returned 128


Resource Declaration:
---------------------
# In /tmp/chef-solo/cookbooks/ruby_build/recipes/default.rb

 58: git src_path do #~FC043 exception to support AWS OpsWorks using an older Chef
 59:   repository  git_url
 60:   reference   git_ref
 61:
 62:   if upgrade_strategy == "none"
 63:     action    :checkout
 64:   else
 65:     action    :sync
 66:   end
 67:



Compiled Resource:
------------------
# Declared in /tmp/chef-solo/cookbooks/ruby_build/recipes/default.rb:58:in `from_file'

git("/tmp/chef-solo/ruby-build") do
  provider Chef::Provider::Git
  action [:sync]
  retries 0
  retry_delay 2
  destination "/tmp/chef-solo/ruby-build"
  revision "master"
  remote "origin"
  cookbook_name :ruby_build
  recipe_name "default"
  repository "https://github.com/sstephenson/ruby-build.git"
end



[2013-11-23T14:21:40+09:00] ERROR: Running exception handlers
[2013-11-23T14:21:40+09:00] ERROR: Exception handlers complete
[2013-11-23T14:21:40+09:00] FATAL: Stacktrace dumped to /tmp/chef-solo/chef-stacktrace.out
Chef Client failed. 5 resources updated
[2013-11-23T14:21:40+09:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
ERROR: RuntimeError: chef-solo failed. See output above.

この現象が起こった際,cookbookのソースを読んでもRubyスキルの低さゆえにはっきりとした原因も暫定対処法もわからずごにょごにょやっていたらいつの間にか更新ができるようになっていた.という日々を過ごしていました(苦笑

っで,今日もその作業をしようとしたのですが上記エラーが出てきて困ったのですが,たまたま/tmp/chef-solo/を見たところ,中途半端なディレクトリーが存在しました.

$ ls -a1 ruby-build/
.
..
.git
$ ls -a1 ruby-build/.git/objects/pack/
pack-8e9fb8271aa9880cbe25467769278a534d0ed7cd.idx
pack-8e9fb8271aa9880cbe25467769278a534d0ed7cd.pack

結果的にはこうなっているのが正常な状況なのでしょうか(若干自信はない

$ ls -a1 ruby-build/
.
..
.git
.travis.yml
test
ってことで何らかの理由でgit cloneか何かに失敗していたようです. そこで /tmp/chef-solo/ruby-build/ を削除したのちにknife solo cookを再度実行すると成功しました!! ということで未来の自分向けのエントリーでした(何

トピックの参照元

▼最近のトピック

▼ 人気のトピック


■ このトピックへのコメント投稿フォーム ■
キャンセル
※ HTMLタグは使えません
* 名前
* MAIL
* URL
本文
PASS ※ 半角英数8文字まで
  * 印の項目をcookieに保存する
下の画像にかかれている文字を入力してください:


< 過去の記事 [ 12月の All Categories リスト ] 新しい記事 >
Powered by gsblog (customize)

[ POST ] [ AddLink ] [ CtlPanel ]

Subscribe blog

Bookmark blog

About me

about me

応援しています

我が息子が産まれたアクア・バースハウス(東京都世田谷区にある助産院)を応援しています.

翻訳のお仕事

腕に自信がある方,修行をしたい方はこちらをどうぞ.

2023 calendar

12月
1 2
3 4 5 6 7 8 9
10 11 12 13 14 15 16
17 18 19 20 21 22 23
24 25 26 27 28 29 30
31
| Day | Month | Year |

Powered by RRDTOOL.

Archives

Categories

Links


Mail to admin

人気ブログランキングへ RSS feed meter for http://blog.poyo.jp/ Search Engine Optimization
blogpeople.netに登録!! スカウター : よくきたblog

My Google news

My Google News

Related site

ころんころん♪ べびぽよ フォト蔵Wiki
string(36) "/id-1385185598/repost-1/mode=res_new"