Skip to content
This repository has been archived by the owner on Jul 4, 2023. It is now read-only.

Error installing GhostScript #38084

Closed
circleb opened this issue Mar 26, 2015 · 41 comments
Closed

Error installing GhostScript #38084

circleb opened this issue Mar 26, 2015 · 41 comments

Comments

@circleb
Copy link
Contributor

circleb commented Mar 26, 2015

I'm getting this error when trying to install ghostscript, does anybody know why?

==> Downloading https://downloads.sourceforge.net/project/jbig2dec/jbig2dec/0.11/jbig2dec-0.11.tar.gz

curl: (35) Unknown SSL protocol error in connection to downloads.sourceforge.net:-36
Error: Failed to download resource "jbig2dec"
Download failed: https://downloads.sourceforge.net/project/jbig2dec/jbig2dec/0.11/jbig2dec-0.11.tar.gz
@DomT4
Copy link
Member

DomT4 commented Mar 26, 2015

WFM. Does brew fetch jbig2dec --force -fs work now, or is the problem still there?

@circleb
Copy link
Contributor Author

circleb commented Mar 26, 2015

No WFM... I'm getting the same error with that command. I've downloaded and installed several other Formulae, but this one won't download.

@DomT4
Copy link
Member

DomT4 commented Mar 26, 2015

Weird. What does your brew config and brew doctor cough out? Does curl -L https://downloads.sourceforge.net/project/jbig2dec/jbig2dec/0.11/jbig2dec-0.11.tar.gz -o jbig2dec-0.11.tar.gz work for you outside of Homebrew?

@circleb
Copy link
Contributor Author

circleb commented Mar 26, 2015

This is brew config:

HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew
HEAD: 462139e545068c18e9fe39b65ba7f884a8da8b7e
Last commit: 17 hours ago
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: 8-core 64-bit ivybridge
OS X: 10.10.2-x86_64
Xcode: 6.2
CLT: N/A
Clang: 6.0 build 600
X11: N/A
System Ruby: 2.0.0-p481
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /usr/bin/ruby
Java: N/A

brew doctor says I have non-brew pythons (which I know), but it also has an unexpected .la file: /usr/local/lib/libjpeg.la.
Could that be my problem?

@DomT4
Copy link
Member

DomT4 commented Mar 26, 2015

@tdsmith Did we ever decide to do anything about the non-Homebrew Python warning?

@circleb None of that looks like a problem. You might want to delete the libjpeg.la file to save yourself some trouble later, but that won't be causing the problems with the download. Did the curl command above work for you?

@circleb
Copy link
Contributor Author

circleb commented Mar 26, 2015

I'm getting the same error with the curl command.

@DomT4
Copy link
Member

DomT4 commented Mar 26, 2015

Interesting. Might be a problem with the system curl then. If you have Homebrew's curl installed can you try /usr/local/opt/curl/bin/curl -L https://downloads.sourceforge.net/project/jbig2dec/jbig2dec/0.11/jbig2dec-0.11.tar.gz -o jbig2dec-0.11.tar.gz.

Same with Homebrew's wget if you have that installed - wget https://downloads.sourceforge.net/project/jbig2dec/jbig2dec/0.11/jbig2dec-0.11.tar.gz.

@tdsmith
Copy link
Contributor

tdsmith commented Mar 26, 2015

@DomT4 No, I followed the conversations back to when it was added and Adam had observed genuinely bad build behavior, so it's worth flagging.

@circleb The output of curl --trace-ascii - -o /dev/null https://downloads.sourceforge.net/project/jbig2dec/jbig2dec/0.11/jbig2dec-0.11.tar.gz could be informative.

@circleb
Copy link
Contributor Author

circleb commented Mar 26, 2015

Brew's curl gave me the same error, but wget worked and downloaded the file, but when I do: brew install ghostscript it tries to download it again. How do I make it use the downloaded file?

@circleb
Copy link
Contributor Author

circleb commented Mar 26, 2015

Here's the trace:

== Info: Hostname was NOT found in DNS cache
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0== Info:   Trying 216.34.181.59...
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0== Info: Connected to downloads.sourceforge.net (216.34.181.59) port 443 (#0)
== Info: Unknown SSL protocol error in connection to downloads.sourceforge.net:-36
== Info: Closing connection 0
curl: (35) Unknown SSL protocol error in connection to downloads.sourceforge.net:-36

@DomT4
Copy link
Member

DomT4 commented Mar 26, 2015

Brew's curl gave me the same error, but wget worked and downloaded the file

Interesting. Brew's curl is linked to the same SSL/TLS library as OS X's provided curl - Secure Transport - Unless you chose to build with OpenSSL or LibreSSL. wget however is mandatory openssl or libressl. So perhaps something is amiss with Secure Transport's cert chain.

@circleb
Copy link
Contributor Author

circleb commented Mar 26, 2015

So am I looking at a problem too big to be fixed by uninstalling and reinstalling brew and it's components—like do I need to do a fresh install of my OS?

@DomT4
Copy link
Member

DomT4 commented Mar 26, 2015

It's not likely to be quite that severe. It could be as simple as there being an outdated cert in your keychain somewhere, or it might be some other little bug. A single certificate error seems possible, given you're able to make SSL/TLS connections to other links. Could even be a bug in curl. No need to do anything drastic just yet :).

@circleb
Copy link
Contributor Author

circleb commented Mar 26, 2015

So, should I start by just clearing out all of my certificates from the keychain?

@DomT4
Copy link
Member

DomT4 commented Mar 26, 2015

Not unless you never want to be able to make an SSL/TLS connection again 😉. Give me a bit, I'm trying to hunt around for any precedence on Sourceforge and that particular error. Is it just that link, or do you have a problem with Sourceforge in general?

If you want to work around it, you could do brew remove curl && brew install curl --with-openssl and then for problematic links: /usr/local/opt/curl/bin/curl -L https://downloads.sourceforge.net/project/jbig2dec/jbig2dec/0.11/jbig2dec-0.11.tar.gz -o /Library/Caches/Homebrew/jbig2dec-0.11.tar.gz in this case, and then brew install jbig2dec -fs will work.

@DomT4
Copy link
Member

DomT4 commented Mar 26, 2015

curl -I -v https://downloads.sourceforge.net/project/jbig2dec/jbig2dec/0.11/jbig2dec-0.11.tar.gz could be useful as well, possibly.

@circleb
Copy link
Contributor Author

circleb commented Mar 26, 2015

Ok, man I'm sorry! I didn't realize you were looking around for me!
I can wait, I haven't tried any other files from sourceforge, so I don't know if it's only this one...
Thanks a TON for the help!

@circleb
Copy link
Contributor Author

circleb commented Mar 26, 2015

I did the reinstall w/ openssl and ran your second command, but I get this error:

curl: (3) <url> malformed
curl: (6) Could not resolve host: link

The curl command in your other comment gives me the exact same error as always. :-(

@DomT4
Copy link
Member

DomT4 commented Mar 26, 2015

Sorry, you'll have to use the actual link. I was being lazy.

/usr/local/opt/curl/bin/curl -L https://downloads.sourceforge.net/project/jbig2dec/jbig2dec/0.11/jbig2dec-0.11.tar.gz -o /Library/Caches/Homebrew/jbig2dec-0.11.tar.gz

@circleb
Copy link
Contributor Author

circleb commented Mar 26, 2015

Gotcha! I'm a little behind the curve...

@DomT4
Copy link
Member

DomT4 commented Mar 26, 2015

The curl command in your other comment gives me the exact same error as always. :-(

The curl -I -v link? It didn't make any sort of connection or certificate verification attempt at all? No output other than the failure?

@circleb
Copy link
Contributor Author

circleb commented Mar 26, 2015

This: curl -I https://downloads.sourceforge.net/project/jbig2dec/jbig2dec/0.11/jbig2dec-0.11.tar.gz
Gave me this: curl: (35) Unknown SSL protocol error in connection to downloads.sourceforge.net:-36

@DomT4
Copy link
Member

DomT4 commented Mar 26, 2015

Can you add the -v after the -I so we get the full readout?

@circleb
Copy link
Contributor Author

circleb commented Mar 26, 2015

* Hostname was NOT found in DNS cache
*   Trying 216.34.181.59...
* Connected to downloads.sourceforge.net (216.34.181.59) port 443 (#0)
* Unknown SSL protocol error in connection to downloads.sourceforge.net:-36
* Closing connection 0
curl: (35) Unknown SSL protocol error in connection to downloads.sourceforge.net:-36

@DomT4
Copy link
Member

DomT4 commented Mar 26, 2015

Thanks. There was an old bug in curl few versions back with TLS1.2 on some connections - It was closed as fixed upstream a while ago. Can you try these and see if any work?

/usr/bin/curl -I -v --tlsv1.0 https://downloads.sourceforge.net/project/jbig2dec/jbig2dec/0.11/jbig2dec-0.11.tar.gz

/usr/bin/curl -I -v --tlsv1.1 https://downloads.sourceforge.net/project/jbig2dec/jbig2dec/0.11/jbig2dec-0.11.tar.gz

/usr/bin/curl -I -v --tlsv1.2 https://downloads.sourceforge.net/project/jbig2dec/jbig2dec/0.11/jbig2dec-0.11.tar.gz

@circleb
Copy link
Contributor Author

circleb commented Mar 26, 2015

I get exactlly the same thing with all of them:

* Hostname was NOT found in DNS cache
*   Trying 216.34.181.59...
* Connected to downloads.sourceforge.net (216.34.181.59) port 443 (#0)
* Unknown SSL protocol error in connection to downloads.sourceforge.net:-36
* Closing connection 0
curl: (35) Unknown SSL protocol error in connection to downloads.sourceforge.net:-36

@DomT4
Copy link
Member

DomT4 commented Mar 26, 2015

😢 Guess it's not that old bug then. What is your DNS set to? System Preferences > Network > Advanced > DNS if it's not something you're used to hunting for.

@circleb
Copy link
Contributor Author

circleb commented Mar 26, 2015

I have 8.8.8.8 & 192.168.2.1.

@DomT4
Copy link
Member

DomT4 commented Mar 26, 2015

Hmm. Can you try temporarily removing the 192.168.2.1 one and seeing if having Google's public DNS as the sole option resolves anything? I'm not super-hopeful, but it's another thing to cross off the list of possibilities. I presume you don't have a ~/.curlrc file?

@circleb
Copy link
Contributor Author

circleb commented Mar 26, 2015

try temporarily removing the 192.168.2.1

Still get the same error.

I presume you don't have a ~/.curlrc file?

ls -ld .?* doesn't show that file when I cd to ~.

@DomT4
Copy link
Member

DomT4 commented Mar 26, 2015

Alright, guess we can rule out the old curl TLSv1.2 error, the curlrc problem and any DNS errors. Next thing, certificate chain. Trying to find a troublesome cert amongst the hundreds of roots OS X trusts is going to be a nightmare, so we'll temporarily use Mozilla's CA bundle for verification - If it works with Mozilla's CA bundle, there's a problem with the certs. If the same problem occurs, It's likely a problem with curl itself.

Standard disclaimer: You should presume I'm desperate to steal all your data and be suitably paranoid about what I'm about to tell you. I'm not, and I'm essentially duplicating instructions from curl themselves here, but feel free to be suspicious and check yourself.

Go to http://curl.haxx.se/docs/caextract.html and right click on cacert.pem > Save Link As > ~/Downloads/cacert.pem.

You can save it to any directory. I just plucked for downloads because it's easy/tidy.

cd ~/Downloads && /usr/bin/curl -I -v https://downloads.sourceforge.net/project/jbig2dec/jbig2dec/0.11/jbig2dec-0.11.tar.gz --cacert cacert.pem

@circleb
Copy link
Contributor Author

circleb commented Mar 26, 2015

It wouldn't let me install the certificate. Keychain tells me: An error has occurred. Unable to import an item. The contents of this item cannot be retrieved.

@DomT4
Copy link
Member

DomT4 commented Mar 26, 2015

You don't install the certificate. You just use it on the command line the once to check if the certs are the problem. Just a right click > save > command-line curl test printed above in the code block :).

@circleb
Copy link
Contributor Author

circleb commented Mar 26, 2015

I see! I'm still getting the same thing:

* Hostname was NOT found in DNS cache
*   Trying 216.34.181.59...
* Connected to downloads.sourceforge.net (216.34.181.59) port 443 (#0)
* Unknown SSL protocol error in connection to downloads.sourceforge.net:-36
* Closing connection 0
curl: (35) Unknown SSL protocol error in connection to downloads.sourceforge.net:-36

@DomT4
Copy link
Member

DomT4 commented Mar 26, 2015

Welp. Almost certainly a problem with curl itself then. Have you done anything different to your curl locally? Replaced it or reinstalled it or moved it or? What does curl -V cough out?

@circleb
Copy link
Contributor Author

circleb commented Mar 26, 2015

I haven't messed with at all...
Here's what I'm getting:

curl 7.37.1 (x86_64-apple-darwin14.0) libcurl/7.37.1 SecureTransport zlib/1.2.5
Protocols: dict file ftp ftps gopher http https imap imaps ldap ldaps pop3 pop3s rtsp smtp smtps telnet tftp 
Features: AsynchDNS GSS-Negotiate IPv6 Largefile NTLM NTLM_WB SSL libz 

@DomT4
Copy link
Member

DomT4 commented Mar 26, 2015

Yup. Nothing odd there at all. Did you have any success with the brewed curl --with-openssl earlier? Or did that hit the same issue?

@circleb
Copy link
Contributor Author

circleb commented Mar 26, 2015

It was the same issue.

@DomT4
Copy link
Member

DomT4 commented Mar 26, 2015

Weird. But makes sense I guess given the same certs are used. Try this process:

cd ~/Downloads && curl -O http://curl.haxx.se/ca/cacert.pem && /usr/local/opt/curl/bin/curl -I -v https://downloads.sourceforge.net/project/jbig2dec/jbig2dec/0.11/jbig2dec-0.11.tar.gz --cacert cacert.pem

@circleb
Copy link
Contributor Author

circleb commented Mar 26, 2015

That spit out a huge error, at this point I don't think it's worth pursuing further, I was able to get ghostscript installed (it didn't fix the original issue I was having). I'm trying to get ImageMagick working with Apache/PHP and it seems like we may be making some headway there. THANKS A MILLION for your effort!

@circleb circleb closed this as completed Mar 26, 2015
@DomT4
Copy link
Member

DomT4 commented Mar 26, 2015

No problem! Thanks for bearing with me whilst I tried to cross off the trillion possibilities, and sorry we couldn't get to the bottom of it. One day I will find an answer to these seemingly random cURL failures 😸.

@Homebrew Homebrew locked and limited conversation to collaborators Jul 10, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants