Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker_container: "Malformed version number string 23.0.6+azure-2" #6595

Open
mietzen opened this issue Aug 15, 2023 · 2 comments
Open

docker_container: "Malformed version number string 23.0.6+azure-2" #6595

mietzen opened this issue Aug 15, 2023 · 2 comments

Comments

@mietzen
Copy link

mietzen commented Aug 15, 2023

Describe the problem

I'm running a GitHub action and trying to execute the following inspec test:

describe docker_container('my-container') do
  it { should exist }
  it { should be_running }
end

Locally this runs fine, but on the github action worker the docker version string is: 23.0.6+azure-2
and inspec fails with: Malformed version number string 23.0.6+azure-2

Possible Solution

Mayby sanitize the version string from 23.0.6+azure-2 to 23.0.6 in inspec?

@clintoncwolfe
Copy link
Contributor

You're saying that you have a container, whose version number is 23.0.6+azure-2? And when InSpec encounters it, it throws this error?

Could you paste the backtrace (add --debug if needed)?

@mietzen
Copy link
Author

mietzen commented Aug 16, 2023

No its the docker executable version:

$ docker --version
Docker version 23.0.6+azure-2, build ef23cbc

Here is a example GitHub Action Workflow:

name: "Docker Version"

on:
  push:
  workflow_dispatch:

jobs:
  docker-version:
    runs-on: ubuntu-latest
    steps:
      - run: docker --version

Edit: I'll post the debug log later.

For reference this is the project I encountered the problem:
https://github.com/mietzen/mautrix-signal/blob/f4a66e1e28814dab86ebf7a34539ab0070b12fa4/test/system/host/controls/mautrix-signal.rb#L3

Debug logs:

[2023-08-16T09:20:27+00:00] DEBUG: Option backend_cache is enabled
[2023-08-16T09:20:27+00:00] DEBUG: Resolve ./system/host into cache /home/runner/.inspec/cache
[2023-08-16T09:20:27+00:00] DEBUG: Dependency does not exist in the cache ./system/host
[2023-08-16T09:20:27+00:00] DEBUG: Starting run with targets: ["Inspec::Profile<system-test>"]
[2023-08-16T09:20:27+00:00] DEBUG: Using existing lockfile ./system/host/inspec.lock
[2023-08-16T09:20:27+00:00] DEBUG: Loading ./system/host/controls/mautrix-signal.rb into #<Inspec::ProfileContext:0x00007f75cf34cd98>
[2023-08-16T09:20:28+00:00] DEBUG: Registering rule (generated from mautrix-signal.rb:3 672067778b50f6dcc6b3421dcc2e84b6)
[2023-08-16T09:20:28+00:00] DEBUG: Registering rule (generated from mautrix-signal.rb:8 0da431e85d70ebca3c1f54ae66e40c86)
[2023-08-16T09:20:28+00:00] DEBUG: Registering rule (generated from mautrix-signal.rb:13 eaf6e302775f45b42e5eab78db5ad1df)
[2023-08-16T09:20:28+00:00] DEBUG: Registering rule (generated from mautrix-signal.rb:19 0b953ab0c19b8674f8e21ab87fe5023f)
[2023-08-16T09:20:28+00:00] DEBUG: Registering rule (generated from mautrix-signal.rb:25 72e57853d4da6306c3a4a6465e71d182)
[2023-08-16T09:20:28+00:00] DEBUG: Registering rule (generated from mautrix-signal.rb:31 14f9a781aacb80715d68266026178449)

Profile:   Host System Test (system-test)
Version:   0.1.0
Target:    local://
Target ID: bcda4ae7-5a24-510d-815e-80eb6cf8a49c

  Docker Container mautrix-signal
     ×  is expected to exist
     Malformed version number string 23.0.6+azure-2
     ×  is expected to be running
     Malformed version number string 23.0.6+azure-2
  Docker Container synapse
     ×  is expected to exist
     Malformed version number string 23.0.6+azure-2
     ×  is expected to be running
     Malformed version number string 23.0.6+azure-2

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

No branches or pull requests

2 participants