Open marc-christian-schulze opened 1 week ago
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)
Note that this is a server error where it issues a "redirect loop" that even browsers do not like:
@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)
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...
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
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...
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.
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.
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 :smile:
@merks Using -Declipse.p2.mirrors=false
worked for now and will be a valuable workaround until this is somehow mitigated. Thanks for the hint! :+1:
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.
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:
When trying to download the file manually using wget I see it got moved permanently: