Skip to content

Download failure leaves invalid file #9

Open

Description

@webcoyote

I just ran into an issue where Github failed to serve up a file properly, and that prevented all future runs of my cookbook from converging successfully.

The github_asset resource downloads directly into the destination file (/var/chef/cache/github_assets/org/repo/version/foo-version.tar.gz). If the download fails it leaves a zero-length archive behind with that name, and future cookbook runs don't re-download the file because the zero-length file exists. See https://github.com/reset/github-cookbook/blob/master/libraries/github_asset.rb#L94.

Suggested solution: download to a temporary file and rename it if the download completes successfully. I suggest downloading to a temporary name in the same directory so that the rename step doesn't also require a copy, if (for example) the /tmp directory is on a different volume than the /var/chef/cache/github_assets directory.

Activity

  1. added
    Bug
    on Feb 11, 2015
  2. thegreenrobot commented on Mar 18, 2015

    @thegreenrobot

    I can confirm seeing the same issue when using this cookbook and it is intermittent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions