Pushing to git repository cloned from KIE Workbench repository

7.2k views Asked by At

I use KIE Workbench (6.1.0.Beta3) to edit my rules. Since there are some features not being supported by the Workbench yet (e.g. moving rules to other packages), I would like to do this stuff outside of KIE-WB.

For that, I cloned my repository with

git clone git://localhost:9418/my-kie-repository

which works fine. I edit some files, commit them locally and try a git push afterwards. But I get the error

fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

Since I am almost certain it is the first issue, something about credentials, I added to the .git/config file the lines

[credential "git://localhost:9418"]
    username = admin
    password = admin

Still, I get the previously mentioned error. And yes, the KIE Workbench is still running, I can also fetch/pull from there without problems.

Is there any way how to push back to that KIE Workbench repository? According to this message, one "might need to reconfigure origin", but I am unsure about how to change it.

Anyone an idea how to set this up correctly?

5

There are 5 answers

1
gammachen On

I find the ssh protocol request can deal with the request;

 $ git clone ssh://[email protected]:8001/uf-playground
cloning 'uf-playground'...
Authenticated with partial success.
Password authentication
Password: 
remote: Counting objects: 967, done
remote: Finding sources: 100% (967/967)
remote: Getting sizes: 100% (459/459)
remote: Total 967 (delta 385), reused 967 (delta 385)
receiveing objects: 100% (967/967), 154.58 KiB | 0 bytes/s, done.
dela with delta : 100% (385/385), done.
complete。

$ echo "heello" >> hello2
$ git add hello2 
$ git commit -i -m "add hello2 now" hello2 
[master a78762f] add hello2 now
 1 file changed, 1 insertion(+)
 create mode 100644 hello2
$ git push
Authenticated with partial success.
Password authentication
Password: 
Counting objects: 5, done.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 271 bytes | 0 bytes/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1)
remote: Updating references: 100% (1/1)
To ssh://[email protected]:8001/uf-playground
   273c880..a78762f  master -> master

take attention about the user: adminsf1

this user is add by add_user.sh of jboss/bin

Some tips: 1. there is no generating ssh-key and stroing to Guvnor .security directory work :<, i donnot understand what the function of the .security directory form the "org.uberfire.nio.git.ssh.cert.dir: Location of the directory .security where local certtificates will be stored. Default: working directory"

there are no more information exclude one file named hostkey.ser after add users :<

  1. i fail with using git protocol to push code to guvnor git server as well, however i can clone from git

this is what i do not understand ye

good luck

0
Hamster On

@gammachen's ssh example should work for you. I am running kie-wb on tomcat 7.

I have the following user:

<user username="tomcat" password="tomcat" roles="tomcat,role1,manager-gui,admin"/>

You can then do something like:

git clone ssh://tomcat@localhost:8001/uf-playgroundere

In my case password will be tomcat.

My .git/config looks like:

]$ cat uf-playground/.git/config 
[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
[remote "origin"]
    url = ssh://tomcat@localhost:8001/uf-playground
    fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
    remote = origin
    merge = refs/heads/master

Hope that helps.

0
Wong Liong Hung On

Solved the problem by adding the following to the config file under .ssh

Host localhost HostkeyAlgorithms +ssh-dss

0
aymens On

With Kie 6.5 I had a similar problem, couldn't push to kie-wb's git repository.

Following is how I found a way to push.

First clone your wb repo with the ssh protocol rather than git.

git clone ssh://kuser@localhost:8001/repository

kuser: your wb user

repository: your wb repo name

P.S. I did that with eclipse and needed to tell it the pwd too.

When you try to interact with the repo you've just cloned, you'd get an authorization error.

$ git pull                                                                                         
Unable to negotiate with 127.0.0.1 port 8001: no matching host key type found. Their offer: ssh-dss
fatal: Could not read from remote repository.                                                      

Please make sure you have the correct access rights                                                
and the repository exists. 

Looks like Kie-wb 6.5 's git's ssh server relies on dsa (dss) authentication.

So you might need to tell your git client to talk wb's git's ssh server language (auth algorithm):

$ git config core.sshCommand "ssh -oHostKeyAlgorithms=+ssh-dss"

After that if you try again to pull you'll get prompted for your wb user pwd, type it and you're ok:

$ git pull
Password authentication
Password:
Already up-to-date.

With eclipse git client you can save your credentials and won't have to write it every time.

It's even better to setup a dsa key and authenticate that way but unfortunately I didn't succeed to make it work till now although I could add my dsa key to the ssh server.

1
Cetin Yilmaz On
  1. Open new folder on your desktop
  2. Enter and open git bash here
  3. Call commands like

    git init
    git config core.sshCommand "ssh -oHostKeyAlgorithms=+ssh-dss"
    git pull ssh://[email protected]:8001/uf-playground
    

    Enter admin user password (default: admin)