Comments (10)
コマンドラインオプションで、ユーザや鍵ファイルを明示的に指定してもこけますか?
from knife-zero.
-xでユーザを明示的に指定しましたが同様にNGでした。
なお、ドメイン名はec2.tokyoとなっていて紛らわしいのですが
サーバの実体はさくらのクラウドです。そのため鍵認証は使用しておりません。
knife-zeroの使用は鍵認証が前提なのでしょうか。
[@chefzero01 chef-repo]$ bundle exec knife zero chef_client 'name:chefzero02.ec2.tokyo' -x ***
WARN: No cookbooks directory found at or above current directory. Assuming /home//chef-repo.
WARNING: Failed to connect to chefzero02.ec2.tokyo -- Net::SSH::AuthenticationFailed: Authentication failed for user ***@[email protected]
ERROR: knife encountered an unexpected error
This may be a bug in the 'zero chef client' knife command or plugin
Please collect the output of this command with the -VV
option before filing a bug report.
Exception: NoMethodError: undefined method `forward' for nil:NilClass
from knife-zero.
なら認証はパスワードですか? このオプションを付けたらどうなるでしょうか。
-P, --ssh-password PASSWORD
from knife-zero.
ありがとうございます。パスワードオプション付けたところSSHエラーは出なくなりました。
別のエラーが出ていますが、こちらの環境に問題がありそうなので調べてみます。
(単に/etc/chef/client.pemが読めてないだけっぽいですが。。)
[@chefzero01 chef-repo]$ bundle exec knife zero chef_client 'name:chefzero02.ec2.tokyo' -x ***** --ssh-password XXXXXXXX
WARN: No cookbooks directory found at or above current directory. Assuming /home//chef-repo.
chefzero02.ec2.tokyo Starting Chef Client, version 12.0.3
chefzero02.ec2.tokyo [2015-01-05T13:39:42+09:00] WARN: Failed to read the private key /etc/chef/client.pem: #<Errno::EACCES: Permission denied @ rb_sysopen - /etc/chef/client.pem>
chefzero02.ec2.tokyo
chefzero02.ec2.tokyo ================================================================================
chefzero02.ec2.tokyo Chef encountered an error attempting to create the client "chefzero02.ec2.tokyo"
chefzero02.ec2.tokyo ================================================================================
chefzero02.ec2.tokyo
chefzero02.ec2.tokyo Private Key Not Found:
chefzero02.ec2.tokyo ----------------------
chefzero02.ec2.tokyo Your private key could not be loaded. If the key file exists, ensure that it is
chefzero02.ec2.tokyo readable by chef-client.
chefzero02.ec2.tokyo
chefzero02.ec2.tokyo Relevant Config Settings:
chefzero02.ec2.tokyo -------------------------
chefzero02.ec2.tokyo validation_key "/etc/chef/validation.pem"
chefzero02.ec2.tokyo
chefzero02.ec2.tokyo [2015-01-05T13:39:42+09:00] FATAL: Stacktrace dumped to /home/*****/.chef/cache/chef-stacktrace.out
chefzero02.ec2.tokyo Chef Client failed. 0 resources updated in 1.022760925 seconds
chefzero02.ec2.tokyo [2015-01-05T13:39:42+09:00] ERROR: I cannot read /etc/chef/client.pem, which you told me to use to sign requests!
chefzero02.ec2.tokyo [2015-01-05T13:39:42+09:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
from knife-zero.
おや、先にbootstrapしました?
from knife-zero.
お手数をおかけしてすみません。2つ問題が判明し解決しました。
1.rootユーザでbootstrapして一般ユーザでchef_clientしていた
2. --sudoをつけ忘れていた
bootstrapおよびchef_clientの両方を一般ユーザのsudoで実行したところうまく動作しました。
(両方ともrootでやってもうまくいきましたが。。)
まだ以下エラーが出てcookbookの実行ができていないのですが、cookbookの配置が悪いのかという気がしており、調べてみます。ありがとうございます。
WARN: No cookbooks directory found at or above current directory. Assuming /home/ookita/chef-repo.
chefzero02.ec2.tokyo Starting Chef Client, version 12.0.3
chefzero02.ec2.tokyo resolving cookbooks for run list: ["lamp"]
chefzero02.ec2.tokyo
chefzero02.ec2.tokyo ================================================================================
chefzero02.ec2.tokyo Error Resolving Cookbooks for Run List:
chefzero02.ec2.tokyo ================================================================================
chefzero02.ec2.tokyo
chefzero02.ec2.tokyo Missing Cookbooks:
chefzero02.ec2.tokyo ------------------
chefzero02.ec2.tokyo No such cookbook: lamp
chefzero02.ec2.tokyo
chefzero02.ec2.tokyo Expanded Run List:
chefzero02.ec2.tokyo ------------------
chefzero02.ec2.tokyo * lamp
chefzero02.ec2.tokyo
chefzero02.ec2.tokyo
chefzero02.ec2.tokyo Running handlers:
chefzero02.ec2.tokyo [2015-01-05T23:31:43+09:00] ERROR: Running exception handlers
chefzero02.ec2.tokyo Running handlers complete
chefzero02.ec2.tokyo [2015-01-05T23:31:43+09:00] ERROR: Exception handlers complete
chefzero02.ec2.tokyo [2015-01-05T23:31:43+09:00] FATAL: Stacktrace dumped to /var/chef/cache/chef-stacktrace.out
chefzero02.ec2.tokyo Chef Client failed. 0 resources updated in 1.383395461 seconds
chefzero02.ec2.tokyo [2015-01-05T23:31:43+09:00] ERROR: 412 "Precondition Failed "
chefzero02.ec2.tokyo [2015-01-05T23:31:43+09:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
from knife-zero.
1.rootユーザでbootstrapして一般ユーザでchef_clientしていた
2. --sudoをつけ忘れていた
あー、なるほど。それならそういう挙動になりそうです。
Cookbooksのパスですが、chef-zeroの仕様でknife.rb
は多分無視されます。
ログに出てるんで書いちゃますが以下のとこに置いてみてください。
/home/ookita/chef-repo/cookbooks/lamp/
from knife-zero.
ありがとうございます。cookbookのpathが
/home/ookita/chef-repo/site-cookbooks/lamp
になっていたので、
/home/ookita/chef-repo/cookbooks/lamp
に変更したところcookbookが正常に実行されました。
knife-soloとだいぶ勝手が違い戸惑ってしまいました。。
ありがとうございました。
from knife-zero.
Berkshelf(またはlibrarian)でpath: 'site-cookbooks/hoghoge'
のようにして、一回cookbooks/
に集めるようにするといいかと思います。
ではcloseしてもいいですかね?
from knife-zero.
はい、closeでお願い致します。
ありがとうございました。
from knife-zero.
Related Issues (20)
- Cannot bootstrap a new node (ssh authentication fails) HOT 2
- Dependabot can't resolve your Ruby dependency files
- knife zero converge not doing anything !? HOT 9
- Dependabot can't resolve your Ruby dependency files
- Dependabot can't resolve your Ruby dependency files
- Dependabot can't resolve your Ruby dependency files
- Dependabot can't resolve your Ruby dependency files
- Dependabot can't resolve your Ruby dependency files
- Dependabot can't resolve your Ruby dependency files
- Dependabot can't resolve your Ruby dependency files
- Dependabot can't resolve your Ruby dependency files
- Dependabot can't resolve your Ruby dependency files
- Using MOSH for flaky internet connection HOT 2
- Chef 16系でcincがうまく動かない HOT 15
- Chef dependency should be >= 17 for 2.4.x HOT 2
- knife zero converge "name:xxx-*" ERROR: Too many open files HOT 3
- knife zero converge command got sudo: chef-client: command not found error HOT 6
- knife zero converge - sudo: chef-client: command not found HOT 2
- Can't use with cinc
- Knife ignores ssh config file HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from knife-zero.