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

ZIP does not support timestamps before 1980 #87

Closed
scytacki opened this issue Oct 9, 2020 · 1 comment
Closed

ZIP does not support timestamps before 1980 #87

scytacki opened this issue Oct 9, 2020 · 1 comment

Comments

@scytacki
Copy link
Contributor

scytacki commented Oct 9, 2020

I ran into this issue with babel: babel/babel#12125

I don't understand how updating yarn is going to fix old files in the babel npm packages without a new release of babel. So I'd guess this will be broken until a release. But perhaps there is some other way to get it work more cleanly.

My temporary work around is to run:
find .aws-sam/build/ReactAppHandler/node_modules/ -mtime +16000 -print -exec touch {} \;
between steps 4 and 5 in the readme.

When trying to track this down I see this kind of issue seems to happen every so often with various packages. It'd be really nice if the AWS tools could do something with the zip library to just ignore the dates on the files. Or at least they could catch the error and print out the file name of the file that has the problem.

In case it is useful for the AWS Sam team here is the stack trace:

Unable to export
Traceback (most recent call last):
  File "/usr/local/Cellar/aws-sam-cli/1.4.0/libexec/lib/python3.7/site-packages/samcli/lib/package/artifact_exporter.py", line 270, in export
    self.do_export(resource_id, resource_dict, parent_dir)
  File "/usr/local/Cellar/aws-sam-cli/1.4.0/libexec/lib/python3.7/site-packages/samcli/lib/package/artifact_exporter.py", line 286, in do_export
    uploaded_url = upload_local_artifacts(resource_id, resource_dict, self.PROPERTY_NAME, parent_dir, self.uploader)
  File "/usr/local/Cellar/aws-sam-cli/1.4.0/libexec/lib/python3.7/site-packages/samcli/lib/package/artifact_exporter.py", line 155, in upload_local_artifacts
    return zip_and_upload(local_path, uploader)
  File "/usr/local/Cellar/aws-sam-cli/1.4.0/libexec/lib/python3.7/site-packages/samcli/lib/package/artifact_exporter.py", line 172, in zip_and_upload
    with zip_folder(local_path) as (zip_file, md5_hash):
  File "/usr/local/opt/python@3.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/contextlib.py", line 112, in __enter__
    return next(self.gen)
  File "/usr/local/Cellar/aws-sam-cli/1.4.0/libexec/lib/python3.7/site-packages/samcli/lib/package/artifact_exporter.py", line 188, in zip_folder
    zipfile_name = make_zip(filename, folder_path)
  File "/usr/local/Cellar/aws-sam-cli/1.4.0/libexec/lib/python3.7/site-packages/samcli/lib/package/artifact_exporter.py", line 206, in make_zip
    zf.write(full_path, relative_path)
  File "/usr/local/opt/python@3.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/zipfile.py", line 1730, in write
    zinfo = ZipInfo.from_file(filename, arcname)
  File "/usr/local/opt/python@3.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/zipfile.py", line 530, in from_file
    zinfo = cls(arcname, date_time)
  File "/usr/local/opt/python@3.7/Frameworks/Python.framework/Versions/3.7/lib/python3.7/zipfile.py", line 357, in __init__
    raise ValueError('ZIP does not support timestamps before 1980')
ValueError: ZIP does not support timestamps before 1980
@ottokruse
Copy link
Collaborator

Yes that is an annoying issue, also reported here:
aws/aws-sdk-js#1977
aws/aws-cli#2639
https://stackoverflow.com/questions/49341263/zip-does-not-support-timestamps-before-1980-aws

For the repo here it will (probably) be fixed (/worked around) by #88 as that moves the npm install of "create-react-app" into the Lambda, and excluding it from sam packaging. I believe that was the culprit

Will close for now, let me know if it reoccurs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants