tofu-controller
tofu-controller copied to clipboard
Python Dependency Error with tf-controller
Python Dependency Error with tf-controller
- I am trying to [terraform apply] a resource via the tf-controller wherein the main.tf for the resource uses an aws lambda module, which uses python to package the lambdas.
- I customized my Dockerfile to have python installed within the tf-controller image and redeployed
- Now, I get this apply error [File "/usr/lib/python3.11/zipfile.py", line 548, in from_file │ │ zinfo = cls(arcname, date_time) │ │ ^^^^^^^^^^^^^^^^^^^^^^^ │ │ File "/usr/lib/python3.11/zipfile.py", line 390, in init │ │ raise ValueError('ZIP does not support timestamps before 1980') │ │ ValueError: ZIP does not support timestamps before 1980 ]
- I found this command being used to update timestamps and resolve the issue: [touch
find . -type f]. I modified it to fit my use case, added it to a bash script and customized the tf-controller image with it. - After redeployment, I exec into the pod to confirm the .sh script is in there. However, I still get the same apply error. To make sure, I exec into the pod once and run the modified [touch
find . -type f] and confirm it updates the timestamp. But for some reason, during the terraform plan/apply via the tf-controller, the error is the same - I even modified the module in main.tf by equating the 'commands' argument with the modified [touch
find . -type f] but get the same error - It seems like the [terraform apply] is trying to reach a file somewhere within the aws lambda module that leverages python, but that file(or files) does not have a supported timestamp, OR a timestamp at all (Hence the error message stating "ZIP does not support timestamps before 1980"
- My best guess is that there is something about the tf-controller that makes it not naturally compatible with the python timestamp thing. Explaining why when doing a regular local terraform plan/apply, this error message does not pop up
- Has anyone ran into this?
- Any Thoughts/Suggestions will be appreciated
Note:
It looks like some files have a modification date of 1970-01-01 (and most likely 01:00:00 for time).
I had exactly the same issue using the latest version 0.16.0-rc.4 We are using Terraform Cloud with workspace cli / remote Is there any progress on this issue? This is easily repeateble. There must be a way to "touch files" with the current date.