Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tycho 4.0.10: Stackoverflow when fetching from p2 repository that responds with 301 #4451

Open
marc-christian-schulze opened this issue Nov 26, 2024 · 11 comments

Comments

@marc-christian-schulze
Copy link

Today the issue 2358 re-occurred with Tycho 4.0.10 when the p2 server respond with a "301 Moved Permanently".

This is the log out from tycho:

[INFO] Downloaded from p2: https://download.eclipse.org/releases/2024-12/202411221000/plugins/org.eclipse.core.filesystem_1.11.100.v20241022-0806.jar (77 KB at 1 MB/s)
[INFO] Downloading from p2: https://0ms.dev/mirrors/eclipse//releases/2024-12/202411221000/plugins/org.eclipse.core.filesystem.source_1.11.100.v20241022-0806.jar
[INFO] Downloaded from p2: https://0ms.dev/mirrors/eclipse//releases/2024-12/202411221000/plugins/org.eclipse.core.filesystem.source_1.11.100.v20241022-0806.jar (87 KB at 375 KB/s)
[INFO] Downloading from p2: https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar
[INFO] ------------------------------------------------------------------------

... omitted ...

---------------------------------------------------
constituent[0]: file:/opt/hostedtoolcache/maven/3.9.6/x64/conf/logging/
constituent[1]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/plexus-utils-3.5.1.jar
constituent[2]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/wagon-http-3.5.3.jar
constituent[3]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/maven-shared-utils-3.3.4.jar
constituent[4]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/maven-settings-3.9.6.jar
constituent[5]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/maven-builder-support-3.9.6.jar
constituent[6]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/org.eclipse.sisu.inject-0.9.0.M2.jar
constituent[7]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/aopalliance-1.0.jar
constituent[8]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/wagon-provider-api-3.5.3.jar
constituent[9]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/maven-resolver-named-locks-1.9.18.jar
constituent[10]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/org.eclipse.sisu.plexus-0.9.0.M2.jar
constituent[11]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/javax.annotation-api-1.3.2.jar
constituent[12]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/failureaccess-1.0.1.jar
constituent[13]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/maven-settings-builder-3.9.6.jar
constituent[14]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/httpclient-4.5.14.jar
constituent[15]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/commons-lang3-3.12.0.jar
constituent[16]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/guice-5.1.0.jar
constituent[17]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/maven-compat-3.9.6.jar
constituent[18]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/guava-32.0.1-jre.jar
constituent[19]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/plexus-sec-dispatcher-2.0.jar
constituent[20]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/plexus-interpolation-1.26.jar
constituent[21]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/maven-resolver-connector-basic-1.9.18.jar
constituent[22]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/maven-slf4j-provider-3.9.6.jar
constituent[23]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/maven-resolver-util-1.9.18.jar
constituent[24]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/jcl-over-slf4j-1.7.36.jar
constituent[25]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/maven-resolver-transport-wagon-1.9.18.jar
constituent[26]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/maven-embedder-3.9.6.jar
constituent[27]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/httpcore-4.4.16.jar
constituent[28]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/wagon-file-3.5.3.jar
constituent[29]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/commons-cli-1.5.0.jar
constituent[30]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/maven-resolver-provider-3.9.6.jar
constituent[31]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/maven-resolver-impl-1.9.18.jar
constituent[32]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/maven-model-3.9.6.jar
constituent[33]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/maven-resolver-transport-http-1.9.18.jar
constituent[34]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/maven-resolver-transport-file-1.9.18.jar
constituent[35]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/maven-repository-metadata-3.9.6.jar
constituent[36]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/jansi-2.4.0.jar
constituent[37]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/javax.inject-1.jar
constituent[38]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/maven-model-builder-3.9.6.jar
constituent[39]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/slf4j-api-1.7.36.jar
constituent[40]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/maven-resolver-api-1.9.18.jar
constituent[41]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/commons-codec-1.16.0.jar
constituent[42]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/plexus-cipher-2.0.jar
constituent[43]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/wagon-http-shared-3.5.3.jar
constituent[44]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/maven-artifact-3.9.6.jar
constituent[45]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/plexus-component-annotations-2.1.0.jar
constituent[46]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/maven-plugin-api-3.9.6.jar
constituent[47]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/maven-resolver-spi-1.9.18.jar
constituent[48]: file:/opt/hostedtoolcache/maven/3.9.6/x64/lib/maven-core-3.9.6.jar
---------------------------------------------------
Exception in thread "main" java.lang.StackOverflowError
	at java.base/java.net.URI$Parser.scanIPv4Address(URI.java:3433)
	at java.base/java.net.URI$Parser.parseIPv4Address(URI.java:3473)
	at java.base/java.net.URI$Parser.parseServer(URI.java:3372)
	at java.base/java.net.URI$Parser.parseAuthority(URI.java:3284)
	at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3221)
	at java.base/java.net.URI$Parser.parse(URI.java:3177)
	at java.base/java.net.URI.<init>(URI.java:623)
	at java.base/java.net.URI.create(URI.java:904)
	at java.base/java.net.URI.resolve(URI.java:1089)
	at org.eclipse.tycho.p2maven.transport.SharedHttpCacheStorage$CacheLine.getRedirect(SharedHttpCacheStorage.java:422)
	at org.eclipse.tycho.p2maven.transport.SharedHttpCacheStorage.getCacheEntry(SharedHttpCacheStorage.java:92)
	at org.eclipse.tycho.p2maven.transport.SharedHttpCacheStorage.getCacheEntry(SharedHttpCacheStorage.java:92)
	at org.eclipse.tycho.p2maven.transport.SharedHttpCacheStorage.getCacheEntry(SharedHttpCacheStorage.java:92)
	at org.eclipse.tycho.p2maven.transport.SharedHttpCacheStorage.getCacheEntry(SharedHttpCacheStorage.java:92)
	at org.eclipse.tycho.p2maven.transport.SharedHttpCacheStorage.getCacheEntry(SharedHttpCacheStorage.java:92)

