#22821 closed defect (worksforme)
Unable to update plugins hosted on GitHub because of redirects
Reported by: | gaben | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core | Version: | |
Keywords: | plugin update redirect | Cc: |
Description (last modified by )
What steps will reproduce the problem?
- Download pt_assistant plugin from GitHub which is not the latest one, e.g https://github.com/JOSM/pt_assistant/releases/tag/v2.1.15
- Move it to the JOSM's plugin folder
- Launch JOSM, open settings, go to Plugins tab, hit Download list button
- Finally, click
Update plugins
button
What is the expected result?
Plugins updated without an issue.
What happens instead?
Please provide any additional information below. Attach a screenshot if possible.
I experienced the same with continuos-download plugin.
URL:https://josm.openstreetmap.de/svn/trunk Repository:UUID: 0c6e7542-c601-0410-84e7-c038aed88b3b Last:Changed Date: 2023-03-14 22:49:24 +0100 (Tue, 14 Mar 2023) Build-Date:2023-03-15 02:30:57 Revision:18693 Relative:URL: ^/trunk Identification: JOSM/1.5 (18693 en) Windows 10 64-Bit OS Build number: Windows 10 Pro for Workstations 2009 (19045) Memory Usage: 1128 MB / 7266 MB (427 MB allocated, but free) Java version: 1.8.0_361-b09, Oracle Corporation, Java HotSpot(TM) 64-Bit Server VM Look and Feel: com.sun.java.swing.plaf.windows.WindowsLookAndFeel Screen: \Display0 1920×1200 (scaling 1.00×1.00) Maximum Screen Size: 1920×1200 Best cursor sizes: 16×16→32×32, 32×32→32×32 System property file.encoding: Cp1250 System property sun.jnu.encoding: Cp1250 Locale info: en_HU Numbers with default locale: 1234567890 -> 1234567890 Plugins: + pt_assistant (2.1.15-16-gad4605c) (...)
2023-03-16 18:16:55.933 SEVERE: org.openstreetmap.josm.plugins.PluginDownloadException: java.io.IOException: Too many redirects to the download URL detected. Aborting.. Cause: java.io.IOException: Too many redirects to the download URL detected. Aborting. org.openstreetmap.josm.plugins.PluginDownloadException: java.io.IOException: Too many redirects to the download URL detected. Aborting. at org.openstreetmap.josm.plugins.PluginDownloadTask.download(PluginDownloadTask.java:147) at org.openstreetmap.josm.plugins.PluginDownloadTask.realRun(PluginDownloadTask.java:175) at org.openstreetmap.josm.gui.PleaseWaitRunnable.doRealRun(PleaseWaitRunnable.java:94) at org.openstreetmap.josm.gui.PleaseWaitRunnable.run(PleaseWaitRunnable.java:142) at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source) at java.util.concurrent.FutureTask.run(Unknown Source) at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source) at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at java.lang.Thread.run(Unknown Source) Caused by: java.io.IOException: Too many redirects to the download URL detected. Aborting. at org.openstreetmap.josm.tools.HttpClient.connect(HttpClient.java:197) at org.openstreetmap.josm.tools.HttpClient.connect(HttpClient.java:124) at org.openstreetmap.josm.plugins.PluginDownloadTask.download(PluginDownloadTask.java:128) ... 8 more 2023-03-16 18:16:55.945 WARNING: Update plugins - <html>Downloading the following plugin has <strong>failed</strong>:<ul><li>pt_assistant</li></ul><br>Error message(untranslated): java.io.IOException: Too many redirects to the download URL detected. Aborting.</html>
Attachments (1)
Change History (10)
by , 2 years ago
Attachment: | JOSM_plugin_redirect.png added |
---|
comment:1 by , 2 years ago
Description: | modified (diff) |
---|
comment:2 by , 2 years ago
comment:3 by , 2 years ago
@gaben: Sanity check (there should only be two redirects), can you run
$ curl -Lv --head https://github.com/JOSM/pt_assistant/releases/latest/download/pt_assistant.jar 2>&1 | grep -i '^< location'
That will show the location redirects, like so:
< location: https://github.com/JOSM/pt_assistant/releases/download/v627/pt_assistant.jar < location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/134614521/135849ef-6ebc-4ecf-9a8f-b720dac484de?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20230316%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20230316T175646Z&X-Amz-Expires=300&X-Amz-Signature=c87c192dd55f124777d7ca0d37ba7287ed6523bb9a26f5adc0138a7d49c2fb00&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=134614521&response-content-disposition=attachment%3B%20filename%3Dpt_assistant.jar&response-content-type=application%2Foctet-stream
Order is redirect from /latest/download/
to /download/v627
then redirect to the actual download location.
That is less than the default (socket.maxredirects
of 5
).
comment:4 by , 2 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
socket.maxredirects
was set to 0
for whatever reason on my Windows machine. I've never changed it manually...
Anyway sorry for making noise and thanks for investigating!
comment:5 by , 2 years ago
No worries. I'm more concerned about why you never encountered that problem before -- as noted, there is a redirect from the /download/<version>/pt_assistant.jar
file to the actual download file.
comment:6 by , 2 years ago
I noticed about a year ago, but it didn't bother me enough to report as most of the plugins are hosted on JOSM's website or rarely update, so manually copying a few times a year is not a big deal, although bothering.
But this time I'm planning to release my plugin soon, which will require approximately biweekly updates and wanted to sort it out before.
comment:7 by , 2 years ago
Congrats on your plugin (I don't know what it is, but I'm sure it will be useful to people).
If you are using GitHub, you can copy the workflows from any of my plugins ( https://github.com/JOSM/MapRoulette/tree/master/.github/workflows for example). The autorelease is optional, but I've started adding it to plugins where we want to make a release every time we make a change. So mostly plugins that aren't maintained anymore.
If you need/want to put your plugin in the JOSM group, feel free to ping me or stoecker.
comment:8 by , 2 years ago
I sent an invitation to discuss the details via Matrix, but I see it's rejected. I'm going to release it under my name in the following weeks.
Unfortunately the predefined workflow doesn't fit the plugins (because of Gradle), so I've created my own.
comment:9 by , 2 years ago
Sorry, I rejected that invitation because I didn't know who it was.
EDIT: Please give me the username you'll be pinging me with so I don't reject it again.
That is odd -- it has worked for me in the past.