Skip to content

Missing package.json files for some packages? #183

Closed

Description

@snoyberg

When I turn on "require package hashes" in Stack on the Hackage Security branch, I get the following error message:

Package index Hackage is configured to require package hashes, but no hash is available for amazonka-codedeploy-1.4.0

Sure enough, if I look in the 01-index.tar file, there is no package.json file for that release of amazonka-codedeploy:

screen shot 2017-01-25 at 4 04 32 pm

Is there some reason for this file to be missing? From a security standpoint, it would be nice to be able to depend on the existence of a hash for every package.

Also, I'm not sure if this is the appropriate repo for this question. I can move it to the Hackage Server tracker if that's better.

Activity

  1. added a commit that references this issue on Jan 25, 2017
  2. hvr commented on Jan 25, 2017

    @hvr
    Member

    We have known about this for quite some time already (c.f. haskell/hackage-server#488) but this glitch is very hard to reproduce and hasn't re-occured ever since then. This is also the reason why the hackage-mirror-tool needs this temporary hack. At some point we're gonna supply those missing package.json files in the index tarball, we just didn't get to it yet.

  3. snoyberg commented on Jan 25, 2017

    @snoyberg
    ContributorAuthor

    Is there no method available to:

    1. Manually add the missing package.json files, and
    2. Add a sanity check (like each .cabal file has a package.json file) before the 01-index.tar.gz file is generated?

    This does seem to significantly impede the ability of tools to provide security guarantees.

  4. added a commit that references this issue on Jan 27, 2017
  5. hvr commented on Jan 28, 2017

    @hvr
    Member

    This does seem to significantly impede the ability of tools to provide security guarantees.

    That's not really true though because as a kind of happy accident this unintentional situation currently exercises cabal's code-paths for when the package hashes are missing; and in fact cabal refuses to download those couple of packages whose cryptographic checksums are missing. This just forces us to be able to cope with this exceptional case which we would have to anyway.

  6. snoyberg commented on Oct 27, 2017

    @snoyberg
    ContributorAuthor

    Looks like aivika-transformers-5.3.1.tar.gz needs to be added to the list.

  7. tfausak commented on Dec 16, 2017

    @tfausak

    As @snoyberg mentioned, aivika-transformers-5.3.1 is missing its package.json. It was uploaded at 2017-10-27T04:35:54Z.

    Also this just happened again with llvm-hs-5.1.1 (haskell/hackage-server#643). That one was uploaded at 2017-12-16T14:00:07Z.

  8. gbaz commented on Mar 19, 2018

    @gbaz

    This is resolved with haskell/hackage-server#488

  9. snoyberg commented on Mar 19, 2018

    @snoyberg
    ContributorAuthor
  10. gbaz commented on Mar 19, 2018

    @gbaz

    The underlying cause was fixed in haskell/hackage-server#644

    Before, insertion of the package into the packagedb occurred and then hackage security data was added to the db, in two steps. So it was possible a thread could die or the server could fall-over between the steps. That change made sure that either both changes happened or neither change happened.

  11. snoyberg commented on Mar 19, 2018

    @snoyberg
    ContributorAuthor
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions