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

Resolution Errors after updating to 5.23.1 #742

Closed
der-eismann opened this issue Feb 23, 2024 · 6 comments
Closed

Resolution Errors after updating to 5.23.1 #742

der-eismann opened this issue Feb 23, 2024 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@der-eismann
Copy link

After updating to 5.23.1 there are suddenly errors popping up regarding downloading POMs from org.openrewrite.maven.internal.MavenPomDownloader. However one is an internal repository that definitely works and one is a Spring repository that's nowhere defined in our projects.

[ERROR] Failed to access maven repository https://nexus.example.com/repository/maven-public
org.openrewrite.maven.internal.MavenPomDownloader$HttpSenderResponseException: HTTP 400
[ERROR] Failed to access maven repository https://spring-roo-repository.springsource.org/release
org.openrewrite.maven.internal.MavenPomDownloader$HttpSenderResponseException: HTTP 403

Since it's the only change that happened, must have come from #725, 5.23.0 didn't have these errors. Also errors in this context would mean something went wrong, however the rewriting works as good as before, so the errors are a bit misleading?

What version of OpenRewrite are you using?

I am using

  • Maven/Gradle plugin v5.23.1

How are you running OpenRewrite?

I am using the Maven plugin, and my project is a single module project.

<plugin>
  <groupId>org.openrewrite.maven</groupId>
  <artifactId>rewrite-maven-plugin</artifactId>
  <version>5.23.1</version>
</plugin>

What is the smallest, simplest way to reproduce the problem?

I don't really know where the errors come from.

What is the full stack trace of any errors you encountered?

[ERROR] Failed to access maven repository https://spring-roo-repository.springsource.org/release
org.openrewrite.maven.internal.MavenPomDownloader$HttpSenderResponseException: HTTP 403
    at org.openrewrite.maven.internal.MavenPomDownloader.lambda$sendRequest$1 (MavenPomDownloader.java:145)
    at dev.failsafe.Functions.lambda$toCtxSupplier$11 (Functions.java:243)
    at dev.failsafe.Functions.lambda$get$0 (Functions.java:46)
    at dev.failsafe.internal.RetryPolicyExecutor.lambda$apply$0 (RetryPolicyExecutor.java:74)
    at dev.failsafe.SyncExecutionImpl.executeSync (SyncExecutionImpl.java:187)
    at dev.failsafe.FailsafeExecutor.call (FailsafeExecutor.java:376)
    at dev.failsafe.FailsafeExecutor.get (FailsafeExecutor.java:112)
    at org.openrewrite.maven.internal.MavenPomDownloader.sendRequest (MavenPomDownloader.java:141)
    at org.openrewrite.maven.internal.MavenPomDownloader.normalizeRepository (MavenPomDownloader.java:738)
    at org.openrewrite.maven.internal.MavenPomDownloader.distinctNormalizedRepositories (MavenPomDownloader.java:663)
    at org.openrewrite.maven.internal.MavenPomDownloader.download (MavenPomDownloader.java:502)
    at org.openrewrite.maven.tree.ResolvedPom$Resolver.resolveParentPom (ResolvedPom.java:492)
    at org.openrewrite.maven.tree.ResolvedPom$Resolver.resolveParentPropertiesAndRepositoriesRecursively (ResolvedPom.java:399)
    at org.openrewrite.maven.tree.ResolvedPom$Resolver.resolveParentsRecursively (ResolvedPom.java:357)
    at org.openrewrite.maven.tree.ResolvedPom.resolveDependencies (ResolvedPom.java:838)
    at org.openrewrite.maven.tree.ResolvedPom.resolveDependencies (ResolvedPom.java:754)
    at org.openrewrite.maven.tree.MavenResolutionResult.resolveDependencies (MavenResolutionResult.java:174)
    at org.openrewrite.maven.MavenParser.parseInputs (MavenParser.java:116)
    at org.openrewrite.Parser.parse (Parser.java:59)
    at org.openrewrite.maven.MavenMojoProjectParser.parseMaven (MavenMojoProjectParser.java:541)
    at org.openrewrite.maven.MavenMojoProjectParser.listSourceFiles (MavenMojoProjectParser.java:149)
    at org.openrewrite.maven.AbstractRewriteMojo.loadSourceSet (AbstractRewriteMojo.java:254)
    at org.openrewrite.maven.AbstractRewriteMojo.listResults (AbstractRewriteMojo.java:236)
    at org.openrewrite.maven.AbstractRewriteRunMojo.execute (AbstractRewriteRunMojo.java:62)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:342)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:330)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:213)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:175)
    at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:76)
    at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:163)
    at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:160)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:827)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:272)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:195)
    at jdk.internal.reflect.DirectMethodHandleAccessor.invoke (DirectMethodHandleAccessor.java:103)
    at java.lang.reflect.Method.invoke (Method.java:580)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)

Are you interested in contributing a fix to OpenRewrite?

@der-eismann der-eismann added the bug Something isn't working label Feb 23, 2024
@timtebeek
Copy link
Contributor

Thanks for the detailed report! Indeed showing these as errors is perhaps a bit too strong; as a first step I've changed the log level to warnings. 50c4ffb

These exceptions weren't surfaced before #725 , which lead to

The stack trace you've posted is helpful; I'll see if there's anything we can do upstream to handle this differently, or show these particular errors without a stack trace in the plugin.

@der-eismann
Copy link
Author

der-eismann commented Feb 23, 2024

I'm wondering if the POM download has an issue in general, as I said the internal Nexus works fine. But calling only https://nexus.example.com/repository/maven-public gives a 400 with

Repository path must have another '/' after initial '/'

The spring roo repository is hosted on S3 and doesn't have an index, but it's working as well, so that's a second false positive. Any better strategy than just checking the root URLs of the repositories?

@timtebeek
Copy link
Contributor

Hi yes we're a little too eager reporting such issues it seems; something I'm hoping to fix in

@timtebeek timtebeek moved this to In Progress in OpenRewrite Feb 23, 2024
@timtebeek timtebeek self-assigned this Feb 23, 2024
sambsnyd pushed a commit to openrewrite/rewrite that referenced this issue Feb 23, 2024
* Only report unrecovered repositoryAccessFailed

Following questions like openrewrite/rewrite-maven-plugin#742

* Add trailing slash known to trip up some repositories
@timtebeek
Copy link
Contributor

I've gone ahead and created a new release; I suspect that will improve the handling already; I'd hope to hear if that's indeed the case: https://github.com/openrewrite/rewrite-maven-plugin/releases/tag/v5.23.2

Closing this issue on the assumption that it's improved or even resolved, but will monitor for replies in case we need to revisit. Thanks again for reporting your findings!

@github-project-automation github-project-automation bot moved this from In Progress to Done in OpenRewrite Feb 26, 2024
@der-eismann
Copy link
Author

Issue is solved indeed for me with 5.23.2, thanks!

@timtebeek
Copy link
Contributor

Awesome; thanks for the quick feedback!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

No branches or pull requests

2 participants