Auth conflicts with Tortoise software #1097

Closed
michapixel opened this Issue Dec 11, 2012 · 25 comments

Projects

None yet

7 participants

@michapixel

I've already setup the server and connected from a win7-32 machine, everything went smooth.

I'm now trying to connect from win7-64 and get this error:
http://i.imgur.com/TGnoU.png

This is what's in the error_log:

11:30:08 | Fetcher | d:\SparkleShare.tmp\Dropbox | Fetching folder: ssh://storage@xxx.xxx.xxx.xxx:22/home/storage/Dropbox
11:30:08 | Auth | Fetching host key for xxx.xxx.xxx.xxx
11:30:08 | Cmd | ssh-keyscan -t rsa -p 22 xxx.xxx.xxx.xxx
11:30:08 | Auth | Skipping fingerprint check
11:30:08 | Cmd | .tmp | git clone --progress --no-checkout --depth=1 "ssh://storage@xxx.xxx.xxx.xxx:22/home/storage/Dropbox" "d:\SparkleShare.tmp\Dropbox"
11:32:43 | Fetcher | fatal: Could not read from remote repository.
11:32:43 | Fetcher |
11:32:43 | Fetcher | Please make sure you have the correct access rights
11:32:43 | Fetcher | and the repository exists.
11:32:43 | Fetcher | Failed
11:32:43 | Fetcher | Failed to dispose properly: Diesem Objekt ist kein Prozess zugeordnet. bei System.Diagnostics.Process.EnsureState(State state)
bei System.Diagnostics.Process.EnsureState(State state)
bei System.Diagnostics.Process.GetProcessHandle(Int32 access, Boolean throwIfExited)
bei System.Diagnostics.Process.Kill()

bei SparkleLib.Git.SparkleFetcher.Stop()

this line
| Cmd | .tmp | git clone --progress --no-checkout --depth=1 "ssh://storage@188.40.245.142:22/home/storage/Dropbox" "d:\SparkleShare.tmp\Dropbox"
is where the Putty window comes up.

@hbons
Owner
hbons commented Dec 11, 2012

this has something to do with putty i think. i can't support auth using putty as i don't know anything about it...

@michapixel

I didn't decide to use putty. i din't ask for supporting putty either.
it's sparkleshare's windows client using it - or at least trying to use it.
now the question is: why is it doing so? my guess: you're using the systems protocol-handler for ssh, which in this case is putty (guess, i haven't looked for myself). if this is the case, what does sparkleshare use in case there is no putty on the machine it is installed? can i force this mode by editing the config?

@hbons
Owner
hbons commented Dec 11, 2012

it should spawn an ssh-agent process. does that appear at the beginning of the log?

@michapixel

yes.

@michapixel

i think i've found it:

http://i.imgur.com/iih8R.png

the spawned ssh-agent is from my tortoisesvn installation. not the original putty one.
in fact: the win7 32 machine has no svn client on board. what now?

@hbons
Owner
hbons commented Dec 11, 2012

i've had more reports of SparkleShare conflicting with a TortoiseGit/Svn installation. i'll need to look into this more. SparkleShare should probably hardcode the paths to its openssh and git binaries.

@tremel
tremel commented Dec 14, 2012

I had the same problems on a Win7 x64 machine with TortoiseGit installed before SparkleShare. Deinstallation of TortoiseGit didn't help, because of two environment variables pointing to the TortoisePlink binary in the TortoiseGit installation dir.
One of the was SVN_SSH, the other's name unfortunately I can't remember, sorry, but this was more explicit, easy to find.
After removing this ENV vars and reinstalling SparkleSare client all works fine.

@michapixel

@tremel unfortunately i need at least TortoiseSVN, and since it makes the same trouble, i cannot run Sparkleshare here. i hope this get's fixed soon.

@ghost
ghost commented Dec 20, 2012

I rather not have you hardcore the path though hbons. it would make Sparkleshare unusable for us that use PuTTY's ssh agent. Or well it would mean I'd have to look for an alternative

@hbons
Owner
hbons commented Dec 20, 2012

@xeross i'm not actively going to make it impossible to use Putty. i'm just saying that i can't support you on issues that happen due to using Putty as an ssh-agent.

for me, and most users, the ssh-agent is an implementation detail. my priority is making SparkleShare work for them.

if you know any other way of fixing this issue, that doesn't mess with your way of using SparkleShare, i would like to hear it.

since SparkleShare is open source, you can change it however you like. it doesn't mean i can support every swap of infrastructure in it.

@ghost
ghost commented Dec 20, 2012

An unsupported option to override the GIT_SSH env var through the config.xml would be nice.

Or a separate env var that gets applied to GIT_SSH internally.

@tkhh
tkhh commented Jan 9, 2013

I had the same problem (with TortoiseGit installed) ...
A temporary fix is to run SparkleShare.exe from a wrapper cmd script that unsets GIT_SSH first.

@ghost
ghost commented Feb 4, 2013

A good solution to this would be (In my opinion) what I suggested beforehand.

Add an <option name="git-ssh">/path/to/ssh</option> or similar to config.xml and make clear in the documentation that modifying this value is unsupported, and then use that value to set the GIT_SSH value for any subprocesses SparkleShare spawns.

This way people that want to run an unsupported configuration can still do so without modifying the source code, and others don't run into TortoiseGIT or other software breaking SparkleShare unintentionally

@hbons
Owner
hbons commented Feb 4, 2013

@xeross SparkleShare should run self contained as much as possible. it's not likely that anyone wants to use a different ssh.exe, they just want SparkleShare to work, which it doesn't now when TortoiseGit is installed.

do you know how the GIT_SSH variable works and what its value needs to be? i'm not sure how to set it for subprocesses... maybe you can send an example patch?

@hbons
Owner
hbons commented Feb 13, 2013

i've made a commit that sets the GIT_SSH on Windows to point to the bundled ssh.exe:
https://github.com/hbons/SparkleShare/tree/tortoise

is anyone able to test this?

@ghost
ghost commented Feb 14, 2013

I don't have any practical experience in this aspect, especially not on Windows. I was merely offering advice. Also now I think of it I can just overwrite SparkleShare's ssh.exe with PuTTY's plink.exe if I wanted to use an alternative implementation.

And considering the poor support for the normal SSH keyring I don't think it's all that uncommon to use PuTTY's plink.exe when you want a password protected key.

@hbons
Owner
hbons commented Mar 6, 2013

anyone able to test the branch yet?

@mfijn
mfijn commented Mar 18, 2013

@hbons is have been trying to make a build of the tortoise branch but i keep getting a build failed with the following error:

"C:\Program Files\Sparkleshare\SparkleShare\SparkleShare\Windows\SparkleShare.s
ln" (Rebuild target) (1) ->
"C:\Program Files\Sparkleshare\SparkleShare\SparkleShare\Windows\SparkleShare.c
sproj.metaproj" (Rebuild target) (2) ->
"C:\Program Files\Sparkleshare\SparkleShare\SparkleShare\Windows\SparkleShare.c
sproj" (Rebuild target) (6) ->
(CoreCompile target) ->
SparkleController.cs(70,24): error CS0234: The type or namespace name 'Git' d
oes not exist in the namespace 'SparkleLib' (are you missing an assembly refere
nce?) [C:\Program Files\Sparkleshare\SparkleShare\SparkleShare\Windows\SparkleS
hare.csproj]

I assume i am doing something wrong myself but i can't seem to find what..

@hbons
Owner
hbons commented Mar 18, 2013

@mfijn i've pushed a fix that should work.

@hbons
Owner
hbons commented May 21, 2013

note to self: might want to hard code paths to ssh.exe here.

@hbons
Owner
hbons commented Jun 23, 2013

i've merged the branch into master now. what it does is it sets GIT_SSH to SparkleShare's bundled version of ssh.exe for all git.exe processes spawned by SparkleShare only.

this should do the trick. please let me know if it doesn't.

@hbons hbons closed this Jun 23, 2013
@nowrap
nowrap commented Aug 6, 2013

I installed the 1.0 version on Windows 7 64bit. I've also running TortoiseSVN and TortoiseGit. Trying to connect to a self hosted server fails.

The debug log says:
18:05:52 | Fetcher | Permission denied (publickey).
18:05:52 | Fetcher | fatal: Could not read from remote repository.

But there are no connections attempts visible in the auth.log on the hosting server?

Is the here reported GIT_SSH path issue fixed in version 1.0?
Or do i have to add the extra line in the config.xml?

An ssh-agent process is spawn and visible in the task list.

@hbons
Owner
hbons commented Aug 7, 2013

@nowrap this has been fixed post 1.0.

@michapixel

@hbons Windows Client is still 1.0.0 do you have any timeframe when the win version will be updated?

@ccverg
ccverg commented Nov 20, 2013

@hbons you should claim the bounty on this issue: https://www.bountysource.com/issues/97715/claims. The money will go back into your account and you can re-allocate them onto other issues :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment