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

deb packaging: Two trailing \n in DEBIAN/conffiles prevent Uyuni/SUSE Manager from importing Vector deb repo #18439

Closed
senecops opened this issue Aug 31, 2023 · 1 comment · Fixed by #18455
Labels
platform: debian Anything `debian` platform related type: bug A code related bug.

Comments

@senecops
Copy link

senecops commented Aug 31, 2023

A note for the community

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Problem

We noticed that deb packages generated by cloudsmith cannot be imported into Uyuni/SUSE Manager due to an empty newline in conffiles. Steps to check:

wget https://packages.timber.io/vector/0.42.0/vector_0.42.0-1_amd64.deb
dpkg-deb -e vector_0.42.0-1_amd64.deb
hd DEBIAN/conffiles

I also reproduced this with https://packages.timber.io/vector/nightly/latest/vector_nightly-1_amd64.deb as of 2023-08-31.

Outputs:

--2024-11-28 13:56:46--  https://packages.timber.io/vector/0.42.0/vector_0.42.0-1_amd64.deb
Resolving packages.timber.io (packages.timber.io)... 172.67.151.135, 104.21.90.25, 2606:4700:3031::6815:5a19, ...
Connecting to packages.timber.io (packages.timber.io)|172.67.151.135|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 30553270 (29M) [application/x-debian-package]
Saving to: ‘vector_0.42.0-1_amd64.deb’

vector_0.42.0-1_amd64.deb                       100%[=====================================================================================================>]  29.14M  8.63MB/s    in 3.8s    

2024-11-28 13:56:50 (7.59 MB/s) - ‘vector_0.42.0-1_amd64.deb’ saved [30553270/30553270]

00000000  2f 65 74 63 2f 76 65 63  74 6f 72 2f 76 65 63 74  |/etc/vector/vect|
00000010  6f 72 2e 79 61 6d 6c 0a  2f 65 74 63 2f 64 65 66  |or.yaml./etc/def|
00000020  61 75 6c 74 2f 76 65 63  74 6f 72 0a 0a           |ault/vector..|
0000002d

Note the two 0a. One newline is completely fine and expected. Two are not. The source definition does nothing wrong I would say, ref:

conf-files = ["/etc/vector/vector.toml", "/etc/default/vector"]

Configuration

No response

Version

vector 0.31.0 (x86_64-unknown-linux-gnu 0f13b22 2023-07-06 13:52:34.591204470)

Debug Output

No response

Example Data

No response

Additional Context

I reported this on 2023-08-09 to support@cloudsmith.io. They say the problem is caused by how Vector creates the package. I was able to confirm that by searching for another project and checking if their conffile also has double newline. https://cloudsmith.io/~isc/repos/stork/packages/detail/deb/isc-stork-server/1.12.0.230802125039/a=amd64;d=any-distro%252Fany-version;t=binary/ has a single new line.

References

@jszwedko
Copy link
Member

jszwedko commented Sep 1, 2023

Thanks for reporting this @senecops ! It seems to be an issue with the tool we use to build the debian packages. I opened an issue upstream: kornelski/cargo-deb#110

I noticed the only conffiles we have are in /etc though so I think we could actually drop that directive since dh_installdeb automatically flags files under /etc as conffiles. I'll open a PR to do that.

@jszwedko jszwedko added the platform: debian Anything `debian` platform related label Sep 1, 2023
jszwedko added a commit that referenced this issue Sep 1, 2023
Apparently `cargo-deb` is including an extra newline in the generated `conffiles` file which causes a bug when used with Uyuni/SUSE Manager (#18439). I opened an issue upstream, kornelski/cargo-deb#110, but observed that we only have conffiles in `/etc` and so don't actually need to include a `conffiles` control file. Per the Debian docs:

> dh_installdeb(1) automatically flags any files under the /etc directory as conffiles, so if your program only has conffiles there you do not need to specify them in this file. For most package types, the only place conffiles should ever be is under /etc, and so this file doesn't need to exist.

Closes: #18439

Signed-off-by: Jesse Szwedko <jesse.szwedko@datadoghq.com>
github-merge-queue bot pushed a commit that referenced this issue Sep 1, 2023
…18455)

Apparently `cargo-deb` is including an extra newline in the generated `conffiles` file which causes a bug when used with Uyuni/SUSE Manager (#18439). I opened an issue upstream, kornelski/cargo-deb#110, but observed that we only have conffiles in `/etc` and so don't actually need to include a `conffiles` control file. Per the Debian docs:

> dh_installdeb(1) automatically flags any files under the /etc directory as conffiles, so if your program only has conffiles there you do not need to specify them in this file. For most package types, the only place conffiles should ever be is under /etc, and so this file doesn't need to exist.

Closes: #18439

Signed-off-by: Jesse Szwedko <jesse.szwedko@datadoghq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: debian Anything `debian` platform related type: bug A code related bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants