The option username is invalid #5

Closed
tanepiper opened this Issue Nov 26, 2012 · 3 comments

Projects

None yet

4 participants

@tanepiper

I'm trying to export some data from my old posterous account using the API - however I encounter this error when I try use this ruby gem:

/Users/freeagent/.rvm/gems/ruby-1.9.3-p194/gems/ethon-0.5.6/lib/ethon/easy.rb:254:in `block in set_attributes': The option: username is invalid. (Ethon::Errors::InvalidOption)
Please try userpwd instead of username.
  from /Users/freeagent/.rvm/gems/ruby-1.9.3-p194/gems/ethon-0.5.6/lib/ethon/easy.rb:252:in `each_pair'
  from /Users/freeagent/.rvm/gems/ruby-1.9.3-p194/gems/ethon-0.5.6/lib/ethon/easy.rb:252:in `set_attributes'
  from /Users/freeagent/.rvm/gems/ruby-1.9.3-p194/gems/ethon-0.5.6/lib/ethon/easy/http/actionable.rb:79:in `setup'
  from /Users/freeagent/.rvm/gems/ruby-1.9.3-p194/gems/ethon-0.5.6/lib/ethon/easy/http/get.rb:17:in `setup'
  from /Users/freeagent/.rvm/gems/ruby-1.9.3-p194/gems/ethon-0.5.6/lib/ethon/easy/http.rb:38:in `http_request'
  from /Users/freeagent/.rvm/gems/ruby-1.9.3-p194/gems/typhoeus-0.5.3/lib/typhoeus/request/operations.rb:17:in `run'
  from /Users/freeagent/.rvm/gems/ruby-1.9.3-p194/gems/typhoeus-0.5.3/lib/typhoeus/request/block_connection.rb:31:in `run'
  from /Users/freeagent/.rvm/gems/ruby-1.9.3-p194/gems/typhoeus-0.5.3/lib/typhoeus/request/stubbable.rb:23:in `run'
  from /Users/freeagent/.rvm/gems/ruby-1.9.3-p194/gems/typhoeus-0.5.3/lib/typhoeus/request/before.rb:26:in `run'
  from /Users/freeagent/.rvm/gems/ruby-1.9.3-p194/gems/typhoeus-0.5.3/lib/typhoeus/request/actions.rb:22:in `get'
  from /Users/freeagent/.rvm/gems/ruby-1.9.3-p194/gems/posterous-0.2.9/lib/posterous/connection.rb:50:in `block (2 levels) in <module:Connection>'
  from /Users/freeagent/.rvm/gems/ruby-1.9.3-p194/gems/posterous-0.2.9/lib/posterous/model.rb:50:in `find'
  from /Users/freeagent/.rvm/gems/ruby-1.9.3-p194/gems/posterous-0.2.9/lib/posterous/models/site.rb:14:in `primary'
  from posterous-disqus.rb:55:in `process_blog'
  from posterous-disqus.rb:67:in `<main>'
@chaosblog

Same here.

/var/lib/gems/1.8/gems/ethon-0.5.7/lib/ethon/easy.rb:254:in `set_attributes': The option: password is invalid. (Ethon::Errors::InvalidOption)
Please try userpwd instead of password.
    from /var/lib/gems/1.8/gems/ethon-0.5.7/lib/ethon/easy.rb:252:in `each_pair'
    from /var/lib/gems/1.8/gems/ethon-0.5.7/lib/ethon/easy.rb:252:in `set_attributes'
    from /var/lib/gems/1.8/gems/ethon-0.5.7/lib/ethon/easy/http/actionable.rb:79:in `setup'
    from /var/lib/gems/1.8/gems/ethon-0.5.7/lib/ethon/easy/http/get.rb:17:in `setup'
    from /var/lib/gems/1.8/gems/ethon-0.5.7/lib/ethon/easy/http.rb:38:in `http_request'
    from /var/lib/gems/1.8/gems/typhoeus-0.5.4/lib/typhoeus/request/operations.rb:17:in `run'
    from /var/lib/gems/1.8/gems/typhoeus-0.5.4/lib/typhoeus/request/block_connection.rb:31:in `run'
    from /var/lib/gems/1.8/gems/typhoeus-0.5.4/lib/typhoeus/request/stubbable.rb:23:in `run'
    from /var/lib/gems/1.8/gems/typhoeus-0.5.4/lib/typhoeus/request/before.rb:26:in `run'
    from /var/lib/gems/1.8/gems/typhoeus-0.5.4/lib/typhoeus/request/actions.rb:22:in `get'
    from /var/lib/gems/1.8/gems/posterous-0.2.9/lib/posterous/connection.rb:50:in `send'
    from /var/lib/gems/1.8/gems/posterous-0.2.9/lib/posterous/connection.rb:50:in `get'
    from /var/lib/gems/1.8/gems/posterous-0.2.9/lib/posterous/model.rb:50:in `find'
    from /var/lib/gems/1.8/gems/posterous-0.2.9/lib/posterous/models/site.rb:14:in `primary'
    from posterous_import.rb:23
@saulcozens

The issue is with the the Posterous 0.2.5.9 gem. Change lib/posterous/connection.rb lines 12 - 16 to:

def default_options
  @default_options ||= { 
    #:username => Posterous.config['username'], 
    #:password => Posterous.config['password']
    :userpwd => Posterous.config['username']+":"+Posterous.config['password']
  }
end

I'll submit a pull request when I get a moment.

@erdogan
erdogan commented Feb 19, 2013

That worked for me, thanks

@tanepiper tanepiper closed this Oct 29, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment