Coder Social home page Coder Social logo

Comments (21)

BeniaminSavu avatar BeniaminSavu commented on July 28, 2024

Hi,

Thank you for your feedback. In what situation this happens ? If you can please give me some more details I would be grateful. What were the steps that you made ? So I can get a better understanding on where the problem might be.

Are you behind a proxy ?

from oxygen-git-client-addon.

stefan-jung avatar stefan-jung commented on July 28, 2024

When openening the project/repository, the message appears at the button of the plugin frame.

oxygen-git

Clicking on the push-button does not result in anything, no user feedback is given.

oxygen-git2

Yes, I'm behind a proxy, the protocol used is SSH and the repository has Git submodules, uses Git hooks and Git flow.

from oxygen-git-client-addon.

BeniaminSavu avatar BeniaminSavu commented on July 28, 2024

We think we found the problem, so we released a new build. Please make an update and tell us if the problem still persists. Also if you are behind a proxy make sure that the proxy is set in Oxygen. For that, in Oxygen, go to Options -> Preferences -> Network Connection Settings -> Proxy.

If the problem still persists we recommend that you run Oxygen from a console and send us the console output.

from oxygen-git-client-addon.

tofi86 avatar tofi86 commented on July 28, 2024

I also had this problem. Latest version solved it.

from oxygen-git-client-addon.

stefan-jung avatar stefan-jung commented on July 28, 2024

Thanks @BeniaminSavu, when launching oXygen via the launcher the problem still exists.

oxygen-git

The proxy settings look good to me. At least I can check for updates and download plugins from oXygen.

But: If I launch oXygen XML from Git Bash, it works. 😄 Can I force oXygen to use my Git Bash environment?

oxygen-git2


Offtopic: If you'd like to translate Cannot reach host to German (everything else is translated in the frame), please write Host nicht erreichbar.

from oxygen-git-client-addon.

BeniaminSavu avatar BeniaminSavu commented on July 28, 2024

I released a new build so that we can test what happens when you launch Oxygen via the launcher. For that you have to create a file log4j.properties and put it in the Oxygen's installed directory. The file must contain:

`log4j.rootCategory= info, R2

log4j.category.com.oxygenxml.git=debug

log4j.appender.R2=org.apache.log4j.RollingFileAppender
log4j.appender.R2.File=${user.home}/Desktop/oxygenLog/oxygen.log
log4j.appender.R2.MaxFileSize=12000KB
log4j.appender.R2.MaxBackupIndex=20
log4j.appender.R2.layout=org.apache.log4j.PatternLayout
log4j.appender.R2.layout.ConversionPattern=%r %p [ %t ] %c - %m%n`

I will also upload the file:
log4j.zip

After you put the file in the Oxygen's installed directory, launch the oxygen via the launcher. Repeat the same scenario as you did previously, when you tried to commit and push. When you are done, close Oxygen. On the desktop will appear a folder called oxygenLog and in that folder is a file named oxygen.log. I need the content from that file to see what's happening.

from oxygen-git-client-addon.

stefan-jung avatar stefan-jung commented on July 28, 2024

oxygen.zip

from oxygen-git-client-addon.

BeniaminSavu avatar BeniaminSavu commented on July 28, 2024

After studying the log and making some tests with a ssh cloned repository we found out some things, that might be or not correct. So we want to be sure that we are on the good path. That's why it would be great if you can clarify this.

So what I did was that I generated a ssh key using the git bash and put the public key in my github account settings. Then I cloned a repository using ssh. Afterwards I open Oxygen and tested that repository with my plugin. It didn't have any problems, it worked as it was expected to work. The default folder location for my ssh key was [$USER_HOME]/.ssh. By default JGit checks this location to see whether or not there is a ssh key set. My assumption is that your ssh keys are in a different location and JGit doesn't know how to get them.

I want to know if your ssh keys are in a different folder so that I can treat this case accordingly. Or maybe you can tell us what is the correct way to handle this situation

Thank you

from oxygen-git-client-addon.

stefan-jung avatar stefan-jung commented on July 28, 2024

Nope, that's correct here:

eike@P01470 MINGW64 ~
$ ls -l ~/.ssh
total 10
-rw-r--r-- 1 eike 1049089  192 Mrz 31 11:07 config
-rw-r--r-- 1 eike 1049089  887 Apr  6  2016 id_rsa
-rw-r--r-- 1 eike 1049089  214 Apr  6  2016 id_rsa.pub
-rw-r--r-- 1 eike 1049089 1443 Dez 30  2016 known_hosts

And the SSH agent is told to use them and it works in Git Bash.

eike@P01470 MINGW64 ~
$ less ~/.ssh/config

Host ser-dita-vm-1.dakosy.de
        KexAlgorithms +diffie-hellman-group1-sha1
  HostKeyAlgorithms +ssh-dss
host stash.dakosy.de
 HostName stash.dakosy.de
 IdentityFile ~/.ssh/id_rsa
 User eike
(END)

So I assume, the SSH agent ist not used, see https://gist.github.com/quidryan/5449155.

from oxygen-git-client-addon.

stefan-jung avatar stefan-jung commented on July 28, 2024

As I mentioned before ☝️ :

But: If I launch oXygen XML from Git Bash, it works. 😄 Can I force oXygen to use my Git Bash environment?

from oxygen-git-client-addon.

BeniaminSavu avatar BeniaminSavu commented on July 28, 2024

Hi,

We investigated a little bit about this SSH agent. So I configured one myself and played a bit with it. We came to the conclusion that you have a passphrase for your SSH and when you enter in Git Bash, you are asked for that passphrase, correct me if I am wrong. To answer your question about Oxygen and Git Bash, the way to force Oxygen to use Git Bash environment is as you already did, by launching it from Git Bash, although I personally didn't manage tot reproduce your scenario when you launched Oxygen from Git Bash and everything worked fine.

In conclusion, to support the connection via the SSH we need to ask for the passphrase. So on the next release (which will be during this day), Oxygen will ask you for your passphrase to establish the connection.

To implement the SSH agent we need to study the licensees and make sure that it will work on all platforms. But for the moment we will provide this functionality with the passphrase. From my side it seemed to work well. We would appreciate if you can give it a try when the new release comes out.

Thank you again for all your feedback.

from oxygen-git-client-addon.

stefan-jung avatar stefan-jung commented on July 28, 2024

Hi @BeniaminSavu,

We investigated a little bit about this SSH agent. So I configured one myself and played a bit with it. We came to the conclusion that you have a passphrase for your SSH and when you enter in Git Bash, you are asked for that passphrase, correct me if I am wrong.

Nope, there's nothing to enter.

We would appreciate if you can give it a try when the new release comes out.

Sure

from oxygen-git-client-addon.

BeniaminSavu avatar BeniaminSavu commented on July 28, 2024

But your SSH is protected by a passphrase ?

from oxygen-git-client-addon.

stefan-jung avatar stefan-jung commented on July 28, 2024

By key

from oxygen-git-client-addon.

stefan-jung avatar stefan-jung commented on July 28, 2024

When launching Git Bash, the ssh-agent.exe is automatically launched and then loads the SSH keys from ~/.ssh.

ssh

I never need to enter username or password when using Git Bash or a GUI client like Gitkraken, only for repositories which are using the HTTPS protocol.


Further reading

from oxygen-git-client-addon.

BeniaminSavu avatar BeniaminSavu commented on July 28, 2024

We released a new version. From my side everything seems to work fine but we think we are missing something.

So if the problem is still there, we improved the log and if you can, we would appreciate if you can send us again the logging files. For that delete the old log folder from desktop. I also assume you still have the lo4j.properties in the Oxygen's install directory, if not, you can put it again.

What we want is 2 tests, one launching Oxygen via the launcher and the second one launching Oxygen from Git Bash. Repeat the same actions as you did before. After the first test, put the oxygen.log file aside (so that we have the logs in separate files, it will be easy for us to see what is happening) and then delete the folder oxygenLog, after this continue with the second test.

Thank you

from oxygen-git-client-addon.

stefan-jung avatar stefan-jung commented on July 28, 2024

Hi @BeniaminSavu,

I misunderstood you passphrase question. I only used an SSH key without an additional passphrase. I read Working with SSH key passphrases and now have created a passphrase. I completed both tests with the passphrase activated.

The results did not change. It works when starting Oxygen via Git Bash but it does when launching it directly (see screencast 1).


Test 1

  • Oxygen is launched normally.
  • Host is not found.
  • The passphrase is not accepted!

screencast1


Test 2

  • Oxygen is launched from Git Bash
  • Host is found
  • Passphrase is accepted

screencast2


Log Files: oxygenLog.zip


Additional Request: Change the behavior of the Please enter your SSH passphrase dialog and rename it to something like Please enter your SSH passphrase. If you don't have one, press Enter. In that case, Oxygen should not ask again for a passphrase.

from oxygen-git-client-addon.

BeniaminSavu avatar BeniaminSavu commented on July 28, 2024

Test 1 log - Oxygen is launched normaly:

41609 DEBUG com.oxygenxml.git.service.GitAccess - Load repository C:\Users\eike\DITA\globaledition
41609 DEBUG  com.oxygenxml.git.service.GitAccess - User home U:\
41609 DEBUG  com.oxygenxml.git.service.GitAccess - SSH dir exists true
41609 DEBUG  com.oxygenxml.git.service.GitAccess - SSH resource path U:\.ssh\known_hosts

Test 2 log - Oxygen is launched from Git Bash:

29547 DEBUG com.oxygenxml.git.service.GitAccess - Load repository C:\Users\eike\DITA\globaledition
29547 DEBUG com.oxygenxml.git.service.GitAccess - User home C:\Users\eike
29547 DEBUG com.oxygenxml.git.service.GitAccess - SSH dir exists true
29547 DEBUG  com.oxygenxml.git.service.GitAccess - SSH resource path C:\Users\eike\.ssh\config
29547 DEBUG  com.oxygenxml.git.service.GitAccess - SSH resource path C:\Users\eike\.ssh\id_rsa
29547 DEBUG  com.oxygenxml.git.service.GitAccess - SSH resource path C:\Users\eike\.ssh\id_rsa.pub
29547 DEBUG  com.oxygenxml.git.service.GitAccess - SSH resource path C:\Users\eike\.ssh\known_hosts

It seems like in the first test JGit does't detect the right user home. So it seems to be a problem of environment. The code JGit uses to to find the user home is:

String home = SystemReader.getInstance().getenv("HOME"); 
   if (home != null)
	return resolve(null, home);
String homeDrive = SystemReader.getInstance().getenv("HOMEDRIVE"); 
    if (homeDrive != null) {
	String homePath = SystemReader.getInstance().getenv("HOMEPATH");
	if (homePath != null)
	      return new File(homeDrive, homePath);
    }

So JGit finds the HOMEDRIVE, which in the first test is "U:" and an empty HOMEPATH. That's why it doesn't work, it cannot find the SSH keys. It finds the .ssh folder but there is only the known_hosts file.

So the environment variables HOMEDRIVE and HOMEPATH are not the same as they are in Git Bash. We can add some more logging to see exactly what values those variables return. Or you can try in windows and set the HOMEDRIVE and HOMEPATH as it is in Git Bash. Another solution would be to copy .ssh folder from the C drive and paste it into the U drive

from oxygen-git-client-addon.

stefan-jung avatar stefan-jung commented on July 28, 2024

OMG, thanks a lot for taking all the time to fix this. I'll copied the .ssh directory to U:\. Now everything works fine here. Setting this variable is an administrator decision, not mine. U:\ is a personal network drive here. Why JGit does not use the %USERPROFILE% variable? Sorry for the confusion and noise. 😞

from oxygen-git-client-addon.

BeniaminSavu avatar BeniaminSavu commented on July 28, 2024

I'm glad we got it to work. Thank you for your cooperation, I really appreciate it. We don't know either why JGit doesn't use the %USERPROFILE% variable.

from oxygen-git-client-addon.

tofi86 avatar tofi86 commented on July 28, 2024

The "Cannot reach host" message still/again appears for me in latest plugin version. Any idea why?

from oxygen-git-client-addon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.