-
Notifications
You must be signed in to change notification settings - Fork 194
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
Content is not allowed in prolog #2938
Comments
I've debugged this down to https://github.com/eclipse-equinox/p2/blob/413c76a0100011607dab79d1acde7ac283a5c704/bundles/org.eclipse.equinox.p2.metadata.repository/src/org/eclipse/equinox/internal/p2/metadata/repository/SimpleMetadataRepositoryFactory.java#L94
instead of original
So this seems to be a P2 bug, but I do not understand why the same target definition works fine in PDE. |
In Tycho 2.7.5 |
I've found the problem. tycho/p2-maven-plugin/src/main/java/org/eclipse/tycho/p2maven/transport/SharedHttpCacheStorage.java Lines 262 to 265 in f426ca2
|
What do you mean by " fails to restore the original file name" a redirection is a redirection to a different file, so there is no "original name".... |
@laeubi By original filename I mean the last segment of original request URL. |
Until P2 contract for cached file names is changed there is a following solution: if (isRedirected(code)) {
CacheEntry redirected = SharedHttpCacheStorage.this.getCacheEntry(getRedirect(uri), logger);
FileUtils.copyTo(redirected.getCacheFile(transportFactory), file);
return file;
} |
@basilevs do you like to propose a PR at best together with an integration-test to demonstrate the issue? |
I'm going to try writing an integration test. |
P2 relies on correct file extensions to parse cached files. Fixes eclipse-tycho#2938 See eclipse-equinox/p2#355
URLs returned from HttpServer.getAccessedUrls() are now stripped of context prefix. No callers have used these values until now. Fix concurrency bug in test utility class HttpServer request logging. Add verification of request logs to ensure that metadata repository does indeed unjars fresh, non-cached artifact. Ensure that cached XML file does not produce false negative in tests. Refactor tests.
P2 relies on correct file extensions to parse cached files. Fixes eclipse-tycho#2938 See P2 bug: eclipse-equinox/p2#355 Integration test infrastructure touch-ups: Fix HttpServer concurrency bug. URLs returned from HttpServer.getAccessedUrls() are now stripped of context prefix. No callers have used these values until now. Fix concurrency bug in test utility class HttpServer request logging.
OfflineModeTest fails with UnsupportedOperationException as HttpServer no longer allows direct access to access logs. Change OfflineModeTest to dedicated and limited mutation API for access logs.
Improve variable locality. Make error log assertion first, to facilitate investigation of non-network failures.
MultiMap.get() may return null.
P2 relies on correct file extensions to parse cached files. Fixes #2938 See P2 bug: eclipse-equinox/p2#355 Integration test infrastructure touch-ups: Fix HttpServer concurrency bug. URLs returned from HttpServer.getAccessedUrls() are now stripped of context prefix. No callers have used these values until now. Fix concurrency bug in test utility class HttpServer request logging.
OfflineModeTest fails with UnsupportedOperationException as HttpServer no longer allows direct access to access logs. Change OfflineModeTest to dedicated and limited mutation API for access logs.
Improve variable locality. Make error log assertion first, to facilitate investigation of non-network failures.
OfflineModeTest fails with UnsupportedOperationException as HttpServer no longer allows direct access to access logs. Change OfflineModeTest to dedicated and limited mutation API for access logs.
Improve variable locality. Make error log assertion first, to facilitate investigation of non-network failures.
MultiMap.get() may return null.
This is a backport from 5.0.0 P2 relies on correct file extensions to parse cached files. This change prevents cached file name from changing over HTTP redirect. See eclipse-equinox/p2#355 Fix HttpServer concurrency bug. URLs returned from HttpServer.getAccessedUrls() are now stripped of context prefix. No callers have used these values until now. Fix concurrency bug in test utility class HttpServer request logging. Add verification of request logs to ensure that metadata repository does indeed unjars fresh, non-cached artifact. Ensure that cached XML file does not produce false negative in tests. Refactor tests.
This is a backport from 5.0.0 P2 relies on correct file extensions to parse cached files. This change prevents cached file name from changing over HTTP redirect. See eclipse-equinox/p2#355 Fix HttpServer concurrency bug. URLs returned from HttpServer.getAccessedUrls() are now stripped of context prefix. No callers have used these values until now. Fix concurrency bug in test utility class HttpServer request logging. Add verification of request logs to ensure that metadata repository does indeed unjars fresh, non-cached artifact. Ensure that cached XML file does not produce false negative in tests. Refactor tests.
Tycho fails with
SAXParseException: Content is not allowed in prolog
when downloading target platform from a composite repository hosted on Github.Test steps
unzip content-prolog.zip
Expected result
Succesful execution of Maven
Actual result
Failure:
Environment
Same happens on Java 21
Reproducible on Tycho 4.0.3 and 3.0.5
Not reproducible on Tycho 2.7.5
The text was updated successfully, but these errors were encountered: