P1D2::Server repository unreachable

Create issue
Issue #28 resolved
Former user created an issue

I am unable to connect to a server repository if I have to provide a user id and password. I specify the URL

smb://userid:password@rbams3c1/RDR_Exploratory/Exploratory_Activities/Categorization/Program Repository

(tried also Program\ Repository)

and receive the message that the message that the repository is unreachable.

Comments (15)

  1. Former user Account Deleted

    No, contacting the server from the command line doesn't seem to work either, but then, I'm no Unix guru. I tried all variations of this:

    hg serve smb://userid:password@rbams3c1/RDR_Exploratory/Exploratory_Activities/Categorization/Program Repository
    

    The password contains a dash. Is that a problem? The last item in the path contains a blank. I've also tried "\ " (without the quotes, backslash-blank) and "%20". I've also tried http: instead of smb:. Also tried putting everything after serve in quotes. No joy.

  2. Gustavo Picón

    I'm seeing this error with ssh repos (https repos seem to work fine). Running this in the command line:

    /Applications/MacHg.app/Contents/Resources/localhg clone 'ssh://camelot/hg/django-treebeard/'
    
    

    works. Clicking the test button in the Add Server Repository Dialog also seems to work:

    Last login: Fri Jun  4 21:45:39 on ttys009
    cd /tmp
    LOCALHG='/Applications/MacHg.app/Contents/Resources/localhg'
    $LOCALHG identify --cwd /tmp --config defaults.identify= --noninteractive --rev 0 ssh://camelot/hg/django-treebeard/
    tabo@mango:~$ cd /tmp
    tabo@mango:tmp$ LOCALHG='/Applications/MacHg.app/Contents/Resources/localhg'
    tabo@mango:tmp$ $LOCALHG identify --cwd /tmp --config defaults.identify= --noninteractive --rev 0 ssh://camelot/hg/django-treebeard/
    939b0c880826
    tabo@mango:tmp$ 
    

    But the dialog immediately displays a "Remote Repository is Unreachable" error, and if I insist in adding the server, I can't use the remote repo to pull/push from/to my local repo.

    As I mentioned, this only happens with ssh. Repos using https always work.

  3. Marko Käning

    Hi Gustavo,

    I also have/had problems with ssh and I have the following "patch" at hand:

    diff -r c196c327ba0b Classes/General/TaskExecutions.m
    --- a/Classes/General/TaskExecutions.m	Sat Jun 05 14:23:07 2010 +0200
    +++ b/Classes/General/TaskExecutions.m	Sat Jun 05 21:09:52 2010 +0200
    @@ -124,7 +124,7 @@
     + (ExecutionResult*) synchronouslyExecute:(NSString*)cmd withArgs:(NSArray*)args onTask:(NSTask*)theTask
     {
     	NSTask* task = theTask ? theTask : [[NSTask alloc] init];
    -	[task setEnvironment:[NSDictionary dictionaryWithObject:@"en_US.UTF-8" forKey:@"LANG"]];
    +//	[task setEnvironment:[NSDictionary dictionaryWithObject:@"en_US.UTF-8" forKey:@"LANG"]];
     	[task startExecution:cmd withArgs:args];
     	return [ExecutionResult extractResults:task];
     }
    

    Could you give this a shot on your side and let me know whether it works for you?

    Greets, Marko

    P.S.: Actually this environment setting was introduced by Jason to fix some charset trouble on my request. It actually solves that same issue, but unfortunately created the ssh trouble. There is still no solution to the problem since it is unclear what causes it.

  4. Gustavo Picón

    Marko,

    Indeed, your patch solved the problem. No more errors and I can push/pull without problems.

  5. Marko Käning

    Great!

    I am sure Jason will find the correct way to configure the environment to solve both issues. I experimented a little with it, but couldn't find the right approach to this, unfortunately. Uncommenting that line is a hack, but it works for now.

  6. Jason Harris repo owner

    Yep. I am working on this... Sorry that I haven't solved the ssh issue and at the same time solved the language issue! Soon! :)

    Thanks all!

    Cheers, Jas

  7. Marko Käning

    Hi Jason,

    I've found under http://mercurial.selenic.com/wiki/Download the note that "Mac OS X packages (you may have to add export LC_ALL=en_US.UTF-8 and export LANG=en_US.UTF-8 to your /.profile)"

    So I tried to use this instead of your one-liner:

    NSArray *keys = [NSArray arrayWithObjects:@"LANG", @"LC_ALL", nil];
    NSArray *objects = [NSArray arrayWithObjects:@"en_US.UTF-8", @"en_US.UTF-8", nil];
    NSDictionary *dict=[NSDictionary dictionaryWithObjects:objects forKeys:keys];
    [task setEnvironment:dict];
    

    but it gave the same result, i.e. ssh access wouldn't work.

    :/ Marko

  8. Gustavo Picón

    Testing 462723d867f1 without Marko's patch, it's still failing, in a different way tho:

    The Configure Server Repository dialog is still showing the Remote Repository is Unreachable error, even when the test button is succesful:

    cd /tmp
    LOCALHG='/Users/tabo/repos/machg/build/Debug/MacHg.app/Contents/Resources/localhg'
    $LOCALHG identify --cwd /tmp --rev 0 ssh://bb/tabo/django-treebeard/
    tabo@mango:~$ cd /tmp
    tabo@mango:tmp$ LOCALHG='/Users/tabo/repos/machg/build/Debug/MacHg.app/Contents/Resources/localhg'
    tabo@mango:tmp$ $LOCALHG identify --cwd /tmp --rev 0 ssh://bb/tabo/django-treebeard/
    939b0c880826
    

    At least if I select the local repo in the sidebar, it will identify the related remote repos, but a "-/-" will appear instead of a "0/0". Also, if I try to pull, now I see the related repos too (I used to get an empty combobox). The problem is that the pull fails with a "remote: Permission denied (publickey)." error. I get no such error in the command line:

    tabo@mango:django-treebeard$ hg pull bb
    pulling from ssh://bb/tabo/django-treebeard/
    searching for changes
    no changes found
    tabo@mango:django-treebeard$ 
    
  9. Jason Harris repo owner

    Is your ssh passwordless? Or is there a password for your ssh key which goes through ssh-agent. the ssh-agent stuff still seems to not be working... But I was hoping that at least the passwordless ssh stuff was working for you guys... (Passwordless ssh was always working for me. Passworded ssh was not working for me...) So in any case this isn't a full fix. One further thing to try... If you delete the line:

    @"UTF-8", @"HGENCODING", in + (ExecutionResult*) synchronouslyExecute:(NSString*)cmd withArgs:(NSArray*)args onTask:(NSTask*)theTask in TaskExecutions, does it start working again?

    Thanks! Jas

  10. Gustavo Picón

    It's passwordless SSH. No ssh-agent. Note that everything works with Marko's patch.

    After removing that line and recompiling, I keep getting the same errors as described above.

  11. Marko Käning

    Yep, Jason, removing the line with HGENCODING lets this it work again, just like with "my patch".

    But that of course also causes the known display errors for funny characters, which is why we introduced back than this UTF-8 encoding...

  12. Log in to comment