When trying to download the file manually using wget I see it got moved permanently:

$ wget https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar
--2024-11-26 09:08:08--  https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar
Auflösen des Hostnamens ftp2.osuosl.org (ftp2.osuosl.org) … 140.211.166.134, 2605:bc80:3010::134
Verbindungsaufbau zu ftp2.osuosl.org (ftp2.osuosl.org)|140.211.166.134|:443 … verbunden.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 301 Moved Permanently
Platz: https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar [folgend]
--2024-11-26 09:08:08--  https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar
Wiederverwendung der bestehenden Verbindung zu ftp2.osuosl.org:443.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 301 Moved Permanently
Platz: https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar [folgend]
--2024-11-26 09:08:09--  https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar
Wiederverwendung der bestehenden Verbindung zu ftp2.osuosl.org:443.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 301 Moved Permanently
Platz: https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar [folgend]
--2024-11-26 09:08:09--  https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar
Wiederverwendung der bestehenden Verbindung zu ftp2.osuosl.org:443.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 301 Moved Permanently
Platz: https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar [folgend]
--2024-11-26 09:08:09--  https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar
Wiederverwendung der bestehenden Verbindung zu ftp2.osuosl.org:443.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 301 Moved Permanently
Platz: https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar [folgend]
--2024-11-26 09:08:09--  https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar
Wiederverwendung der bestehenden Verbindung zu ftp2.osuosl.org:443.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 301 Moved Permanently
Platz: https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar [folgend]
--2024-11-26 09:08:09--  https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar
Wiederverwendung der bestehenden Verbindung zu ftp2.osuosl.org:443.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 301 Moved Permanently
Platz: https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar [folgend]
--2024-11-26 09:08:10--  https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar
Wiederverwendung der bestehenden Verbindung zu ftp2.osuosl.org:443.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 301 Moved Permanently
Platz: https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar [folgend]
--2024-11-26 09:08:10--  https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar
Wiederverwendung der bestehenden Verbindung zu ftp2.osuosl.org:443.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 301 Moved Permanently
Platz: https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar [folgend]
--2024-11-26 09:08:10--  https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar
Wiederverwendung der bestehenden Verbindung zu ftp2.osuosl.org:443.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 301 Moved Permanently
Platz: https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar [folgend]
--2024-11-26 09:08:10--  https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar
Wiederverwendung der bestehenden Verbindung zu ftp2.osuosl.org:443.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 301 Moved Permanently
Platz: https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar [folgend]
--2024-11-26 09:08:10--  https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar
Wiederverwendung der bestehenden Verbindung zu ftp2.osuosl.org:443.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 301 Moved Permanently
Platz: https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar [folgend]
--2024-11-26 09:08:11--  https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar
Wiederverwendung der bestehenden Verbindung zu ftp2.osuosl.org:443.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 301 Moved Permanently
Platz: https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar [folgend]
--2024-11-26 09:08:11--  https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar
Wiederverwendung der bestehenden Verbindung zu ftp2.osuosl.org:443.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 301 Moved Permanently
Platz: https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar [folgend]
--2024-11-26 09:08:11--  https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar
Wiederverwendung der bestehenden Verbindung zu ftp2.osuosl.org:443.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 301 Moved Permanently
Platz: https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar [folgend]
--2024-11-26 09:08:11--  https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar
Wiederverwendung der bestehenden Verbindung zu ftp2.osuosl.org:443.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 301 Moved Permanently
Platz: https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar [folgend]
--2024-11-26 09:08:11--  https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar
Wiederverwendung der bestehenden Verbindung zu ftp2.osuosl.org:443.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 301 Moved Permanently
Platz: https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar [folgend]
--2024-11-26 09:08:12--  https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar
Wiederverwendung der bestehenden Verbindung zu ftp2.osuosl.org:443.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 301 Moved Permanently
Platz: https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar [folgend]
--2024-11-26 09:08:12--  https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar
Wiederverwendung der bestehenden Verbindung zu ftp2.osuosl.org:443.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 301 Moved Permanently
Platz: https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar [folgend]
--2024-11-26 09:08:12--  https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar
Wiederverwendung der bestehenden Verbindung zu ftp2.osuosl.org:443.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 301 Moved Permanently
Platz: https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar [folgend]
--2024-11-26 09:08:12--  https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar
Wiederverwendung der bestehenden Verbindung zu ftp2.osuosl.org:443.
HTTP-Anforderung gesendet, auf Antwort wird gewartet … 301 Moved Permanently
Platz: https://ftp2.osuosl.org/pub/eclipse/releases/2024-12/202411221000/plugins/org.eclipse.core.jobs_3.15.400.v20240619-0602.jar [folgend]
20: Die Anzahl der Verweise ist zu groß.
@cdietrich
Copy link
Contributor

also saw problems similarly here
https://github.com/xtext/xtext-reference-projects/actions/runs/12026486458/job/33525570450

Error:  Stack overflow during pattern compilation near index 0
Error:  /+
Error:  ^
Error:  
Error:  To see the full stack trace of the errors, re-run Maven with the -e switch.
Error:  Re-run Maven using the -X switch to enable full debug logging.
Error: Process completed with exit code 1.
Exception in thread "main" java.lang.StackOverflowError
	at java.base/java.net.URI$Parser.scanIPv4Address(URI.java:3433)
	at java.base/java.net.URI$Parser.parseIPv4Address(URI.java:3473)
	at java.base/java.net.URI$Parser.parseServer(URI.java:3372)
	at java.base/java.net.URI$Parser.parseAuthority(URI.java:3284)
	at java.base/java.net.URI$Parser.parseHierarchical(URI.java:3221)
	at java.base/java.net.URI$Parser.parse(URI.java:3177)
	at java.base/java.net.URI.<init>(URI.java:623)
	at java.base/java.net.URI.create(URI.java:904)
	at java.base/java.net.URI.resolve(URI.java:1089)
	at org.eclipse.tycho.p2maven.transport.SharedHttpCacheStorage$CacheLine.getRedirect(SharedHttpCacheStorage.java:422)
	at org.eclipse.tycho.p2maven.transport.SharedHttpCacheStorage.getCacheEntry(SharedHttpCacheStorage.java:92)
	at org.eclipse.tycho.p2maven.transport.SharedHttpCacheStorage.getCacheEntry(SharedHttpCacheStorage.java:92)
	at org.eclipse.tycho.p2maven.transport.SharedHttpCacheStorage.getCacheEntry(SharedHttpCacheStorage.java:92)

@merks
Copy link
Contributor

merks commented Nov 26, 2024

Note that this is a server error where it issues a "redirect loop" that even browsers do not like:

image

@marc-christian-schulze
Copy link
Author

@merks true, but still imho a solid implementation in tycho should protect itself against a redirect loop as it can happen any time by accident - also via multiple redirect steps (across multiple servers)

@merks
Copy link
Contributor

merks commented Nov 26, 2024

Indeed, even firefox doesn't go into a tailspin but rather detects the cycle. It would be even trickier to implement detection if the cycle is longer...

@thahnen
Copy link
Contributor

thahnen commented Nov 26, 2024

Jumping on the train, we have the same exact error. I noticed the error happening in 4.0.8 but suspect it to also happen in 4.0.10 as the implementation hasn't changed. It started this morning and is highly blocking our pipelines.

It seems that in getCacheEntry, there is no check for when the case code == HttpURLConnection.HTTP_MOVED_PERM is whether the redirected, normalized URI is the same as the normalized URI as before, which leads to the loop.

Is there a way to disable the cache for now to continue working while the loop gets fixed in Tycho? I will try to see if I can propose a fix real quick.

Dumping a few looks, maybe they are useful (or not):
6092724774895616.log
5984706484764672.log
6346554791952384.log
4778113802960896.log

@merks
Copy link
Contributor

merks commented Nov 26, 2024

If the problem is the same as above with a bad mirror it should be possible to suppress the use of mirrors, maybe with -Declipse.p2.mirrors=false temporarily. That works with p2's own transport so maybe also with Tycho's specialized transport. I'm just guessing because I do see that in used Tycho's source code, so it's worth a try...

@thahnen
Copy link
Contributor

thahnen commented Nov 26, 2024

It should be possible, yes, I will have to test it tho.

But generally speaking, when Tycho encounters a redirect that is the same as before, it should remove it from the cache (if it was already there) and handle it like it is non-cached. Then maybe it should not use mirrors for this very URI.

@laeubi
Copy link
Member

laeubi commented Nov 26, 2024

Today the issue 2358 re-occurred with Tycho 4.0.10 when the p2 server respond with a "301 Moved Permanently".

Do you like to provide an integration-test to demonstrate the issue? That way we would make sure it does not reoccur in the future if it is fixed.

thahnen added a commit to thahnen/tycho that referenced this issue Nov 26, 2024
In case of a redirection loop for URI of a p2 repository, fail fast on a redirection loop. In this case provide a warning to the user and let the rest be handled by Tycho.
Otherwise there might be a StackOverflowError due to the recursion used and no check for whether the base URI is the same as the redirected URI.

This links to eclipse-tycho#4451 but does not fix it, only raising visibility for such cases.
@thahnen
Copy link
Contributor

thahnen commented Nov 26, 2024

I have a small PR for providing visibility in such cases (including which URI is the one causing this in one glance). This does not fix the issue here and I have to say I have no idea how to create an IT for that.

My guess would be to set up a small web server hosting a simple "p2 repository" for which the web server is redirecting it to itself? Or am I thinking to complex here 😄

@thahnen
Copy link
Contributor

thahnen commented Nov 26, 2024

@merks Using -Declipse.p2.mirrors=false worked for now and will be a valuable workaround until this is somehow mitigated. Thanks for the hint! 👍

@merks
Copy link
Contributor

merks commented Nov 26, 2024

I'm glad to be of limited help and glad this unblocks folks for the time being. Thanks also for the feedback that this actually works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants