erlef / rebar3_hex

Rebar3 Hex library
Apache License 2.0
101 stars 49 forks source link

`rebar3 hex publish` fails with unknown server error #84

Closed arkgil closed 5 years ago

arkgil commented 5 years ago

Hi there!

I'm trying to publish a new version of Telemetry package, but I'm getting the following error from rebar3 hex publish:

[{"cache-control","max-age=0, private, must-revalidate"},
 {"date","Sun, 30 Dec 2018 23:14:14 GMT"},
 {"via","1.1 google"},
 {"server","Cowboy"},
 {"vary","accept-encoding"},
 {"content-length","60"},
 {"content-type","application/vnd.hex+erlang; charset=utf-8"},
 {"x-request-id","2lqjujn317tqrocbfg01i9h1"},
 {"strict-transport-security","max-age=31536000"},
 {"x-ratelimit-limit","500"},
 {"x-ratelimit-remaining","499"},
 {"x-ratelimit-reset","1546211700"},
 {"alt-svc","clear"}] <<131,116,0,0,0,2,109,0,0,0,7,109,101,115,115,97,103,101,
                        109,0,0,0,21,73,110,116,101,114,110,97,108,32,115,101,
                        114,118,101,114,32,101,114,114,111,114,109,0,0,0,6,115,
                        116,97,116,117,115,98,0,0,1,244>>
===> Unknown server error: HTTP status code: 500

The problem probably lies on the side of hex.pm, but maybe there are some debug flags I could set to get more information about why it is failing? Thanks! 😊

arkgil commented 5 years ago

Oh, and I'm trying to publish this version specifically: https://github.com/beam-telemetry/telemetry/tree/d38820b79d287a41e23f68095e029deb1d7681d9.

tsloughter commented 5 years ago

Is that all the output you get even with DEBUG=1 rebar3 hex publish?

tsloughter commented 5 years ago

And be sure you have rebar3_hex 6.1.0.

arkgil commented 5 years ago

@tsloughter Yea, I’m on the 6.1.0. With DEBUG=1 I see rebar3 info about the order of tasks being run, but no other additional info.

Sorry, can’t post the full output now, will do ASAP tomorrow.

tsloughter commented 5 years ago

Ok, I guess try master, and if it still fails with 500 going to have to go in and print or trace to find what the actual failure is.

Can also temporary give me publish access and I can debug that way.

wojtekmach commented 5 years ago

Hello, The server 500'd with the following error:

# https://hex.pm:80/api/packages/telemetry/releases
Jason.EncodeError: invalid byte 0xE9 in <<74, 111, 115, 233, 32, 86, 97, 108, 105, 109>>

Looking closely at the binary:

iex> :binpp.pprint(<<74, 111, 115, 233, 32, 86, 97, 108, 105, 109>>)
0000 4A 6F 73 E9 20 56 61 6C 69 6D                    José Valim

It's the maintainers field: https://github.com/beam-telemetry/telemetry/blob/d38820b79d287a41e23f68095e029deb1d7681d9/src/telemetry.app.src#L13

What probably happened is you saved the file in non-UTF8 encoding, or the encoding got lost along the way somehow.

The easiest way to fix this is to drop the maintainers field :) since it's deprecated anyway, see: https://github.com/hexpm/hex/blob/master/CHANGELOG.md#ignoring-maintainers-field

We should handle this gracefully on the server though.

arkgil commented 5 years ago

@wojtekmach @tsloughter thanks so much for your help ❤️ I successfully published the package :) On another note, I have problems with publishing the docs now 😅. But I'll create a separate issue for that one. Thanks!