Closed punarjitsingh-okta closed 1 year ago
For what it's worth, I don't think the contents of the profile matter - if platform detection is failing, then the execution will fail before the profile is even examined, so there is no need to setup a systemd service to reproduce the problem. You can just use the default profile as generated by inspec init profile
, which just tests for the existence of /tmp.
This issue has not yet been confirmed.
Thank you @clintoncwolfe
yes profile doesn't matter. Just wanted to give a complete example.
Some race condition is failing platform detection randomly. Maybe it's the long motd
as per https://blog.netnerds.net/2022/03/chef-inspec-unable-to-detect-platform/ - not too sure.
I've written a train plugin as an alternate ssh transport that bypasses train-core's platform detection.
It seems to have solved the issue for me.
thank you again
Version:
train-core-3.10.1
Environment:
Scenario:
Trying to run
inspec exec profile_name -t ssh://@<host>
- it passes and works fine but we get the following issue intermittently:Steps to Reproduce:
5.18.14
withRuby 3.0
inspec exec profile_name -t ssh://@<host>
Sorry, we are unable to detect your platform (Train::PlatformDetectionFailed)
Expected Result:
inspec exec profile_name -t ssh://@<host>
should execute the inspec profile tests on the given AL2 host without any issues.Actual Result:
inspec exec profile_name -t ssh://@<host>
for AL2 intermittently throwsSorry, we are unable to detect your platform (Train::PlatformDetectionFailed)
Note:
Our Amazon Linux 2 hosts have long
motd
before the shell is activated e.g.: