Error trying to download the V1 and V2 files with current version number

Report problems with documented functionality
User avatar
JoeWinograd
Posts: 2241
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Error trying to download the V1 and V2 files with current version number

Post by JoeWinograd » 29 Apr 2024, 15:07

Hi Folks,
I've been using two scripts for many years to download the current AHK version number, compare it to what I'm running, and offer to download the installer or ZIP file. The download of the V1 and V2 files with the version number stopped working sometime within the past few days. I extracted a small portion of the scripts to show the problem:

Code: Select all

; this is for V2
fileCurrentVersion:=A_Temp . "\AutoHotkeyCurrentVersionV2.txt"
urlCurrentVersion:="https://www.autohotkey.com/download/2.0/version.txt"
Try Download(urlCurrentVersion,fileCurrentVersion)
Catch Error as DownloadError
{
  DownloadErrorMessage:=DownloadError.Message
  MsgBox("Error Message " . DownloadErrorMessage . " trying to download V2 version number`n`nURL=" . urlCurrentVersion . "`n`nFile=" . fileCurrentVersion,"AutoHotkey V2 Download Failed","4112")
  ExitApp
}
Run fileCurrentVersion
ExitApp

Code: Select all

; this is for V1
fileCurrentVersion:=A_Temp . "\AutoHotkeyCurrentVersionV1.txt"
urlCurrentVersion:="https://www.autohotkey.com/download/1.1/version.txt"
UrlDownloadToFile,%urlCurrentVersion%,%fileCurrentVersion%
If (ErrorLevel!=0)
{
  MsgBox,4112,AutoHotkey V1 Download Failed,Error Level=%ErrorLevel% trying to download V1 version number`n`nURL=%urlCurrentVersion%`n`nFile=%fileCurrentVersion%
  ExitApp
}
Run,%fileCurrentVersion%
ExitApp
Each of those snippets should download then open the text file with the version number (which they've done for the last many years), but are now producing an error:

AutoHotkey v2 version number download failed.png
AutoHotkey v2 version number download failed.png (11.28 KiB) Viewed 4141 times
AutoHotkey v1 version number download failed.png
AutoHotkey v1 version number download failed.png (10.65 KiB) Viewed 4141 times

I don't know if this should be characterized as a "Bug Report", but it seemed as good a place as any to post it. But an admin should move it to a more appropriate place, if need be. Btw, going to those files in a web browser works fine, so the "bug" would seem to be related to the download feature. Regards, Joe
Last edited by JoeWinograd on 01 May 2024, 02:41, edited 1 time in total.

TAC109
Posts: 1154
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Error trying to download the V1 and V2 files with current version number

Post by TAC109 » 29 Apr 2024, 17:45

Problems like this occur when the AutoHotkey administrators turn on Cloudflare monitoring, which can inject ‘I am not a robot' code into the interaction.

All should return to normal when the Cloudflare monitoring is switched off.

Cheers
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe

User avatar
JoeWinograd
Posts: 2241
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Error trying to download the V1 and V2 files with current version number

Post by JoeWinograd » 29 Apr 2024, 18:05

Hi TAC,
Thanks for the explanation...much appreciated! Cheers, Joe

TAC109
Posts: 1154
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Error trying to download the V1 and V2 files with current version number

Post by TAC109 » 30 Apr 2024, 18:35

@joedf Do you still have some Cloudflare restrictions in place? UrlDownloadToFile from the AutoHotkey site is still not working.

Cheers
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe

User avatar
joedf
Posts: 9097
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: Error trying to download the V1 and V2 files with current version number

Post by joedf » 30 Apr 2024, 23:23

No, just checked Cloudflare WAF / firewall rules, Hosting panel firewall, server iptables, and .htaccess files.... Didnt find anything blocking.... We even whitelist the /download/* folder on cloudflare...
I think there's something I'm missing.
Maybe @tank knows?

Interesting / weird, I can do wget and curl just fine...
I even tried https://www.autohotkey.com/download/versions.txt
All working with wget or curl but not UrlDownloadToFile... :think:
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]

TAC109
Posts: 1154
Joined: 02 Oct 2013, 19:41
Location: New Zealand

Re: Error trying to download the V1 and V2 files with current version number

Post by TAC109 » 01 May 2024, 00:51

Thanks for looking into this @joedf.
I’m also having problems using UrlDownloadToFile on https://www.autohotkey.com/mpress/mpress.219.zip, used in the Ahk2Exe Updater.

Cheers
My scripts:-
XRef - Produces Cross Reference lists for scripts
ReClip - A Text Reformatting and Clip Management utility
ScriptGuard - Protects Compiled Scripts from Decompilation
I also maintain Ahk2Exe

User avatar
tank
Posts: 3164
Joined: 28 Sep 2013, 22:15
Location: CarrolltonTX
Contact:

Re: Error trying to download the V1 and V2 files with current version number

Post by tank » 02 May 2024, 10:23

really sounds like a problem based on useragent, possible i broke it the other day
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Telegram is the best way to reach me
https://t.me/ttnnkkrr
If you have forum suggestions please submit a
Check Out WebWriter

User avatar
joedf
Posts: 9097
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: Error trying to download the V1 and V2 files with current version number

Post by joedf » 02 May 2024, 12:23

:mrgreen: Oh useragent!!! Right, makes sense. Didnt even cross my mind.
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]

User avatar
JoeWinograd
Posts: 2241
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Error trying to download the V1 and V2 files with current version number

Post by JoeWinograd » 06 May 2024, 12:05

Hi Folks,
I don't know if anyone is looking into this, but just a quick note to say that, as of a few minutes ago, it is still not working (neither V1 nor V2). Regards, Joe


User avatar
kczx3
Posts: 1677
Joined: 06 Oct 2015, 21:39

Re: Error trying to download the V1 and V2 files with current version number

Post by kczx3 » 06 May 2024, 14:37

joedf wrote:
06 May 2024, 14:23
Weird, https://autohotkey.com/download/1.1/version.txt works for me...
It only does not work when using URLDownloadToFile or Download...

User avatar
gregster
Posts: 9224
Joined: 30 Sep 2013, 06:48

Re: Error trying to download the V1 and V2 files with current version number

Post by gregster » 06 May 2024, 15:02

Interestingly, the respective codes from example #4 (asynchronous HTTP request) work for me in v1 and v2:
https://www.autohotkey.com/docs/v2/lib/Download.htm#ExXHR
https://www.autohotkey.com/docs/v1/lib/URLDownloadToFile.htm#XHR

User avatar
kczx3
Posts: 1677
Joined: 06 Oct 2015, 21:39

Re: Error trying to download the V1 and V2 files with current version number

Post by kczx3 » 06 May 2024, 15:09

I tried them and they didn't work. The WinHTTP example timed out and the XMLHttpRequest example gave error 12031.

User avatar
joedf
Posts: 9097
Joined: 29 Sep 2013, 17:08
Location: Canada
Contact:

Re: Error trying to download the V1 and V2 files with current version number

Post by joedf » 06 May 2024, 21:11

okay, wierd... Works on one PC but not on my other PC...
Image Image Image Image Image
Windows 10 x64 Professional, Intel i5-8500, NVIDIA GTX 1060 6GB, 2x16GB Kingston FURY Beast - DDR4 3200 MHz | [About Me] | [About the AHK Foundation] | [Courses on AutoHotkey]
[ASPDM - StdLib Distribution] | [Qonsole - Quake-like console emulator] | [LibCon - Autohotkey Console Library]

User avatar
tank
Posts: 3164
Joined: 28 Sep 2013, 22:15
Location: CarrolltonTX
Contact:

Re: Error trying to download the V1 and V2 files with current version number

Post by tank » 07 May 2024, 18:45

I have looked at every setting relted to firewall or cloudflare,
this one is very strange
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Telegram is the best way to reach me
https://t.me/ttnnkkrr
If you have forum suggestions please submit a
Check Out WebWriter

User avatar
JoeWinograd
Posts: 2241
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Error trying to download the V1 and V2 files with current version number

Post by JoeWinograd » 11 May 2024, 22:29

joedf wrote:Works on one PC but not on my other PC
Fails on every PC here that I've tried it on, including W8.1, W10, and W11. Still happening...just tried it on all three of those systems...both V1 and V2. Hoping someone can fix this. Regards, Joe

User avatar
tank
Posts: 3164
Joined: 28 Sep 2013, 22:15
Location: CarrolltonTX
Contact:

Re: Error trying to download the V1 and V2 files with current version number

Post by tank » 11 May 2024, 22:34

I wish I had even an error message
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed;
Telegram is the best way to reach me
https://t.me/ttnnkkrr
If you have forum suggestions please submit a
Check Out WebWriter

User avatar
JoeWinograd
Posts: 2241
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Error trying to download the V1 and V2 files with current version number

Post by JoeWinograd » 12 May 2024, 01:55

I get the feeling that it has something to do with the https://www.autohotkey.com domain, as downloads from other domains work. For example, the downloads work fine in the scripts I posted with this URL:

https://raw.githubusercontent.com/AutoHotkey/AutoHotkey/alpha/license.txt

Also, it's not just the version files that fail...downloads of the EXE and ZIP files fail, too. As a temporary solution, would it be possible to host the downloads elsewhere until the https://www.autohotkey.com downloads are fixed?


User avatar
JoeWinograd
Posts: 2241
Joined: 10 Feb 2014, 20:00
Location: U.S. Central Time Zone

Re: Error trying to download the V1 and V2 files with current version number

Post by JoeWinograd » 13 May 2024, 03:20

Thanks for the idea. although I don't see anything with V1 in it at the first link. I know that V1 is deprecated, but I have high hopes that we may see something beyond 1.1.37.02, especially if a future version of Windows makes it necessary. It is not feasible to convert from V1 to V2 all the programs (or even the most important ones) that I wrote, including the required supporting libraries that I did not write.

Post Reply

Return to “Bug Reports”