jxmorris12 / language_tool_python

a free python grammar checker 📝✅
GNU General Public License v3.0
434 stars 64 forks source link

Exception: Could not find at URL https://www.languagetool.org/download/LanguageTool-5.4.zip. #48

Closed PS-AI closed 2 years ago

PS-AI commented 3 years ago

Hi,

When trying to initialize Language Tool in Python code; tool = language_tool_python.LanguageTool('en-UK'),

the following exception is raised. Exception: Could not find at URL https://www.languagetool.org/download/LanguageTool-5.4.zip.

what is the work-around for this?

rennenc commented 3 years ago

We are having the same issue. The docker image won't start in production. We install latest stable upon image build (which recently changed to 5.5), and then at runtime it's searching for 5.4, because this value is hardcoded.

Seems like the server started to return 403: if req.status_code == 403: # Not found on AWS

jxmorris12 commented 3 years ago

So sorry about this! I just pushed a new version (@PS-AI @rennenc) that bumps the version number to 5.5. Any idea how I can avoid this problem next time?

rennenc commented 3 years ago
  1. I suspect that the problem is that it fails to download this url from AWS: https://www.languagetool.org/download/LanguageTool-5.4.zip. Perhaps there's an issue is that 5.4 is no longer exposed when accessing from AWS?

  2. We install the pre-requisite using this script: https://raw.githubusercontent.com/languagetool-org/languagetool/master/install.sh

We could have solved it by using versioned scripts (install_5-4.sh, install_5-5.sh, etc.). This way it won't bump automatically when you release, and our docker image will always be persistent.

rennenc commented 3 years ago

Seems like the issue is not fixed. We upgraded the version, it now tries to download this zip: https://www.languagetool.org/download/LanguageTool-5.5.zip and still fails.

Seems like the issue is that the URL is not available to download when accessing from AWS. We get 403.

jxmorris12 commented 3 years ago

Ok, this is really weird. (Also seems to be an issue with LanguageTool, not language_tool_python.)

This happens from any AWS server?

jxmorris12 commented 3 years ago

You could try posting on the LT forum: https://forum.languagetool.org/

iliasmiraoui commented 3 years ago

It fails locally as well on my end (with both the new and the old language_tool_python) while downloading works in the browser.

jxmorris12 commented 3 years ago

Thanks. So the meat of the issue is that automated dowloads fail, via something like wget 'https://languagetool.org/download/LanguageTool-stable.zip' or from the python interpreter:

>>> import requests
>>> url = 'https://www.languagetool.org/download/LanguageTool-5.5.zip'
>>> requests.get(url)
<Response [403]>

yet going to the link in the browser works fine. It seems like they're trying to block automated downloads. I'm not sure what the best way to proceed from here is.

rennenc commented 3 years ago

Seems to be fixed now

jxmorris12 commented 3 years ago

Thanks! This was scary.

AlphaMoury commented 3 years ago

I'm getting the same issue for Mac M1 on Safari 15.1

Could it be related with the user agents?

On Linux Mint under Brave Browser, seems to work fine.

PS-AI commented 3 years ago

@jxmorris12 The same error resurfaced again today. Is there a way to have the contents locally so that we do not depend on LT's server?

jxmorris12 commented 3 years ago

Huh. I just checked and the download worked fine for me. It does seem like a user agent issue, but it's only intermittent. I'll reopen this while we track down the issue.

jxmorris12 commented 2 years ago

Intermittent downloading issues seem fixed for now.