Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ls command broken #46

Open
CodyCodeman opened this issue Jul 17, 2016 · 1 comment
Open

ls command broken #46

CodyCodeman opened this issue Jul 17, 2016 · 1 comment

Comments

@CodyCodeman
Copy link

Using softlayer object storage. Setup using https://sldn.softlayer.com/blog/kmcdonald/FTPSFTP-Softlayer-Object-Storage

Using ftp the ls command will just hang.

[root@josue ~]# swftp-ftp &
/usr/lib64/python2.6/site-packages/cryptography/__init__.py:26: DeprecationWarning: Python 2.6 is no longer supported by the Python core team, please upgrade your Python. A future version of cryptography will drop support for Python 2.6
  DeprecationWarning
2016-07-17 12:49:29-0500 [-] Log opened.
2016-07-17 12:49:30-0500 [-] /usr/lib64/python2.6/site-packages/twisted/internet/endpoints.py:29: exceptions.DeprecationWarning: twisted.internet.interfaces.IStreamClientEndpointStringParser was deprecated in Twisted 14.0.0: This interface has been superseded by IStreamClientEndpointStringParserWithReactor.
2016-07-17 12:49:30-0500 [-] /usr/lib/python2.6/site-packages/swftp/swift.py:11: exceptions.DeprecationWarning: twisted.web.client.WebClientContextFactory was deprecated in Twisted 14.0.0: please use twisted.web.client.BrowserLikePolicyForHTTPS instead
2016-07-17 12:49:30-0500 [-] Starting SwFTP-ftp 1.0.7
2016-07-17 12:49:30-0500 [-] Reading configuration from paths: ['/etc/swftp/swftp.conf', '/root/.swftp.cfg']
2016-07-17 12:49:30-0500 [-] Site starting on 38021
2016-07-17 12:49:30-0500 [-] Starting factory <twisted.web.server.Site instance at 0x342e4d0>
2016-07-17 12:49:30-0500 [-] FTPFactory starting on 5021
2016-07-17 12:49:30-0500 [-] Starting factory <twisted.protocols.ftp.FTPFactory instance at 0x342f5f0>

[root@josue ~]# ftp localhost 5021
Trying 127.0.0.1...
Connected to localhost (127.0.0.1).
220 Welcome to SwFTP - An FTP/SFTP interface for Openstack Swift
Name (localhost:root): SLOSxxxxx-x:xxxxxxxxxx
331 Password required for SLOSxxxxx-x:xxxxxxxxxx.
Password:
2016-07-17 12:49:56-0500 [-] /usr/lib/python2.6/site-packages/swftp/swift.py:145: exceptions.DeprecationWarning: <twisted.web.client.WebClientContextFactory object at 0x34325d0> was passed as the HTTPS policy for an Agent, but it does not provide IPolicyForHTTPS.  Since Twisted 14.0, you must pass a provider of IPolicyForHTTPS.
2016-07-17 12:49:56-0500 [-] Starting factory <twisted.web.client._HTTP11ClientFactory instance at 0x3430998>
2016-07-17 12:49:56-0500 [SwFTP-FTP, (SLOSxxxxx-x:xxxxxxxxxx)] COMMAND: login()
230 User logged in, proceed
Remote system type is UNIX.
Using binary mode to transfer files.
ftp> ls
2016-07-17 12:50:01-0500 [FTP (ProtocolWrapper),0,127.0.0.1] DTPFactory.setTimeout set to 10 seconds
2016-07-17 12:50:01-0500 [FTP (ProtocolWrapper),0,127.0.0.1] DTPFactory starting on 39730
2016-07-17 12:50:01-0500 [-] Starting factory <twisted.protocols.ftp.DTPFactory instance at 0x3599f38>
227 Entering Passive Mode (127,0,0,1,155,50).
2016-07-17 12:50:01-0500 [twisted.protocols.ftp.DTPFactory] DTPFactory.buildProtocol
2016-07-17 12:50:01-0500 [twisted.protocols.ftp.DTPFactory] cancelling DTP timeout
2016-07-17 12:50:01-0500 [SwFTP-FTP, (SLOS97031-2:cynch97031)] COMMAND: list([])
2016-07-17 12:50:01-0500 [HTTP11ClientProtocol (TLSMemoryBIOProtocol),client] Unexpected FTP error
2016-07-17 12:50:01-0500 [HTTP11ClientProtocol (TLSMemoryBIOProtocol),client] Unhandled Error
    Traceback (most recent call last):
      File "/usr/lib64/python2.6/site-packages/twisted/web/_newclient.py", line 1161, in _bodyDataFinished_CONNECTED
        self._bodyProtocol.connectionLost(reason)
      File "/usr/lib/python2.6/site-packages/swftp/swift.py", line 57, in connectionLost
        self.finished.callback(''.join(self.recv_chunks))
      File "/usr/lib64/python2.6/site-packages/twisted/internet/defer.py", line 393, in callback
        self._startRunCallbacks(result)
      File "/usr/lib64/python2.6/site-packages/twisted/internet/defer.py", line 501, in _startRunCallbacks
        self._runCallbacks()
    --- <exception caught here> ---
      File "/usr/lib64/python2.6/site-packages/twisted/internet/defer.py", line 588, in _runCallbacks
        current.result = callback(current.result, *args, **kw)
      File "/usr/lib64/python2.6/site-packages/twisted/protocols/ftp.py", line 996, in gotListing
        self.dtpInstance.sendListResponse(name, attrs)
      File "/usr/lib64/python2.6/site-packages/twisted/protocols/ftp.py", line 474, in sendListResponse
        self.sendLine(self._formatOneListResponse(name, *response))
      File "/usr/lib64/python2.6/site-packages/twisted/protocols/ftp.py", line 464, in _formatOneListResponse
        'permissions': permissions.shorthand(),
    exceptions.AttributeError: 'int' object has no attribute 'shorthand'

125 Data connection already open, starting transfer

Using swftp v1.0.7 and Twisted v15.4.0

@Roxxik
Copy link

Roxxik commented Dec 12, 2018

twisted<15.0 could use int and twisted.python.filepath.Permissions >=15.0 can only use Permissions, so you either need to downgrade twisted or wrap that int (swftp/ftp/server.py#36) into a filepath.Permissions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants