jenkinsci / plugin-modernizer-tool

MIT License
5 stars 5 forks source link

Authentication is required but no CredentialsProvider has been registered #103

Closed gounthar closed 1 month ago

gounthar commented 1 month ago

Jenkins and plugins versions report

While trying to work on the variant plugin, I got:

Forking and cloning variant locally 
Forking the repository to personal account... 
Repository forked to personal account successfully. 
Failed to process plugin: variant 
org.eclipse.jgit.api.errors.TransportException: https://github.com/gounthar/variant-plugin.git: Authentication is required but no CredentialsProvider has been registered
        at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:249)
        at org.eclipse.jgit.api.CloneCommand.fetch(CloneCommand.java:319)
        at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:189)
        at io.jenkins.tools.pluginmodernizer.core.github.GHService.fetchRepository(GHService.java:129)
        at io.jenkins.tools.pluginmodernizer.core.github.GHService.forkCloneAndCreateBranch(GHService.java:64)
        at io.jenkins.tools.pluginmodernizer.core.impl.PluginModernizer.start(PluginModernizer.java:40)
        at io.jenkins.tools.pluginmodernizer.cli.Main.run(Main.java:139)
        at picocli.CommandLine.executeUserObject(CommandLine.java:2030)
        at picocli.CommandLine.executeHelpRequest(CommandLine.java:2016)
        at picocli.CommandLine.executeHelpRequest(CommandLine.java:1987)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2272)
        at picocli.CommandLine$RunLast.execute(CommandLine.java:2421)
        at picocli.CommandLine.execute(CommandLine.java:2174)
        at io.jenkins.tools.pluginmodernizer.cli.Main.main(Main.java:35)
Caused by: org.eclipse.jgit.errors.TransportException: https://github.com/gounthar/variant-plugin.git: Authentication is required but no CredentialsProvider has been registered
        at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:687)
        at org.eclipse.jgit.transport.TransportHttp.openFetch(TransportHttp.java:465)
        at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:153)
        at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:105)
        at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1480)
        at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:238)
        ... 13 common frames omitted

What Operating System are you using (both controller, and any agents involved in the problem)?

GitPod

Reproduction steps

java -jar plugin-modernizer-cli/target/jenkins-plugin-modernizer-999999-SNAPSHOT.jar --dry-run --plugin-file plugins.txt --recipes AddPluginsBom,AddCodeOwner --cache-path /tmp

Expected Results

No error.

Actual Results

Failed to process plugin: variant 
org.eclipse.jgit.api.errors.TransportException: https://github.com/gounthar/variant-plugin.git: Authentication is required but no CredentialsProvider has been registered
        at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:249)
        at org.eclipse.jgit.api.CloneCommand.fetch(CloneCommand.java:319)
        at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:189)
        at io.jenkins.tools.pluginmodernizer.core.github.GHService.fetchRepository(GHService.java:129)
        at io.jenkins.tools.pluginmodernizer.core.github.GHService.forkCloneAndCreateBranch(GHService.java:64)
        at io.jenkins.tools.pluginmodernizer.core.impl.PluginModernizer.start(PluginModernizer.java:40)
        at io.jenkins.tools.pluginmodernizer.cli.Main.run(Main.java:139)
        at picocli.CommandLine.executeUserObject(CommandLine.java:2030)
        at picocli.CommandLine.executeHelpRequest(CommandLine.java:2016)
        at picocli.CommandLine.executeHelpRequest(CommandLine.java:1987)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2272)
        at picocli.CommandLine$RunLast.execute(CommandLine.java:2421)
        at picocli.CommandLine.execute(CommandLine.java:2174)
        at io.jenkins.tools.pluginmodernizer.cli.Main.main(Main.java:35)
Caused by: org.eclipse.jgit.errors.TransportException: https://github.com/gounthar/variant-plugin.git: Authentication is required but no CredentialsProvider has been registered
        at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:687)
        at org.eclipse.jgit.transport.TransportHttp.openFetch(TransportHttp.java:465)
        at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:153)
        at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:105)
        at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1480)
        at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:238)
        ... 13 common frames omitted

Anything else?

No response

Are you interested in contributing a fix?

No response

sridamul commented 1 month ago

I tried the same, but it works fine for me. Maybe the token might be expired?

