scttnlsn / dandelion

Incremental Git repository deployment.
http://scttnlsn.github.io/dandelion
MIT License
738 stars 60 forks source link

Exception thrown when `auth_tls` is `nil` or `false` #142

Open chrisdpeters opened 8 years ago

chrisdpeters commented 8 years ago

Example config:

adapter: ftps
host: example.com
username: myusername
password: verysecurepassw0rd
path: 

Stack trace:

$ dandelion deploy --dry-run
/.rvm/gems/ruby-2.2.3/gems/double-bag-ftps-0.1.2/lib/double_bag_ftps.rb:64:in `+': no implicit conversion of nil into String (TypeError)
    from /.rvm/gems/ruby-2.2.3/gems/double-bag-ftps-0.1.2/lib/double_bag_ftps.rb:64:in `block in login'
    from /.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
    from /.rvm/gems/ruby-2.2.3/gems/double-bag-ftps-0.1.2/lib/double_bag_ftps.rb:63:in `login'
    from /.rvm/gems/ruby-2.2.3/gems/dandelion-0.4.14/lib/dandelion/adapter/ftps.rb:30:in `ftp_client'
    from /.rvm/gems/ruby-2.2.3/gems/dandelion-0.4.14/lib/dandelion/adapter/ftp.rb:17:in `initialize'
    from /.rvm/gems/ruby-2.2.3/gems/dandelion-0.4.14/lib/dandelion/adapter/ftps.rb:18:in `initialize'
    from /.rvm/gems/ruby-2.2.3/gems/dandelion-0.4.14/lib/dandelion/adapter.rb:24:in `new'
    from /.rvm/gems/ruby-2.2.3/gems/dandelion-0.4.14/lib/dandelion/adapter.rb:24:in `create_adapter'
    from /.rvm/gems/ruby-2.2.3/gems/dandelion-0.4.14/lib/dandelion/cli.rb:21:in `adapter'
    from /.rvm/gems/ruby-2.2.3/gems/dandelion-0.4.14/lib/dandelion/cli.rb:37:in `workspace'
    from /.rvm/gems/ruby-2.2.3/gems/dandelion-0.4.14/lib/dandelion/cli.rb:69:in `execute!'
    from /.rvm/gems/ruby-2.2.3/gems/dandelion-0.4.14/bin/dandelion:8:in `<top (required)>'
    from /.rvm/gems/ruby-2.2.3/bin/dandelion:23:in `load'
    from /.rvm/gems/ruby-2.2.3/bin/dandelion:23:in `<main>'
    from /.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `eval'
    from /.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `<main>'

I also tried adding insecure: true to no avail.

It looks like double-bag-ftps doesn't like it when nil is passed in as the auth argument to login.

scttnlsn commented 8 years ago

Can you try adding auth_tls: true to your dandelion.yml. If that works we should probably make it the default.

chrisdpeters commented 8 years ago

I get a different error complaining about the certificate, so that works as expected.

chrisdpeters commented 8 years ago

Your idea sounds like a reasonable default, by the way. I was just trying to get it to work with it set to false.

scttnlsn commented 8 years ago

I think the problem is just that the FTPS adapter is passing nil when auth_tls is false. What's another valid value for the auth argument to login?

chrisdpeters commented 8 years ago

It looks like the more common values are TLS and SSL. TLS-C appears to be another less-common possibility. Probably neither would be helpful in my case.

I should have my boss set up the FTPS again with the bad setup and see what the specific error is for auth_tls: true to see if that's something that Dandelion can work around.

chrisdpeters commented 8 years ago

P. S. I tried skimming through the FTPS spec and couldn't quickly find any more info about AUTH.

The Wikipedia article does list some info: https://en.wikipedia.org/wiki/FTPS