OmniSharp/omnisharp-emacs

`omnisharp-install-server` fails to retrieve the tarball due to HTTP 302 redirect

joelnibejpi opened this issue · 5 comments

When doing omnisharp-install-server, it fails with the following output:

omnisharp: this will download and extract ~20-30 MB from "https://github.com/OmniSharp/omnisharp-roslyn/releases/download/v1.32.18/omnisharp-linux-x64.tar.gz"; do you want to continue? (y or n) y
omnisharp: attempting to download and install OmniSharp server into /home/xxx/.emacs.d/.cache/omnisharp/server/v1.32.18
omnisharp: extracting "omnisharp-linux-x64.tar.gz" into "/home/xxx/.emacs.d/.cache/omnisharp/server/v1.32.18"
omnisharp: server could not be installed automatically. Please check https://github.com/OmniSharp/omnisharp-emacs/blob/master/doc/server-installation.md for instructions.

I believe it is caused by a HTTP 302 redirect at that URL:

curl -I https://github.com/OmniSharp/omnisharp-roslyn/releases/download/v1.32.18/omnisharp-linux-x64.tar.gz
HTTP/1.1 302 Found
...
Location: https://github-production-release-asset-2e65be.s3.amazonaws.com/27927984/77792500-5d47-11e9-9eaf-cf022c3b3415?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20190506%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20190506T122228Z&X-Amz-Expires=300&X-Amz-Signature=e0026b8e28af16f74dc61a2ccde6a407a383b18e88e9e57d08369ce6ffa62182&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename%3Domnisharp-linux-x64.tar.gz&response-content-type=application%2Foctet-stream
...

I had a quick look around, but couldn't find a way to make url-copy-file follow redirects. My workaround was instead to manually download and then extract the tarball into the expected location.

Hi, @joelnibejpi . Which emacs version are you using? So far I've seen this only on 27 (unstable)

Hi @razzmatazz. Here's my version string:

GNU Emacs 26.2 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.8) of 2019-04-12

I'm using the csharp layer of Spacemacs on the develop branch (syl20bnr/spacemacs@ada1807).

I am also getting this on osx (10.14.5) which emacs 26.2 installed from homebrew

I had a quick look around, but couldn't find a way to make url-copy-file follow redirects

This bug occurs with GNU Emacs <= 26.3 in combination with newer GNUTLS versions.

See: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34341
I added workaround also used in ghub.

I can confirm that omnisharp-install-server is now working on my system. Thank you!