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

failed to create state file when provided #109

Closed
VinozzZ opened this issue Aug 16, 2022 · 5 comments
Closed

failed to create state file when provided #109

VinozzZ opened this issue Aug 16, 2022 · 5 comments
Labels
bug Oops, sorry!

Comments

@VinozzZ
Copy link
Contributor

VinozzZ commented Aug 16, 2022

I'm getting the following error when trying to use a porter bundle that has "state" provided in the manifest when running in the operator:
could not create a new gzip reader for the statefile: unexpected EOF
This is when using "state" to store off terraform tfstate files ex:

state:
  - name: tfstate
    path: terraform/terraform.tfstate
  - name: tfvars
    path: terraform/terraform.tfvars.json

This works when setting the tfstate file as a bundle output and using it that way.
Running this on beta.2 in the operator

originally reported by @sgettys

@VinozzZ VinozzZ added the bug Oops, sorry! label Aug 16, 2022
@sgettys
Copy link
Collaborator

sgettys commented Aug 16, 2022

Looks like how k8s mounts the /porter/state.tgz file there needs to be a check for the unexpected EOF. The state file will exist but be empty. Adding in fix and testing this now

@VinozzZ
Copy link
Contributor Author

VinozzZ commented Aug 18, 2022

After some investigation from @sgettys , the problem is related to cnabio/cnab-go#266.
the k8s driver writes "null" file onto the volume that's used by invocation image which causes unexpectedEOF error. https://github.com/cnabio/cnab-go/blob/main/driver/kubernetes/kubernetes.go#L426
The reason why this is working with porter CLI is because docker-driver treats all files as tars. https://github.com/cnabio/cnab-go/blob/main/driver/docker/docker.go#L440

@VinozzZ
Copy link
Contributor Author

VinozzZ commented Dec 21, 2022

The workaround fix in porter is completes: getporter/porter#2307

@carolynvs
Copy link
Member

Can we close this issue or is there still something else that needs to happen?

@sgettys
Copy link
Collaborator

sgettys commented Jan 12, 2023

This should be complete

Porter and Mixins automation moved this from Inbox to Done Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Oops, sorry!
Projects
Development

No branches or pull requests

3 participants