goreleaser: packagecloud.io http 500 error on RPMs built with v0.120.x
Describe the bug
Since the new RPM code in nfpm and goreleaser 0.120.x was introduced it is no longer possible to push RPMs to packagecloud.io.
Packagecloud support response:
This package is missing a lot of required RPM headers that must appear in the YUM metadata so that YUM can find this package and install it from a repository.
I would suggest that the maintainer of this package spend some time reviewing the RPM documentation and/or requesting the tool they use for generating the RPM automatically all required RPM headers. There’s lots of possible malformed RPM packages that will make our system 500; we catch a lot of the cases, but we do miss a few and will still 500 in some rare, isolated cases (like this package, which is significantly malformed).
To Reproduce
Steps to reproduce the behavior:
It should be possible to reproduce this bug locally from the https://github.com/pantheon-systems/pauditd project:
git clone git@github.com:pantheon-systems/pauditd.git
cd pauditd
curl -sL https://git.io/goreleaser | bash -s -- --snapshot --rm-dist
push to an existing packagecloud.io repo:
$ package_cloud push xxx/xxx/el/8 dist/*rpm
Looking for repository at xxx/xxx... success!
Pushing dist/pauditd-v1.1.11-next-1572710235-x86_64.rpm... Traceback (most recent call last):
23: from /usr/local/bin/package_cloud:22:in `<main>'
22: from /usr/local/bin/package_cloud:22:in `load'
21: from /usr/local/lib/ruby/gems/2.6.0/gems/package_cloud-0.3.05/bin/package_cloud:4:in `<top (required)>'
20: from /usr/local/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
19: from /usr/local/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
18: from /usr/local/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
17: from /usr/local/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
16: from /usr/local/lib/ruby/gems/2.6.0/gems/package_cloud-0.3.05/lib/package_cloud/cli/entry.rb:108:in `push'
15: from /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/benchmark.rb:293:in `measure'
14: from /usr/local/lib/ruby/gems/2.6.0/gems/package_cloud-0.3.05/lib/package_cloud/cli/entry.rb:168:in `block in push'
13: from /usr/local/lib/ruby/gems/2.6.0/gems/package_cloud-0.3.05/lib/package_cloud/cli/entry.rb:168:in `each'
12: from /usr/local/lib/ruby/gems/2.6.0/gems/package_cloud-0.3.05/lib/package_cloud/cli/entry.rb:178:in `block (2 levels) in push'
11: from /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/benchmark.rb:293:in `measure'
10: from /usr/local/lib/ruby/gems/2.6.0/gems/package_cloud-0.3.05/lib/package_cloud/cli/entry.rb:182:in `block (3 levels) in push'
9: from /usr/local/lib/ruby/gems/2.6.0/gems/package_cloud-0.3.05/lib/package_cloud/cli/entry.rb:242:in `create_package'
8: from /usr/local/lib/ruby/gems/2.6.0/gems/package_cloud-0.3.05/lib/package_cloud/repository.rb:52:in `create_package'
7: from /usr/local/lib/ruby/gems/2.6.0/gems/rest-client-2.0.2/lib/restclient/request.rb:52:in `execute'
6: from /usr/local/lib/ruby/gems/2.6.0/gems/rest-client-2.0.2/lib/restclient/request.rb:145:in `execute'
5: from /usr/local/lib/ruby/gems/2.6.0/gems/rest-client-2.0.2/lib/restclient/request.rb:715:in `transmit'
4: from /usr/local/Cellar/ruby/2.6.5/lib/ruby/2.6.0/net/http.rb:920:in `start'
3: from /usr/local/lib/ruby/gems/2.6.0/gems/rest-client-2.0.2/lib/restclient/request.rb:725:in `block in transmit'
2: from /usr/local/lib/ruby/gems/2.6.0/gems/rest-client-2.0.2/lib/restclient/request.rb:809:in `process_result'
1: from /usr/local/lib/ruby/gems/2.6.0/gems/rest-client-2.0.2/lib/restclient/abstract_response.rb:103:in `return!'
/usr/local/lib/ruby/gems/2.6.0/gems/rest-client-2.0.2/lib/restclient/abstract_response.rb:223:in `exception_with_response': 500 Internal Server Error (RestClient::InternalServerError)
Additional context
Workaround is to use goreleaser v0.119.3, the last release before the nfpm rpm refactor.
Apologies I cannot provide more details at this time. If I am able to determine anything helpful I’ll update this thread.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 28 (19 by maintainers)
Commits related to this issue
- fix(rpm): version and release fields refs https://github.com/goreleaser/goreleaser/issues/1229 Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> — committed to goreleaser/goreleaser by caarlos0 5 years ago
- fix(rpm): build time and build host refs #1229 Signed-off-by: Carlos Alexandro Becker <caarlos0@gmail.com> — committed to goreleaser/goreleaser by caarlos0 5 years ago
- remove goreleaser version pin, bug with packagecloud is fixed fixed in v0.120.8: https://github.com/goreleaser/goreleaser/issues/1229 — committed to pantheon-systems/pauditd by joemiller 5 years ago
🚀
Awesome! This one was hard hahaha
Thanks for all the help Joe! Will release and close this 👍
@caarlos0 victory!! (master @ 333d834b496fa5da99fc88d4db0c5889f785a4d6)
That last link in the previous comment (https://refspecs.linuxfoundation.org/LSB_1.3.0/gLSB/gLSB.html#AEN19637) had some interesting rpm tags that were not mentioned in the fedora link from a couple days ago in this thread.
That led me to poking a bit more at the “good” rpm from goreleaser 0.119 and a “bad” one:
I’m not sure if this is the cause but it might be interesting to look into:
script are marked optional in the doc, but there are differences between the two RPMs:
Got it, it happens if we call nfpm binary, but using as an API it doesn’t, because the check is on the yaml parser func.
Will work on a proper fix tomorrow.
yep, seems like!
will require a PR on rpmpack as well, already WIP
thanks for reporting this 😃
There is a
HEADER TAGS
section of this doc which has a list of required -vs- optional header tags: https://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/RPM_Guide/ch-package-structure.htmlA few required tags that might be missing based on the
rpm -qpi
output:I do not. I will try poking around the RPM metadata from a pre-0.120 version for comparison and let you know if I find anything.
On Mon, Nov 4, 2019 at 6:05 PM Carlos Alexandro Becker < notifications@github.com> wrote: