Skip to content

Shell Setting is None #2

Closed
Closed

Description

@phyllisstein

Hey there! This looks like absolutely terrific work; thanks so much for the Linux/OS X port! I'm having a little trouble, though: it looks like the package is looking for a setting that isn't defined. Here's the traceback, which ST3 spits out as soon as I try connecting to a server:

SSH[0] 10:52:32: Start work loopSFTP[0] 10:52:32: Start work loop

Traceback (most recent call last):
  File "/Users/danielsh/Library/Application Support/Sublime Text 3/Packages/RemoteEdit/RemoteEdit.py", line 329, in handle_server_select
    self.start_server(self.items[selection - 2])
  File "/Users/danielsh/Library/Application Support/Sublime Text 3/Packages/RemoteEdit/RemoteEdit.py", line 399, in start_server
    self.open_server()
  File "/Users/danielsh/Library/Application Support/Sublime Text 3/Packages/RemoteEdit/RemoteEdit.py", line 416, in open_server
    self.run_ssh_command(cmd, callback=self.handle_server_info)
  File "/Users/danielsh/Library/Application Support/Sublime Text 3/Packages/RemoteEdit/RemoteEdit.py", line 2924, in run_ssh_command
    (q, a) = self.get_arithmetic()
  File "/Users/danielsh/Library/Application Support/Sublime Text 3/Packages/RemoteEdit/RemoteEdit.py", line 2900, in get_arithmetic
    if "csh" in self.get_settings().get("%s:shell" % self.serverName):
TypeError: argument of type 'NoneType' is not iterable

And here's the server's settings file, sans comments, which is saved as daniel_sh.sublime-settings:

{
    "host": "daniel.sh",
    "user": "danielsh",
    "remote_path": "/www/",
    "enable_cat": false,
    "cat_path": "/example/path/",
    "fuzzy_path": "",
    "order_by": "name",
    "order_reverse": false,
    "show_hidden": true,
    "browsing_mode": "maintenance",
    "show_file_info": true,
    "sftp_only": false,
    "prompt_contains": "$",
    "temp_path": "/tmp",
    "dont_edit_ext": [
        "zip", "gz", "tar", "7z", "rar", "jpg", "jpeg", "png", "gif", "exe",
        "mp3", "wav", "bz", "pyc", "ico"
    ],
    "cat_exclude_folders": [".svn", ".git"]
}

I noticed that there was some manipulation of settings files in your code, so I didn't want to just go sticking new settings in willy-nilly. Let me know if I can provide any more information, and thanks in advance for your help!

