insights-core icon indicating copy to clipboard operation
insights-core copied to clipboard

The validation of ContextProvider for core collection failed

Open xiangce opened this issue 3 years ago • 1 comments

For the insights-archive collected by the new Core Collection identified by the "insights_archive.txt", the path of the real collected data is placed in the './data' but not the './' which works for the old archives.

It always reports the following error when insights-run against a new archive:


Traceback (most recent call last):
  File "/Users/liuxc/work/insights/insights-core/insights/core/plugins.py", line 90, in invoke
    return self.component(broker)
  File "/Users/liuxc/work/insights/insights-core/insights/core/spec_factory.py", line 569, in __call__
    return self.kind(ctx.locate_path(self.path), root=ctx.root, ds=self, ctx=ctx)
  File "/Users/liuxc/work/insights/insights-core/insights/core/spec_factory.py", line 175, in __init__
    self.validate()
  File "/Users/liuxc/work/insights/insights-core/insights/core/spec_factory.py", line 183, in validate
    raise ContentException("%s does not exist." % self.path)
insights.core.plugins.ContentException: /private/tmp/insights-ip-172-31-21-63.us-east-2.compute.internal-20210713080914/etc/redhat-release does not exist.

But in fact, the file is placed at

insights-ip-172-31-21-63.us-east-2.compute.internal-20210713080914/data/etc/redhat-release

xiangce avatar Jul 22 '21 06:07 xiangce

This issue can be simply reproduced by running any rule against an insights-archive collected with the new core collection with insights-run -t:

# insights-run -p insights/plugins ~/insights-ip-172-31-21-63.us-east-2.compute.internal-20210712064946.tar.gz -t | grep redhat-release -B10

Traceback (most recent call last):
  File "/home/liuxc/work/insights/insights-core/insights/core/plugins.py", line 90, in invoke
    return self.component(broker)
  File "/home/liuxc/work/insights/insights-core/insights/core/spec_factory.py", line 569, in __call__
    return self.kind(ctx.locate_path(self.path), root=ctx.root, ds=self, ctx=ctx)
  File "/home/liuxc/work/insights/insights-core/insights/core/spec_factory.py", line 175, in __init__
    self.validate()
  File "/home/liuxc/work/insights/insights-core/insights/core/spec_factory.py", line 183, in validate
    raise ContentException("%s does not exist." % self.path)
insights.core.plugins.ContentException: /tmp/insights-bcswfw8d/insights-ip-172-31-21-63.us-east-2.compute.internal-20210712064946/etc/redhat-release does not exist.

xiangce avatar Aug 05 '21 12:08 xiangce