Modify

Opened 13 months ago

Closed 13 months ago

Last modified 11 months ago

#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 gaben)

What steps will reproduce the problem?

  1. 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
  2. Move it to the JOSM's plugin folder
  3. Launch JOSM, open settings, go to Plugins tab, hit Download list button
  4. Finally, click Update plugins button

What is the expected result?

Plugins updated without an issue.

What happens instead?

A dialog pops up:

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)

JOSM_plugin_redirect.png (12.9 KB ) - added by gaben 13 months ago.

Download all attachments as: .zip

Change History (10)

by gaben, 13 months ago

Attachment: JOSM_plugin_redirect.png added

comment:1 by gaben, 13 months ago

Description: modified (diff)

comment:2 by taylor.smock, 13 months ago

That is odd -- it has worked for me in the past.

comment:3 by taylor.smock, 13 months 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 gaben, 13 months ago

Resolution: worksforme
Status: newclosed

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 taylor.smock, 13 months 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 gaben, 13 months 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 taylor.smock, 13 months 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 gaben, 11 months 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.

Last edited 11 months ago by gaben (previous) (diff)

comment:9 by taylor.smock, 11 months 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.

Last edited 11 months ago by taylor.smock (previous) (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.