saltstack / salt

Software to automate the management and configuration of any infrastructure or application at scale. Install Salt from the Salt package repositories here:
https://docs.saltproject.io/salt/install-guide/en/latest/
Apache License 2.0
14.19k stars 5.48k forks source link

[BUG] docker state fails due to missing docker package in onedir package #63884

Closed kobus-v-schoor closed 1 year ago

kobus-v-schoor commented 1 year ago

Description The docker state is failing to apply due to the docker package being missing from the onedir package on Ubuntu 22 (Jammy) on amd64 architecture. I believe this is related to https://github.com/saltstack/salt/issues/63620. Following the same workaround as the previously mentioned issue solves the problem:

salt-pip install 'docker<6.0.0'

Setup (Please provide relevant configs and/or SLS files (be sure to remove sensitive info. There is no general set-up of Salt.)

Please be as specific as possible and give set-up details.

Steps to Reproduce the behavior

Error received:

----------
          ID: ensure named docker volume is present
    Function: docker_volume.present
        Name: data
      Result: False
     Comment: State 'docker_volume.present' was not found in SLS '...'
              Reason: 'docker_volume' __virtual__ returned False: 'docker.version' is not available.

Versions Report

salt --versions-report (Provided by running salt --versions-report. Please also mention any differences in master/minion versions.) ```yaml salt-minion --version salt-minion 3005.1 ```

Additional context

Tested on multiple deployments, all have the same issue. Not sure if this is relevant, but these devices were upgraded from Ubuntu 20 -> 22 (the sources.list was updated for the new Ubuntu version, and apt dist-upgrade salt-minion was performed to upgrade salt)

welcome[bot] commented 1 year ago

Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey. Please be sure to review our Code of Conduct. Also, check out some of our community resources including:

There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. If you have additional questions, email us at saltproject@vmware.com. We’re glad you’ve joined our community and look forward to doing awesome things with you!

kobus-v-schoor commented 1 year ago

I've confirmed that this doesn't only affect Ubuntu 22, but also older Ubuntu versions using the onedir packaging (including ones where salt was newly installed, not upgraded)

dwoz commented 1 year ago

@kobus-v-schoor We do not intend to ship onedir packages with python docker. Please run salt-pip install docker to resolve your issue.

kobus-v-schoor commented 1 year ago

@dwoz thanks for confirming that. Is there any way to track what version of the docker package to install inside the salt environment? Currently, if you do a salt-pip install docker it still doesn't work as salt doesn't yet work with the latest docker package, so I need to limit it to docker<6.0.0. Is there any way to automatically resolve this for automation purposes?

Ch3LL commented 1 year ago

Does salt-pip install "docker<6.0.0" work for you?

kobus-v-schoor commented 1 year ago

Hi @Ch3LL , yes the salt-pip command solves the issue. I'm just concerned about how to automate our salt minion deploys, as I don't know what version to pin the docker package to in the future.

@kobus-v-schoor We do not intend to ship onedir packages with python docker. Please run salt-pip install docker to resolve your issue.

@dwoz The python docker package relies on very little extra external packages (can't say this 100% certainty, but I think installing the docker package just installed the docker package and a webrequests package IIRC). Is there another reason why the docker package can't be included with the onedir package?

dwoz commented 1 year ago

@kobus-v-schoor In the not too distant future we will be pulling docker related states and modules out of Salt into a Salt Extension python package. At that time, the extension can include docker as a dependency. For now, we want to keep the core of salt small (and make it smaller).