-
Notifications
You must be signed in to change notification settings - Fork 170
Chef Policyfile archive truncates cookbook file #1607
Comments
Wasn't able to repro it:
That content looks correct. Maybe the trigger is something more specific? |
Yeah, must be something special. I duplicated your setup and still get the same error.
|
Can you check if the cookbook is correct in your cache? Look in |
The cookbook is correct and if I do just an |
Can you upload the generated tarball somewhere? Might have some useful clues in it. |
Tried unpacking that with multiple different Tar implementations and they all show the same corruption so almost certainly something in mixlib-archive. @thommay any ideas? |
Confirming this - Minimal repro case:
Generate two exported copies, one directory mode, one archive:
Diff of resulting metadata.json:
|
Potentially related to non-ASCII character in the metadata.json:
Looks to be the multi-byte single quote https://raw.githubusercontent.com/schubergphilis/chef-acme/master/README.md right towards the end:
|
Less terrible workaround, add this to your require "mixlib/archive/lib_archive"
Mixlib::Archive::LibArchive.define_singleton_method(:new) { raise LoadError } |
So I'm running into this same problem in MacOS but not in windows. In MacOS, if I export the archive, the metadata.json from the audit cookbook (v5.0.2) gets truncated but not if I export to a directory. In windows it works fine both ways. I tried adding the mixlib lines above to my knife.rb but that did not help. I'm running chefdk 3.1.0. There don't appear to be any special characters where it truncates ( |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Description
When creating a policyfile archive using
chef export -a
on a policyfile that includes the Windows cookbook it will truncate the resources/share.rb file's last two lines. It only truncates it when creating the archive; Usingchef export
to create the directory does not have the issue.If I remove the following lines:
# Author:: Sölvi Páll Ásgeirsson (<solvip@gmail.com>)
and# Copyright:: 2014-2017, Sölvi Páll Ásgeirsson.
from the file, upload the cookbook, and regenerate the policyfile the lines are not truncated.ChefDK Version
Chef Development Kit Version: 3.0.36
Platform Version
macOS Sierra 10.12.6
Replication Case
chef export -a
resources/share.rb
file to verify the last two lines are not complete.Expected results: Client executes policy.
Actual results: Error happens when executing policy on client.
Stacktrace
Please include the stacktrace.out output or link to a gist of it, if there is one.
The text was updated successfully, but these errors were encountered: