mdxp / knife-backup

knife plugin to help backup and restore a chef server.
Apache License 2.0
110 stars 45 forks source link

FATAL: Cannot find sub command for: 'backup' #22

Closed sebbes closed 10 years ago

sebbes commented 10 years ago

Hi,

I followed the instructions to install knife-backup but cannot execute the back command.

knife backup --help FATAL: Cannot find sub command for: 'backuo --help' Available subcommands: (for details, knife SUB-COMMAND --help)

When I do a 'gem list' I see knife-backup installed. Can you assist, please?

My knife/chef version: 11.4.4.

Regards, Sebastian

karnauskas commented 10 years ago

I tried knife-backup today without any problems. 'backuo' sounds like typo. Can someone verify?

lgebhardt commented 10 years ago

In my situation I needed to add it to my Gemfile and then run bundle.

mdxp commented 10 years ago

Are you looking for:

knife backup export --help and knife backup restore --help

There is no top level help command at this time.

lgebhardt commented 10 years ago

@mdxp, in my case I followed the directions to install the gem from the command line. Then when running knife the backup plugin wasn't available. I checked the issues and found this one, but it didn't offer a solution. My other knife plugins are added to my Gemfile and adding this one also makes it available. I haven't tried to track down why. I'm using RVM and running knife from a Vagrant project if that helps at all. Also, if I remove knife-backup from the Gemfile it's no longer available as a knife command until I add it back.

mdxp commented 10 years ago

From what I hear you say this is the same for other knife plugins, and in your setup that is the way to go with gemfiles and blundle exec. Thanks for explaining that! @sebbes if you are still having issues pls. reopen this issue.

lgebhardt commented 10 years ago

Exactly. I don't think it's an issue, though it might make sense to make a note of it in the readme.

sebbes commented 10 years ago

Hmm, still stuck with the problem. As I stated, the knife-backup is listed in the 'gem list', so I am not sure where to 'add' it to the gemfile. @lgebhardt: Can you pls explain in detail what you did? Sounds like you solved the problem (In my situation I needed to add it to my Gemfile and then run bundle.) I ain't no ruby developer, so pls bear with me...

Cheers, Sebastian

lgebhardt commented 10 years ago

@sebbes, I'm not sure it's required to add it a Gemfile. But in my case I'm using RVM to manage ruby versions and have a gemset for vagrant. I'm using bundler to manage the gems for a vagrant based project, so for my project putting it in the Gemfile is the correct way to get the plugin gems loaded in my path. I also have chef installed in this gemset.

My guess is Knife isn't finding the plugins for some reason. It's possible you have the gem installed into the wrong version of ruby, since chef maintains it's own depending on how you install it. If you do which knife you should see the path knife is installed. Try installing the plugin using gem install from that path, for example: /opt/chef/embedded/bin/gem install knife-backup.

dldinternet commented 9 years ago

I have run into this issue also in RVM setup. The problem is that knife does not find the knife-backup gem for some reason if the gemset is not the default. There are two workarounds: 1) rum use default; gem install knife-backup 2) bundle exec knife backup ...