kestra-io / plugin-git

Apache License 2.0
3 stars 4 forks source link

pushFlow not working: URI not supported #95

Closed schmanat closed 1 month ago

schmanat commented 1 month ago

Expected Behavior

Like in the Video below, it should work to push all flows from namespace to Gitlab (or Github) https://www.youtube.com/watch?v=OPlNKQZFeho.

Actual Behaviour

After I set up my flow, like in the video, I get only an error: URI not supported: https://git.schman.at

Steps To Reproduce

I created the same flow as in the video (https://www.youtube.com/watch?v=OPlNKQZFeho), see below. After I execute the flow I get the following error:

Exception caught during execution of ls-remote command URI not supported

The stacktrace looks like:

2024-10-03T05:53:14.405Z ERROR Exception caught during execution of ls-remote command
2024-10-03T05:53:14.405Z ERROR URI not supported: https://git.schman.at
2024-10-03T05:53:14.405Z TRACE org.eclipse.jgit.api.errors.JGitInternalException: Exception caught during execution of ls-remote command
    at org.eclipse.jgit.api.LsRemoteCommand.execute(LsRemoteCommand.java:188)
    at org.eclipse.jgit.api.LsRemoteCommand.callAsMap(LsRemoteCommand.java:149)
    at io.kestra.plugin.git.services.GitService.branchExists(GitService.java:60)
    at io.kestra.plugin.git.services.GitService.cloneBranch(GitService.java:34)
    at io.kestra.plugin.git.AbstractPushTask.run(AbstractPushTask.java:279)
    at io.kestra.plugin.git.AbstractPushTask.run(AbstractPushTask.java:45)
    at io.kestra.core.runners.WorkerTaskThread.doRun(WorkerTaskThread.java:76)
    at io.kestra.core.runners.AbstractWorkerThread.run(AbstractWorkerThread.java:57)
Caused by: org.eclipse.jgit.errors.NotSupportedException: URI not supported: https://git.schman.at
    at org.eclipse.jgit.transport.Transport.open(Transport.java:562)
    at org.eclipse.jgit.api.LsRemoteCommand.execute(LsRemoteCommand.java:159)
    ... 7 more

What I have tried so far? I tried the same flow with the git.Clone method, and this works. I also logged in the docker container and clone a repositority (and push changes) with my username and the access-token. It was only necessary to install git (apt-get update && apt-get install git) everything works. If I changed back to git.pushFlows I get an error (see above). I also created a github Repo to push my changes to github, without any success (the same error). Also with username and accesstoken.

Environment Information

Example flow

id: push_flow_to_git
namespace: schman.system

labels:
  env: dev
  project: schman

variables:
  username: 'schman'

tasks:
  - id: commit_and_push
    type: io.kestra.plugin.git.PushFlows
    username: "{{ vars.username }}"
    password: "{{ secret('GITLAB_ACCESS_TOKEN') }}"
    url: https://git.schman.at
    branch: develop
    sourceNamespace: schman
    targetNamespace: schman
    gitDirectory: flows
    commitMessage: Add flows from `schman` namespace
    includeChildNamespaces: true
    dryRun: true
schmanat commented 1 month ago

Sorry, the issue is wrong. It was my fault. In my flow i only submit the base URL of my Gitlab Instance, after i corrected it to my repo URL (https://git.schman.at/schman/kestra-flows) everything works as expected.