mojira.dev
MCL-2913

Slow internet connection can prevent Minecraft downloading

If you have a slow Internet connection, the launcher may fail to download completely the files.
14w32b file is sized about 700 kB in my computer but the real size is about 7.3 MB
Console log:

[10:09:22 INFO]: Attempting to download C:\Users\theo\AppData\Roaming\.minecraft\versions\14w32b\14w32b.jar for job 'Version & Libraries'... (try 5)
[10:09:53 WARN]: Couldn't download http://s3.amazonaws.com/Minecraft.Download/versions/14w32b/14w32b.jar for job 'Version & Libraries'
java.lang.RuntimeException: E-tag did not match downloaded MD5 (ETag was 34169165e621bb9a5bff8cd950b1c7d2, downloaded b30aae6a765d384c30eb342adef336e4)
	at com.mojang.launcher.updater.download.EtagDownloadable.download(EtagDownloadable.java:38) ~[launcher.jar:?]
	at com.mojang.launcher.updater.download.DownloadJob.popAndDownload(DownloadJob.java:109) [launcher.jar:?]
	at com.mojang.launcher.updater.download.DownloadJob.access$000(DownloadJob.java:12) [launcher.jar:?]
	at com.mojang.launcher.updater.download.DownloadJob$1.run(DownloadJob.java:86) [launcher.jar:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) [?:1.8.0_11]
	at java.util.concurrent.FutureTask.run(Unknown Source) [?:1.8.0_11]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) [?:1.8.0_11]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) [?:1.8.0_11]
	at java.lang.Thread.run(Unknown Source) [?:1.8.0_11]

Explanations:
I successfully decompile launcher.jar and I found this:

protected HttpURLConnection makeConnection(URL url) throws IOException
{
    HttpURLConnection connection = (HttpURLConnection)url.openConnection(this.proxy);
    connection.setUseCaches(false);
    connection.setDefaultUseCaches(false);
    connection.setRequestProperty("Cache-Control", "no-store,max-age=0,no-cache");
    connection.setRequestProperty("Expires", "0");
    connection.setRequestProperty("Pragma", "no-cache");
    connection.setConnectTimeout(5000); //High timeout connections may prevent downloading files
    connection.setReadTimeout(30000); //This causes the connection to abort after 30 sec
    return connection;
}

So if the file can't be downloaded within 30 seconds, the file is partial and prevent Minecraft to run.

Then Minecraft 1.7.10 can't be downloaded in connections under 171 kB/s or 1369 kb/s.
How to reproduce: (not reliable)
Download lots of big files.
Possible fixes:

  • Give unlimited time to download files.

  • Use a quite large timeout (like 3 min).

Linked issues

Comments 2

Relates to MCL-1773 and MC-62519, which are both reported from pirated launchers.
If you want to proove the contrary, please provide a full launcher log.

Ticket resolved as incomplete, because no answer in a reasonable amount of time (1+ year), if it still happens, please update the ticket.

migrated

(Unassigned)

Unconfirmed

download, downloadgames, downloading

Retrieved