Skip to content

Conversation

@tjugdev
Copy link
Contributor

@tjugdev tjugdev commented Oct 16, 2025

Overview

Integration tests frequently fail with the error:

  integration-test/Container/AnalysisSpec.hs:52:7: 
  1) Container.Analysis, Container Scanning, Container analysis from registry source, Has the correct OS release version
       uncaught exception: IOException of type UserError
       user error (ErrGroup [] [] [] [] [] (ErrWithStack (Stack ["Getting Image Manifest","Exporting Image","Analyzing via registry"]) (SomeErr "Errata {errataHeader = Just \"Manifest format is not supported: application/json; charset=utf-8\", errataBlocks = [Block {blockStyle = Style {styleLocation = \"\\8594 file:1:1\", styleNumber = \"3\", styleLine = \"text\", styleEllipsis = \".\", styleLinePrefix = \"\\9474\", styleVertical = \"\\9474\", styleHorizontal = \"\\9472\", styleDownRight = \"\\9484\", styleUpRight = \"\\9492\", styleUpDownRight = \"\\9500\", styleTabWidth = 4, styleExtraLinesAfter = 2, styleExtraLinesBefore = 1, stylePaddingTop = True, stylePaddingBottom = False, styleEnableDecorations = True, styleEnableLinePrefix = True}, blockLocation = (\"src/Control/Carrier/ContainerRegistryApi.hs\",216,15), blockHeader = Nothing, blockPointers = [], blockBody = Nothing}], errataBody = Just \"Workaround:\\n\\n  Export the image:\\n\\n\\n  Try using exported container image for analysis instead.\\n\\n\\n      >> docker pull public.ecr.aws/docker/library/alpine:3.19.1\\n      >> docker save public.ecr.aws/docker/library/alpine:3.19.1 > image-exported.tar\\n\\n\\n      fossa container analyze image-exported.tar\"}") :| []))

This error is misleading. With this change we see the actual reason for the failure:

  integration-test/Container/AnalysisSpec.hs:50:7:
  1) Container.Analysis, Container Scanning, Container analysis from registry source, Has the correct OS
       uncaught exception: IOException of type UserError
       user error (ErrGroup [] [] [] [] [] (ErrWithStack (Stack ["Getting Image Manifest","Exporting Image","Analyzing via registry"]) (SomeErr "Errata {errataHeader = Just \"Caught API error from: https://public.ecr.aws/v2/docker/library/alpine/manifests/sha256:6457d53fb065d6f250e1504b9bc42d5b6c65941d57532c072d929dd0628977d0\", errataBlocks = [], errataBody = Just \"API errors:\\n    Error code: TOOMANYREQUESTS\\n    Error message: Rate exceeded\"}") :| []))

We should still fix the test so that we're not getting rate limited, but at least now the error makes it clear what's happening.

Acceptance criteria

Testing plan

Risks

Metrics

References

Checklist

  • I added tests for this PR's change (or explained in the PR description why tests don't make sense).
  • If this PR introduced a user-visible change, I added documentation into docs/.
  • If this PR added docs, I added links as appropriate to the user manual's ToC in docs/README.ms and gave consideration to how discoverable or not my documentation is.
  • If this change is externally visible, I updated Changelog.md. If this PR did not mark a release, I added my changes into an ## Unreleased section at the top.
  • If I made changes to .fossa.yml or fossa-deps.{json.yml}, I updated docs/references/files/*.schema.json AND I have updated example files used by fossa init command. You may also need to update these if you have added/removed new dependency type (e.g. pip) or analysis target type (e.g. poetry).
  • If I made changes to a subcommand's options, I updated docs/references/subcommands/<subcommand>.md.

@tjugdev tjugdev requested a review from a team as a code owner October 16, 2025 22:57
@tjugdev tjugdev requested a review from nficca October 16, 2025 22:57
Copy link
Contributor

@nficca nficca left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice

@tjugdev tjugdev merged commit ab207a2 into master Oct 17, 2025
32 of 43 checks passed
@tjugdev tjugdev deleted the better-manifest-errors branch October 17, 2025 17:01
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

Successfully merging this pull request may close these issues.

3 participants