This issue only arises in variant plugin?

gounthar commented 1 month ago

No, in lots of other plugins too. Maybe that's because I tried with a lot of plugins in the list.

jonesbusy commented 1 month ago

Possible rate limit ?

gounthar commented 1 month ago

I tried again with a PAT that I use elsewhere, and got the same result:

Repository forked to personal account successfully. 
Failed to process plugin: plugin-util-api 
org.eclipse.jgit.api.errors.TransportException: https://github.com/gounthar/plugin-util-api-plugin.git: Authentication is required but no CredentialsProvider has been registered
        at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:249)
        at org.eclipse.jgit.api.CloneCommand.fetch(CloneCommand.java:319)
        at org.eclipse.jgit.api.CloneCommand.call(CloneCommand.java:189)
        at io.jenkins.tools.pluginmodernizer.core.github.GHService.fetchRepository(GHService.java:129)
        at io.jenkins.tools.pluginmodernizer.core.github.GHService.forkCloneAndCreateBranch(GHService.java:64)
        at io.jenkins.tools.pluginmodernizer.core.impl.PluginModernizer.start(PluginModernizer.java:47)
        at io.jenkins.tools.pluginmodernizer.cli.Main.run(Main.java:139)
        at picocli.CommandLine.executeUserObject(CommandLine.java:2030)
        at picocli.CommandLine.executeHelpRequest(CommandLine.java:2016)
        at picocli.CommandLine.executeHelpRequest(CommandLine.java:1987)
        at picocli.CommandLine$AbstractParseResultHandler.execute(CommandLine.java:2272)
        at picocli.CommandLine$RunLast.execute(CommandLine.java:2421)
        at picocli.CommandLine.execute(CommandLine.java:2174)
        at io.jenkins.tools.pluginmodernizer.cli.Main.main(Main.java:35)
Caused by: org.eclipse.jgit.errors.TransportException: https://github.com/gounthar/plugin-util-api-plugin.git: Authentication is required but no CredentialsProvider has been registered
        at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:687)
        at org.eclipse.jgit.transport.TransportHttp.openFetch(TransportHttp.java:465)
        at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:153)
        at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:105)
        at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1480)
        at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:238)
        ... 13 common frames omitted
Forking and cloning git-client locally 
Repository already forked to personal account gounthar 
Invoking clean phase for plugin: git-client 
Invoking rewrite plugin for plugin: git-client 

So it may not be linked to the token generated by GitPod. What is strange is that I'm using the same token on two different machines, and the second machine still works fine. 🤔 And... Later in the process, other repositories go fine:

Caused by: org.eclipse.jgit.errors.TransportException: https://github.com/gounthar/token-macro-plugin.git: Authentication is required but no CredentialsProvider has been registered
        at org.eclipse.jgit.transport.TransportHttp.connect(TransportHttp.java:687)
        at org.eclipse.jgit.transport.TransportHttp.openFetch(TransportHttp.java:465)
        at org.eclipse.jgit.transport.FetchProcess.executeImp(FetchProcess.java:153)
        at org.eclipse.jgit.transport.FetchProcess.execute(FetchProcess.java:105)
        at org.eclipse.jgit.transport.Transport.fetch(Transport.java:1480)
        at org.eclipse.jgit.api.FetchCommand.call(FetchCommand.java:238)
        ... 13 common frames omitted
Forking and cloning pipeline-input-step locally 
Repository already forked to personal account gounthar 
Invoking clean phase for plugin: pipeline-input-step 
Invoking rewrite plugin for plugin: pipeline-input-step 
Skipping commit and pull request creation for pipeline-input-step 
Forking and cloning metrics locally 
Repository already forked to personal account gounthar 
Invoking clean phase for plugin: metrics 
Invoking rewrite plugin for plugin: metrics 
Skipping commit and pull request creation for metrics 
Forking and cloning jquery3-api locally 
Forking the repository to personal account... 
Repository forked to personal account successfully. 
Invoking clean phase for plugin: jquery3-api 
Invoking rewrite plugin for plugin: jquery3-api 
Skipping commit and pull request creation for jquery3-api 
Forking and cloning okhttp-api locally 
Repository already forked to personal account gounthar 
Invoking clean phase for plugin: okhttp-api 

And then the error comes back again and goes. 🤔