3
$\begingroup$

So I've been trying to automate the download and build of various large packages for hooking Mathematica into extensions but the downloads continually finish prematurely.

Trying to get the Psi4 installer:

URLDownload@"http://www.psicode.org/downloads/Psi4conda2-latest-MacOSX.sh"

gives a Transferred a partial file message and returns a failure object:

screenshot

This is probably because the file is huge (~185 MB).

Unfortunately I can't be 100% sure this is Mathematica as curl has the same issue and, maybe, URLDownload is implemented on top of curl. (I'm running Mathematica 11. on OSX.)

In any case, does anyone know whether it's possible to get around this or am I forced to tell users that they need to download the packages themselves?

$\endgroup$
13
  • $\begingroup$ Type that URL into your browser. Does it work for you? Doesn't for me, I get a "file not found" type page, which is what is downloaded $\endgroup$
    – Jason B.
    Jan 13, 2017 at 22:52
  • $\begingroup$ Ah yeah that one's faulty. It was occurring with one that did exist the other day. Let me find that one. $\endgroup$
    – b3m2a1
    Jan 13, 2017 at 22:53
  • $\begingroup$ If I run URLDownload["https://cmake.org/files/v3.7/cmake-3.7.2-Darwin-x86_64.tar.gz", "~/cmake-3.7.2-Darwin-x86_64.tar.gz"] then I get a 26MB file in my home directory $\endgroup$
    – Jason B.
    Jan 13, 2017 at 22:53
  • $\begingroup$ Nice to know this one was just me being dumb though. $\endgroup$
    – b3m2a1
    Jan 13, 2017 at 22:58
  • $\begingroup$ @JasonB. Changed up the example. This thing is huge, unfortunately, but that's probably also the source of the abort. $\endgroup$
    – b3m2a1
    Jan 13, 2017 at 23:08

1 Answer 1

3
$\begingroup$

I get the same with version 11.1.0 on Windows 7 x64. Crome 56.0.2924.87 (64-bit) also can't download complete file: only 57183554 bytes is saved. Firefox failed too: only 36145154 bytes file is created.

Wget prints useful diagnostic information, and what it says:

After downloading 18% wget printed that connection is closed at position 36472034 bytes (after 70 seconds), and started new download attempt from that position (not downloading again what was already downloaded). And at position 78421764 bytes the connection was closed again (after 69 more seconds), and then at 112892134 bytes again (after 68 more seconds), and than at 155620904 bytes (after 67 more seconds), then at 177263754 bytes (after 67 more seconds). Then the downloading was finished (the last attempt taken 42 seconds).

From wgets output it looks like the server is configured to kick the connection if it takes longer than 67 - 70 seconds... The only workaround is to use a tool which is able to resume downloading, like wget.

$\endgroup$
2
  • $\begingroup$ In the end I just downloaded the source code with git and compiled it because it came sparser and that worked out fine for me. It would be an interesting feature for them to introduce to Mathematica, though, some way to auto-resume upon closure. $\endgroup$
    – b3m2a1
    Mar 19, 2017 at 5:22
  • $\begingroup$ Yes, it would be very nice to have this feature in Mathematica. $\endgroup$ Mar 19, 2017 at 5:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.