Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Critical
-
Resolution: Duplicate
-
Affects Version/s: 10.12.0
-
Fix Version/s: None
-
Component/s: Chef Client, Chef Server
-
Labels:None
-
Environment:
Ubuntu 12.04 LTS x86_64, ruby 1.8.7 and ruby 1.9.3
Description
First use rvm to install ruby-1.8.7-p370 and ruby-1.9.3-p194
Create a data bag source file as follows (make sure "foo" has the \n):
{ "id": "test", "foo": "foo\n }Generate a key:
openssl rand -base64 512 | tr -d '\r\n' > key
rvm use 1.8.7
knife data bag create test
knife data bag from file test test.json --secret-file key
Then switch to 1.9.3:
rvm use 1.9.3
knife data bag show test test --secret-file key -Fj
Output is:
Suspect that the issue is with the YAML Psych backend which is not able to decode YAML generated by 1.8.7.
$ rvm use 1.8.7
$ irb
1.8.7 :001 > require 'yaml'
1.8.7 :002 > YAML.dump("foo\n")
=> "--- |\nfoo\n\n"
1.8.7 :003 > quit
$ rvm use 1.9.3
$ irb
1.9.3p194 :001 > require 'yaml'
1.9.3p194 :002 > YAML.load("--- |\nfoo\n\n")
=> ""
Issue Links
- duplicates
-
CHEF-3393
Chef Encrypted Data Bag Error due to Different YAML Engines
-
Activity
- All
- Comments
- History
- Activity
- Transitions Summary
Fix offered on
CHEF-3393, closing this a dupe.