Activity

  1. CodeEffect commented on Jun 16, 2013

    @CodeEffect
    Owner

    Oops, schoolboy error there. I added an echo "UNIQUE_STRING" method to SSH commands as on nix the prompt didn't come back in stdout so I had nothing to check for to confirm the command was finished. Unfortunately the echo was dependent on the shell version that itself required an ssh command to determine.

    I've just realised that the [t]csh echo "UNIQUE_STRING" runs fine under bash anyway so no need for the shell version check there. I've just put 2 commits through, I realised that the first one wasn't going to work as I was typing this explanation out LMAO. Second one should have you up and running.

    Please let me know how you get on. I've not been able to test on OSX at all so your feedback really is appreciated :)

  2. bianjiang commented on Jun 16, 2013

    @bianjiang

    @phyllisstein you are fast... just post this to the forum.

  3. bianjiang commented on Jun 16, 2013

    @bianjiang

    I think the fix you just committed introduced this ?

    Traceback (most recent call last):
    File "/Users/jiangbian/Library/Application Support/Sublime Text 3/Packages/RemoteEdit/RemoteEdit.py", line 329, in handle_server_select
    self.start_server(self.items[selection - 2])
    File "/Users/jiangbian/Library/Application Support/Sublime Text 3/Packages/RemoteEdit/RemoteEdit.py", line 399, in start_server
    self.open_server()
    File "/Users/jiangbian/Library/Application Support/Sublime Text 3/Packages/RemoteEdit/RemoteEdit.py", line 402, in open_server
    reData = self.window.active_view().settings().get("reData", None)

  4. CodeEffect commented on Jun 16, 2013

    @CodeEffect
    Owner

    Is there any more to the traceback please? It doesn't advise what is wrong that I can see.

  5. phyllisstein commented on Jun 16, 2013

    @phyllisstein
    Author

    Fabulous! Your new commits work great for me---I'm able to connect, browse, and download files remotely. Well done!

  6. CodeEffect commented on Jun 16, 2013

    @CodeEffect
    Owner

    Woo hoo! Cheers chap. Let me know if you spot any further issues.

    Can I ask if you are using passwords or SSH keys to auth please?

  7. phyllisstein commented on Jun 16, 2013

    @phyllisstein
    Author

    Sure thing: I'm using a key pair. When I tried with a username and password, it listed the system's welcome message and then reported that the connection had failed:

    SSH[0] 13:16:16: Start work loop
    SFTP[0] 13:16:16: Start work loop
    MAIN 13:16:17: run ssh command called with cmd: "ls -lap --time-style=long-iso --color=never /www/; echo "uneeq"`expr 66666666 + 44444445`"uneeq""
    MAIN 13:16:17: ....now on the queue.....
    MAIN 13:16:17: Calling set_timeout to check for results
    SSH[0] 13:16:17: Process not running: 'NoneType' object has no attribute 'poll'
    SSH[0] 13:16:17: Sending command: echo '$'
    SSH[0] 13:16:17: Waiting for output...
    SSH[0] 13:16:17: Found response
    SSH[0] 13:16:17: -------- stderr --------
    Pseudo-terminal will not be allocated because stdin is not a terminal.
    
    --------------------------------------------
    SSH[0] 13:16:17: Waiting for output...
    SSH[0] 13:16:19: Found response
    SSH[0] 13:16:19: --------- stdout ---------
    Welcome to Ubuntu 13.04 (GNU/Linux 3.8.0-25-generic x86_64)
    
        # [snip]
    
    SSH[0] 13:16:19: Connect failed: Welcome to Ubuntu 13.04 (GNU/Linux 3.8.0-25-generic x86_64)
    
  8. CodeEffect commented on Jun 16, 2013

    @CodeEffect
    Owner

    Just committed what should be a fix for this one. If you have a mo would you mind updating the code, restarting subime then attempting password auth again please?

  9. phyllisstein commented on Jun 16, 2013

    @phyllisstein
    Author

    Same result, I'm afraid:

    SSH[0] 13:34:03: Start work loop
    SFTP[0] 13:34:03: Start work loop
    MAIN 13:34:05: run ssh command called with cmd: "ls -lap --time-style=long-iso --color=never /www/; echo "uneeq"`expr 66666666 + 44444445`"uneeq""
    MAIN 13:34:05: ....now on the queue.....
    MAIN 13:34:05: Calling set_timeout to check for results
    SSH[0] 13:34:05: Process not running: 'NoneType' object has no attribute 'poll'
    SSH[0] 13:34:05: Sending command: echo '$'
    SSH[0] 13:34:05: Waiting for output...
    SSH[0] 13:34:05: Found response
    SSH[0] 13:34:05: -------- stderr --------
    Pseudo-terminal will not be allocated because stdin is not a terminal.
    
    --------------------------------------------
    SSH[0] 13:34:05: Sending command: echo '$'
    SSH[0] 13:34:05: Waiting for output...
    SSH[0] 13:34:06: Found response
    SSH[0] 13:34:06: --------- stdout ---------
    Welcome to Ubuntu 13.04 (GNU/Linux 3.8.0-25-generic x86_64)
    
        # [snip]
    
    
    --------------------------------------------
    SSH[0] 13:34:06: Connect failed: Welcome to Ubuntu 13.04 (GNU/Linux 3.8.0-25-generic x86_64)
    
        # [snip]
    
    
    SSH[0] 13:34:06: Error connecting
    SSH[0] 13:34:06: End work loop
    SSH[0] 13:34:06: Start work loop
    MAIN 13:34:06: Results found in callback handler, firing the callback
    error: Error listing folder /www/
    
  10. CodeEffect commented on Jun 16, 2013

    @CodeEffect
    Owner

    Hmmm, just to clarify, it is connecting but it's not recognising that it's connected right?

    Could you post the rest of the welcome message if at all possible please? Obviously strip anything personal but I'm trying to figure out why it isn't seeing the prompt (possibly not sent to stdout) or why it's not seeing the echo '$' (is possible it stops collecting stdout before that).

    I've bunged in another await_response, see if that grabs enough data. Big thanks for all this help debugging :) If this one fails I'll see if I can reproduce under linux at this end and have a play, cheers!

    EDIT: Should say, will need to restart sublime again as the worker has been updated, ta.

  11. bianjiang commented on Jun 16, 2013

    @bianjiang

    I am getting the same issue when using password...
    Install ssh-askpass actually made it work... (It prompt you the password, and list the folders)

    This is the log without ssh-askpass

    MAIN 13:29:30: tidy_local_tmp_path() finished in 9.608268737792969e-05 seconds
    MAIN 13:29:30: __del__ called
    MAIN 13:29:30: Popping ssh
    MAIN 13:29:30: Popping sftp
    SSH[0] 13:29:30: Start work loopSFTP[0] 13:29:30: Start work loop
    SFTP[0] 13:29:30: Stop called for thread 0, we are 0
    SFTP[0] 13:29:30: Thread 0 has left the building.
    
    SFTP[0] 13:29:30: End work loop
    SSH[0] 13:29:30: Stop called for thread 0, we are 0
    SSH[0] 13:29:30: Thread 0 has left the building.
    SSH[0] 13:29:30: End work loop
    loaded 846 snippets
    SSH[0] 13:29:38: Start work loopSFTP[0] 13:29:38: Start work loop
    
    MAIN 13:29:39: run ssh command called with cmd: "ls -lapD"%Y-%m-%d %H:%M" ~/; echo "uneeq"`expr 66666666 + 44444445`"uneeq""
    MAIN 13:29:39: ....now on the queue.....
    MAIN 13:29:39: Calling set_timeout to check for results
    SSH[0] 13:29:39: Process not running: 'NoneType' object has no attribute 'poll'
    SSH[0] 13:29:39: Sending command: echo '$'
    SSH[0] 13:29:39: Waiting for output...
    SSH[0] 13:29:39: Process died
    SSH[0] 13:29:39: -------- stderr --------
    Pseudo-terminal will not be allocated because stdin is not a terminal.
    
    --------------------------------------------
    SSH[0] 13:29:39: Sending command: echo '$'
    SSH[0] 13:29:39: Command failed: [Errno 32] Broken pipe
    SSH[0] 13:29:39: Waiting for output...
    SSH[0] 13:29:39: Process died
    SSH[0] 13:29:39: Waiting for output...
    SSH[0] 13:29:39: Process died
    SSH[0] 13:29:39: Connect failed: 
    SSH[0] 13:29:39: Error connecting
    SSH[0] 13:29:39: End work loop
    SSH[0] 13:29:39: Start work loop
    MAIN 13:29:39: Results found in callback handler, firing the callback
    error: Error listing folder ~/
    
    

    This is the log with ssh-askpass...

    MAIN 13:26:16: tidy_local_tmp_path() finished in 8.416175842285156e-05 seconds
    MAIN 13:26:16: __del__ called
    MAIN 13:26:16: Popping ssh
    MAIN 13:26:16: Popping sftp
    SFTP[0] 13:26:16: Start work loopSSH[0] 13:26:16: Start work loop
    SSH[0] 13:26:16: Stop called for thread 0, we are 0
    SSH[0] 13:26:16: Thread 0 has left the building.
    SSH[0] 13:26:16: End work loop
    
    SFTP[0] 13:26:16: Stop called for thread 0, we are 0
    SFTP[0] 13:26:16: Thread 0 has left the building.
    SFTP[0] 13:26:16: End work loop
    loaded 846 snippets
    SSH[0] 13:26:19: Start work loopSFTP[0] 13:26:19: Start work loop
    
    MAIN 13:26:19: run ssh command called with cmd: "ls -lapD"%Y-%m-%d %H:%M" ~/; echo "uneeq"`expr 66666666 + 44444445`"uneeq""
    MAIN 13:26:19: ....now on the queue.....
    MAIN 13:26:19: Calling set_timeout to check for results
    SSH[0] 13:26:19: Process not running: 'NoneType' object has no attribute 'poll'
    SSH[0] 13:26:19: Sending command: echo '$'
    SSH[0] 13:26:19: Waiting for output...
    SSH[0] 13:26:20: Found response
    SSH[0] 13:26:20: -------- stderr --------
    Pseudo-terminal will not be allocated because stdin is not a terminal.
    
    --------------------------------------------
    SSH[0] 13:26:20: Sending command: echo '$'
    SSH[0] 13:26:20: Waiting for output...
    SSH[0] 13:26:22: Found response
    SSH[0] 13:26:22: --------- stdout ---------
    $
    $
    
    --------------------------------------------
    SSH[0] 13:26:22: Connection OK
    SSH[0] 13:26:22: Discarding output...
    SSH[0] 13:26:22: Sending command: ls -lapD"%Y-%m-%d %H:%M" ~/; echo "uneeq"`expr 66666666 + 44444445`"uneeq"
    SSH[0] 13:26:22: Now listening
    SSH[0] 13:26:22: Waiting for output...
    SSH[0] 13:26:22: Found response
    SSH[0] 13:26:22: --------- stdout ---------
    uneeq111111111uneeq
    
    --------------------------------------------
    SSH[0] 13:26:22: -------- stderr --------
    ls: illegal option -- D
    usage: ls [-ABCFGHLOPRSTUWabcdefghiklmnopqrstuwx1] [file ...]
    
    --------------------------------------------
    SSH[0] 13:26:22: Sending command:  
    SSH[0] 13:26:22: Found checkReturn
    SSH[0] 13:26:22: End work loop
    SSH[0] 13:26:22: Start work loop
    MAIN 13:26:22: Results found in callback handler, firing the callback
    MAIN 13:26:22: Trying cat for folder "~/"
    
  12. phyllisstein commented on Jun 16, 2013

    @phyllisstein
    Author

    Looks like whatever you changed did the trick! I'll post the complete output anyway, but it seems to work fine now.

    SSH[0] 14:27:05: Start work loopSFTP[0] 14:27:05: Start work loop
    
    MAIN 14:27:07: run ssh command called with cmd: "ls -lap --time-style=long-iso --color=never /www/; echo "uneeq"`expr 66666666 + 44444445`"uneeq""
    MAIN 14:27:07: ....now on the queue.....
    MAIN 14:27:07: Calling set_timeout to check for results
    SSH[0] 14:27:07: Process not running: 'NoneType' object has no attribute 'poll'
    SSH[0] 14:27:07: Sending command: echo '$'
    SSH[0] 14:27:07: Waiting for output...
    SSH[0] 14:27:07: Found response
    SSH[0] 14:27:07: -------- stderr --------
    Pseudo-terminal will not be allocated because stdin is not a terminal.
    
    --------------------------------------------
    SSH[0] 14:27:07: Sending command: echo '$'
    SSH[0] 14:27:07: Waiting for output...
    SSH[0] 14:27:09: Found response
    SSH[0] 14:27:09: --------- stdout ---------
    Welcome to Ubuntu 13.04 (GNU/Linux 3.8.0-25-generic x86_64)
    
    * Documentation:  https://help.ubuntu.com/
    
    System information as of Sun Jun 16 14:27:07 EDT 2013
    
    System load:  0.01               Processes:           130
    Usage of /:   24.2% of 11.69GB   Users logged in:     0
    Memory usage: 51%                IP address for eth0: 10.60.14.37
    Swap usage:   0%
    
    Graph this data and manage this system at https://landscape.canonical.com/
    
    Get cloud support with Ubuntu Advantage Cloud Guest:
    http://www.ubuntu.com/business/services/cloud
    
    Use Juju to deploy your cloud instances and workloads:
    https://juju.ubuntu.com/#cloud-raring
    
    0 packages can be updated.
    0 updates are security updates.
    
    
    --------------------------------------------
    SSH[0] 14:27:09: Waiting for output...
    SSH[0] 14:27:10: Found response
    SSH[0] 14:27:10: --------- stdout ---------
    $
    $
    
    --------------------------------------------
    SSH[0] 14:27:10: Connection OK
    
  13. CodeEffect commented on Jun 16, 2013

    @CodeEffect
    Owner

    @jiang It looks as though there might be a network issue with the top trace. Could you possibly try it again please after a restart of sublime?

    Also, what system are you connecting into? ls is throwing that illegal option message that I'll need to fix. Could you possibly post the output of "ls --version" on the target machine too please?

    @dan, lovely stuff! Looks as though there was just too much text for it to process in the number of listens it was doing, I just added another one which was enough to capture those $'s.

  14. bianjiang commented on Jun 16, 2013

    @bianjiang

    Yeah. Restarted sublime, same issue.

    ah, "ls --version" explains it. I'm trying to ssh to another mac system, which on mac, it's "ls -version" (one less dash) for list folders.

  15. bianjiang commented on Jun 16, 2013

    @bianjiang

    Just throw an idea :) I think git://github.com/paramiko/paramiko.git supports sftp on all platforms, and its pure python code, so no C binding involved

  16. CodeEffect commented on Jun 16, 2013

    @CodeEffect
    Owner

    I'll have to take a look at this one tomorrow now but could you possibly help me out with a ls --help (or whatever the equivalent is please?).

    Paramiko would be nice but doesn't do Python 3 yet unfortunately. Was one of the first things I looked at when starting the project.

  17. bianjiang commented on Jun 16, 2013

    @bianjiang

    Oh... didn't realize paramiko hasn't ported to py3k yet...

    Sorry, actually ls -version isn't a valid command either... it just didn't throw an error.

    Here is the man page for ls on mac os x.

    https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/ls.1.html

  18. CodeEffect commented on Jun 17, 2013

    @CodeEffect
    Owner

    Cheers, any chance of an example "ls -lapT" on a folder with a few files / folders in it please? Also a "grep --version" and an "echo $SHELL" would be really useful too (on the Mac target if poss).

  19. bianjiang commented on Jun 17, 2013

    @bianjiang

    here is "ls -lapT"

    jiangs-mac-pro:RemoteEdit jiangbian$ ls -lapT
    total 408
    drwxr-xr-x  23 jiangbian  staff     782 Jun 16 13:32:41 2013 ./
    drwx------   7 jiangbian  staff     238 Jun 16 13:32:41 2013 ../
    drwxr-xr-x  13 jiangbian  staff     442 Jun 16 13:32:41 2013 .git/
    -rw-r--r--   1 jiangbian  staff     191 Jun 16 13:32:41 2013 .gitignore
    -rw-r--r--   1 jiangbian  staff     481 Jun 16 13:32:41 2013 Default (Linux).sublime-keymap
    -rw-r--r--   1 jiangbian  staff     119 Jun 16 13:32:41 2013 Default (Linux).sublime-mousemap
    -rw-r--r--   1 jiangbian  staff     482 Jun 16 13:32:41 2013 Default (OSX).sublime-keymap
    -rw-r--r--   1 jiangbian  staff     118 Jun 16 13:32:41 2013 Default (OSX).sublime-mousemap
    -rw-r--r--   1 jiangbian  staff     481 Jun 16 13:32:41 2013 Default (Windows).sublime-keymap
    -rw-r--r--   1 jiangbian  staff     118 Jun 16 13:32:41 2013 Default (Windows).sublime-mousemap
    -rw-r--r--   1 jiangbian  staff     256 Jun 16 13:32:41 2013 Default.sublime-commands
    -rw-r--r--   1 jiangbian  staff    6017 Jun 16 13:32:41 2013 Main.sublime-menu
    -rw-r--r--   1 jiangbian  staff    3968 Jun 16 13:32:41 2013 NewServer.default-config
    -rw-r--r--   1 jiangbian  staff    4683 Jun 16 13:32:41 2013 README.md
    -rw-r--r--   1 jiangbian  staff  127307 Jun 16 13:32:41 2013 RemoteEdit.py
    -rw-r--r--   1 jiangbian  staff    1210 Jun 16 13:32:41 2013 RemoteEdit.sublime-settings
    -rw-r--r--   1 jiangbian  staff    3711 Jun 16 13:32:41 2013 RemoteEditDisplaySearch.py
    -rw-r--r--   1 jiangbian  staff    3244 Jun 16 13:32:41 2013 RemoteEditEvents.py
    -rw-r--r--   1 jiangbian  staff     405 Jun 16 13:32:41 2013 RemoteEditListFolder.py
    -rw-r--r--   1 jiangbian  staff     403 Jun 16 13:32:41 2013 RemoteEditMarkDirty.py
    -rw-r--r--   1 jiangbian  staff    1622 Jun 16 13:32:41 2013 RemoteEditMouse.py
    drwxr-xr-x   4 jiangbian  staff     136 Jun 16 13:32:41 2013 bin/
    drwxr-xr-x   4 jiangbian  staff     136 Jun 16 13:32:41 2013 remote_edit/
    

    here is "grep --version"

    jiangs-mac-pro:RemoteEdit jiangbian$ grep --version
    grep (BSD grep) 2.5.1-FreeBSD
    

    and "echo $SHELL"

    jiangs-mac-pro:RemoteEdit jiangbian$ echo $SHELL
    /bin/bash
    
  20. CodeEffect commented on Jun 17, 2013

    @CodeEffect
    Owner

    Balls, nothing so far to really distinguish it from BSD. Could I have a "uname -a" and a "uname -o" please?

  21. bianjiang commented on Jun 17, 2013

    @bianjiang

    sublime.platform() shows 'osx' on mac.

    but here is uname

    uname -sr
    Darwin 12.4.0
    
    uname -s
    Darwin
    
  22. CodeEffect commented on Jun 17, 2013

    @CodeEffect
    Owner

    Closing this one as it's gone off topic and opening a new issue at #5 for the OSX target issue. Thanks all :)

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions