Skip to content
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

Updated ArchiveDir to Persist File Headers #9

Merged
merged 1 commit into from
Mar 13, 2018

Conversation

dthagard
Copy link
Contributor

This PR addresses the issue reported here (#8) where the file attributes are stripped when creating an archive from a source directory.

In this PR we replace the use of writer.Create with write.CreateHeader using the file header that is already present in the method.

@dthagard dthagard changed the title Updated ArchiveDir to persist file headers Updated ArchiveDir to Persist File Headers Oct 20, 2017
@radeksimko radeksimko added the bug label Oct 30, 2017
@cullenbass
Copy link

Looks like this should also solve #10.

@noliva
Copy link

noliva commented Jan 31, 2018

Do we know when this is going to be merged? @radeksimko

@stefanwork
Copy link

If this is merged and released, then I can finally stop having to run a bash script before I run terraform apply. 🙏

@paultyng paultyng merged commit f0f6984 into hashicorp:master Mar 13, 2018
@catsby
Copy link

catsby commented Mar 13, 2018

Hello! v1.0.1 was released earlier today. Happy Terraforming!

@stefanwork
Copy link

I'm not sure if I'm doing something wrong, but I tried to zip my file with both 1.0.0 and 1.0.1, but the resulting zip files have the same checksum. Is it working for you @dthagard?

I think this change might just not have been enough to get zip files that work for Go lambda functions.

@stefanwork
Copy link

Ok, I think I figured out why it isn't working for me. I am only archiving a single file with source_file, and this only changes how directories are zipped.

@stefanwork
Copy link

I got it working. Will submit a PR and you guys can decide how to proceed.

@gabelazo
Copy link

I'm using this provider to generate aws elastic beanstalk source bundles. Zip file generated by v1.0.1 are failing to deploy.

@stefansundin
Copy link
Contributor

@gabelazo What kind of beanstalk application is it? .NET?

@gabelazo
Copy link

@stefanwork Single docker container. The exact platform version is 64bit Amazon Linux 2017.09 v2.8.2 running Docker 17.06.2-ce. here's the error we got:

Configuration files cannot be extracted from the application version [edited] Check that the application version is a valid zip or war file.

We rolled back to 1.0.0 and deployment worked.

@stefansundin
Copy link
Contributor

I suspect that it's because Method is unset after this change (so in v1.0.1 it does not compress at all). By default when using Create(), it uses Deflate, but if you use CreateHeader(), then you need to explicitly set fh.Method = zip.Deflate.

However, I am not very experienced with beanstalk so I'm not sure how to repro this specific case.

@stefansundin
Copy link
Contributor

@gabelazo v1.0.2 has been released with #3 that adds back compression. Is the new version working better for you?

I think there's a filesize limit for beanstalk zip files, so maybe when the compression went away, your filesize increased so much that you went over that limit?

https://docs.aws.amazon.com/elasticbeanstalk/latest/dg/environments-create-wizard-old.html#environments-create-wizard-old-applicationversion

The file size limit is 512 MB.

@gabelazo
Copy link

gabelazo commented Mar 22, 2018

@stefansundin v1.0.2 is working. Our bundles are not more than 512MB. They are just a few config files, we're using docker platform so we're not bundling code, just specifying image uri in a json file.

Thanks!

Copy link

I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active contributions.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants