-
Notifications
You must be signed in to change notification settings - Fork 5
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
knife tarsnap ending in ERROR: TypeError: can't convert nil into String #12
Comments
It appears the error is coming from a missing value in your databag. Can you double check you have your databag setup correct? See https://github.com/jssjr/chef-tarsnap#tarsnap-keys for the required setup. I wonder if /root/tarsnap.key exists? Since you didn't have the databag created on the first run, it may be possible the key was created but the databag entry was never saved to chef server. |
{ ^^ is the databag file, the tarsnap.key file exists and tarsnap runs great on the server, just fails from knife with that error. Appreciate your help. |
Also want to mention: knife tarsnap key list Shows it as registered, originally was pending. |
I haven't been able to reproduce this. Do other knife tarsnap commands work? For example |
Oh looks like you answered my main question while I was replying. Let me sleep on this, I'll get back to you tomorrow. |
Get sleep, I'm digging too, knife is a nice add on, just glad I've got an automatic tarsnap backup on the server. Here is the output from knife tarsnap key show sql.beyond9.co and obligatory $ knife tarsnap key show sql.beyond9.co -VVV |
OK, that narrowed down the issue for me. For whatever reason it isn't able to fetch the key from the databag. Take a look here https://github.com/jssjr/chef-tarsnap/blob/master/knife-tarsnap/lib/chef/knife/tarsnap/core.rb#L118 If you run Off to bed now, hope that will lead you down the right path at least. Please let me know if you find anything out. |
Got it! Really sorry mate, this ended up having nothing to do with your script. I didn't realize I had some additional setup I needed to do for encrypted data bags. I generated a secret file and then set that in the knife.rb file. Then I copied that secret file out to the server to /etc/chef/encrypted_data_bag_secret after that everything clicked and on a new instance for testing I got: $ knife tarsnap backup show sqld.beyond9.co Thanks for all your efforts. Sorry I led us down a rabbit hole. |
Glad you got it. In the future if you have a line like this in your knife.rb encrypted_data_bag_secret "#{current_dir}/databag.key" When you do a knife bootstrap the secret key is automatically copied over. |
ERROR: TypeError: can't convert nil into String
Appreciate everything that you've done but I'm having some issues getting rolling. I can't seem to get any of the knife functions to perform. They all end with that same error. I couldn't get it to create a key, show backup etc etc.
Here is output with -VVV
knife tarsnap backup show sql.beyond9.co -VVV
DEBUG: Signing the request as tidrion
DEBUG: Sending HTTP Request via GET to api.opscode.com:443/organizations/beyond9/data/tarsnap_keys/sql_beyond9_co
DEBUG: ---- HTTP Status and Header Data: ----
DEBUG: HTTP 1.1 200 OK
DEBUG: server: ngx_openresty
DEBUG: date: Sat, 14 Sep 2013 00:32:38 GMT
DEBUG: content-type: application/json
DEBUG: transfer-encoding: chunked
DEBUG: connection: close
DEBUG: x-ops-api-info: flavor=hec;version=11.0.0;oc_erchef=0.21.26
DEBUG: content-encoding: gzip
DEBUG: ---- End HTTP Status/Header Data ----
DEBUG: decompressing gzip response
ERROR: TypeError: can't convert nil into String
Knife username is in .chef/knife.rb I even manually created the data bag for that server manually and put the key in there after I generated it manually on the server. Any help is greatly appreciated.
The text was updated successfully, but these errors were encountered: