saltstack / saltstack/salt

[BUG] 3006.7 apt pkg.install with HTTP URL as source fails, if URL contains a equal sign

Open
#66,443 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
Python
Stars
15.7k
Forks
5.6k
Avg merge
2d 44m
Merged PRs (30d)
80

Description

Description
similar to https://github.com/saltstack/salt/issues/64516 pkg.install fails if the url contains a = sign

Setup

salt-minion --versions
Salt Version:
          Salt: 3006.7

Python Version:
        Python: 3.10.13 (main, Feb 19 2024, 03:31:20) [GCC 11.2.0]

Dependency Versions:
          cffi: 1.14.6
      cherrypy: 18.6.1
      dateutil: 2.8.1
     docker-py: Not Installed
         gitdb: Not Installed
     gitpython: Not Installed
        Jinja2: 3.1.3
       libgit2: Not Installed
  looseversion: 1.0.2
      M2Crypto: Not Installed
          Mako: Not Installed
       msgpack: 1.0.2
  msgpack-pure: Not Installed
  mysql-python: Not Installed
     packaging: 22.0
     pycparser: 2.21
      pycrypto: Not Installed
  pycryptodome: 3.19.1
        pygit2: Not Installed
  python-gnupg: 0.4.8
        PyYAML: 6.0.1
         PyZMQ: 23.2.0
        relenv: 0.15.1
         smmap: Not Installed
       timelib: 0.2.4
       Tornado: 4.5.3
           ZMQ: 4.3.4

System Versions:
          dist: ubuntu 22.04.4 jammy
        locale: utf-8
       machine: x86_64
       release: 5.15.0-105-generic
        system: Linux
       version: Ubuntu 22.04.4 jammy

Steps to Reproduce the behavior

some-id:
  pkg.installed:
    - skip_verify: True
    - sources:
      - some-deb-file: "https://some-fqdn.tld/api/v4/projects/974/packages/generic/package/69be67e6/some-deb-file.deb.deb?private_token=abcd"

results in

[DEBUG   ] Requesting URL https://some-fqdn.tld/api/v4/projects/974/packages/generic/package/69be67e6/some-deb-file.deb.deb?private_token=abcd using GET method
[DEBUG   ] Using backend: tornado
/opt/saltstack/salt/lib/python3.10/site-packages/salt/ext/tornado/netutil.py:493: DeprecationWarning: ssl.PROTOCOL_TLS is deprecated
  context = ssl.SSLContext(
[INFO    ] Executing command dpkg in directory '/root'
[INFO    ] Executing command apt-get in directory '/root'
[INFO    ] Executing command dpkg in directory '/root'
[INFO    ] Executing command systemd-run in directory '/root'
[ERROR   ] Command 'systemd-run' failed with return code: 100
[ERROR   ] stdout: Reading package lists...
[ERROR   ] stderr: Running scope as unit: run-rae376bce525b4339bbb7b63469bfa995.scope
E: Unsupported file /var/cache/salt/minion/extrn_files/base/some-fqdn.tld/api/v4/projects/974/packages/generic/package/69be67e6/some-deb-file.deb.deb-private_token=abcd given on commandline
[ERROR   ] retcode: 100
[INFO    ] Executing command dpkg-query in directory '/root'
[ERROR   ] Problem encountered installing package(s). Additional info follows:

errors:
    - Running scope as unit: run-rae376bce525b4339bbb7b63469bfa995.scope
      E: Unsupported file /var/cache/salt/minion/extrn_files/base/some-fqdn.tld/api/v4/projects/974/packages/generic/package/69be67e6/some-deb-file.deb.deb-private_token=abcd given on commandline
[INFO    ] Completed state [some-id] at time 08:22:08.585874 (duration_in_ms=3003.202)

but this worked in 3005.x

Expected behavior

pkg.install does not fail

Additional context
Add any other context about the problem here.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at Salt's pkg.install path and reproduce the provided state with an HTTP package URL containing = in its query string. Trace how the downloaded path reaches apt-get, and consider the issue done when the package installs successfully without rewriting the URL's query portion.

Written by the indexing model from the issue text.

Assessment

Tech stack
linux, python, ubuntu
Domain
devops, infrastructure, operating-systems
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.