Skip to content
This repository has been archived by the owner on Sep 5, 2018. It is now read-only.

Can't post, can't authorize #46

Open
patrick-brian-mooney opened this issue Nov 27, 2014 · 0 comments
Open

Can't post, can't authorize #46

patrick-brian-mooney opened this issue Nov 27, 2014 · 0 comments

Comments

@patrick-brian-mooney
Copy link

I have a script that posts content to Tumblr twice a day -- details are written up at http://patrickbrianmooney.nfshost.com/~patrick/projects/AutoLovecraft/technical.html, if they're helpful. I moved to a new computer last month and the script has stopped working. When I try to run it from a terminal, I get this:

/var/lib/gems/1.9.1/gems/simple_oauth-0.3.0/lib/simple_oauth/header.rb:88:in `attributes': SimpleOAuth: Found extra option keys not matching ATTRIBUTE_KEYS: (RuntimeError)
  [:token_secret, :consumer_secret]
    from /var/lib/gems/1.9.1/gems/simple_oauth-0.3.0/lib/simple_oauth/header.rb:74:in `signed_attributes'
    from /var/lib/gems/1.9.1/gems/simple_oauth-0.3.0/lib/simple_oauth/header.rb:80:in `normalized_attributes'
    from /var/lib/gems/1.9.1/gems/simple_oauth-0.3.0/lib/simple_oauth/header.rb:62:in `to_s'
    from /var/lib/gems/1.9.1/gems/weary-1.1.3/lib/weary/middleware/oauth.rb:17:in `call'
    from /var/lib/gems/1.9.1/gems/weary-1.1.3/lib/weary/middleware/content_type.rb:20:in `call'
    from /var/lib/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:138:in `call'
    from /var/lib/gems/1.9.1/gems/weary-1.1.3/lib/weary/request.rb:52:in `call'
    from /var/lib/gems/1.9.1/gems/weary-1.1.3/lib/weary/request.rb:118:in `block in perform'
    from /var/lib/gems/1.9.1/gems/promise-0.3.0/lib/promise.rb:48:in `call'
    from /var/lib/gems/1.9.1/gems/promise-0.3.0/lib/promise.rb:48:in `block in __force__'
    from <internal:prelude>:10:in `synchronize'
    from /var/lib/gems/1.9.1/gems/promise-0.3.0/lib/promise.rb:45:in `__force__'
    from /var/lib/gems/1.9.1/gems/promise-0.3.0/lib/future.rb:35:in `__force__'
    from /var/lib/gems/1.9.1/gems/promise-0.3.0/lib/future.rb:26:in `block in initialize'

Maybe this is related to issue #37?

I thought that maybe I'd need to reauthorize the app, since I'm running it on a new computer, and/or sign up for a new Tumblr API key. So I signed up for a new API key and ran tumblr authorize in a terminal, then key in my key and secret, I get this in the browser:


RuntimeError at /
SimpleOAuth: Found extra option keys not matching ATTRIBUTE_KEYS: [:consumer_secret]

    file: header.rb
    location: attributes
    line: 88

BACKTRACE

(expand)

JUMP TO: GET POST COOKIES ENV

GET
Variable    Value
key     
"[redacted]"
secret  
"[redacted]"
POST

No POST data.
COOKIES
Variable    Value
rack.session    
"BAh7CEkiD3Nlc3Npb25faWQGOgZFRiJFNjU2YTQyY2FlOWM1NTljZWVlYmRl\nMzI2MmZmNjZmZGU0MTk0M2I0NzQ5NmU0NDEzMTgwNjNkN2NkMWE4ZmM4MUki\nCWNzcmYGOwBGIiVlOWViMWI1MTc5ZjFjZmEyZTdiMGFlOTY5MTJjNjk1Zkki\nDXRyYWNraW5nBjsARnsHSSIUSFRUUF9VU0VSX0FHRU5UBjsARiItZThhMjEz\nZmUwMmQ2YTg0NWUyNmIxMWM3NGE4MzU2Y2FhZjU3N2FlOEkiGUhUVFBfQUND\nRVBUX0xBTkdVQUdFBjsARiItMDU1MDVhYTY0OTdhYmQwMzFkNTEzY2EzYzkw\nM2NkODQ3NWE0ZTZlNw==\n--5aab23ce924aa6db4486a46d8b8e3dc5b9b84dc3"
Rack ENV
Variable    Value
GATEWAY_INTERFACE   
CGI/1.1
HTTP_ACCEPT     
text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
HTTP_ACCEPT_ENCODING    
gzip, deflate
HTTP_ACCEPT_LANGUAGE    
en-us,en;q=0.8,de-de;q=0.6,de;q=0.4,es;q=0.2
HTTP_CONNECTION     
keep-alive
HTTP_COOKIE     
rack.session=BAh7CEkiD3Nlc3Npb25faWQGOgZFRiJFNjU2YTQyY2FlOWM1NTljZWVlYmRl%0AMzI2MmZmNjZmZGU0MTk0M2I0NzQ5NmU0NDEzMTgwNjNkN2NkMWE4ZmM4MUki%0ACWNzcmYGOwBGIiVlOWViMWI1MTc5ZjFjZmEyZTdiMGFlOTY5MTJjNjk1Zkki%0ADXRyYWNraW5nBjsARnsHSSIUSFRUUF9VU0VSX0FHRU5UBjsARiItZThhMjEz%0AZmUwMmQ2YTg0NWUyNmIxMWM3NGE4MzU2Y2FhZjU3N2FlOEkiGUhUVFBfQUND%0ARVBUX0xBTkdVQUdFBjsARiItMDU1MDVhYTY0OTdhYmQwMzFkNTEzY2EzYzkw%0AM2NkODQ3NWE0ZTZlNw%3D%3D%0A--5aab23ce924aa6db4486a46d8b8e3dc5b9b84dc3
HTTP_DNT    
1
HTTP_HOST   
0.0.0.0:4567
HTTP_REFERER    
http://0.0.0.0:4567/
HTTP_USER_AGENT     
Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:33.0) Gecko/20100101 Firefox/33.0
HTTP_VERSION    
HTTP/1.1
PATH_INFO   
/
QUERY_STRING    
key=[redacted]&secret=[redacted]
REMOTE_ADDR     
127.0.0.1
REMOTE_HOST     
localhost
REQUEST_METHOD  
GET
REQUEST_PATH    
/
REQUEST_URI     
http://0.0.0.0:4567/?key=[redacted]&secret=[redacted]
SCRIPT_NAME     
SERVER_NAME     
0.0.0.0
SERVER_PORT     
4567
SERVER_PROTOCOL     
HTTP/1.1
SERVER_SOFTWARE     
WEBrick/1.3.1 (Ruby/1.9.3/2013-11-22)
rack.errors     
#<Object:0x00000001861720>
rack.input  
#<StringIO:0x00000002562410>
rack.logger     
#<Rack::NullLogger:0x00000001874460 @app=#<Rack::Session::Cookie:0x00000001874988 @secrets=["{redacted}"], @coder=#<Rack::Session::Cookie::Base64::Marshal:0x000000018745c8>, @app=#<Rack::Protection::FrameOptions:0x00000001874a78 @app=#<Rack::Protection::HttpOrigin:0x00000001874af0 @app=#<Rack::Protection::IPSpoofing:0x00000001874c30 @app=#<Rack::Protection::JsonCsrf:0x00000001874d48 @app=#<Rack::Protection::PathTraversal:0x00000001874f78 @app=#<Rack::Protection::RemoteToken:0x00000001875068 @app=#<Rack::Protection::SessionHijacking:0x00000001875180 @app=#<Rack::Protection::XSSHeader:0x00000001875248 @app=#<Tumblr::Authentication:0x000000018685c0 @default_layout=:layout, @preferred_extension=nil, @app=nil, @template_cache=#<Tilt::Cache:0x00000001868598 @cache={}>>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml"], :xss_mode=>:block, :nosniff=>true, :except=>[]}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml"], :tracking_key=>:tracking, :encrypt_tracking=>true, :track=>["HTTP_USER_AGENT", "HTTP_ACCEPT_LANGUAGE"], :except=>[]}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml"], :authenticity_param=>"authenticity_token", :except=>[]}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml"], :except=>[]}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml"], :except=>[]}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml"], :except=>[]}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml"], :except=>[]}>, @options={:reaction=>:drop_session, :logging=>true, :message=>"Forbidden", :encryptor=>Digest::SHA1, :session_key=>"rack.session", :status=>403, :allow_empty_referrer=>true, :report_key=>"protection.failed", :html_types=>["text/html", "application/xhtml"], :frame_options=>:sameorigin, :except=>[]}, @frame_options="SAMEORIGIN">, @default_options={:path=>"/", :domain=>nil, :expire_after=>nil, :secure=>false, :httponly=>true, :defer=>false, :renew=>false, :sidbits=>128, :secure_random=>SecureRandom, :secret=>"[redacted]", :coder=>#<Rack::Session::Cookie::Base64::Marshal:0x000000018745c8>}, @key="rack.session", @cookie_only=true, @sidbits=128, @sid_secure=SecureRandom, @sid_length=32>>
rack.multiprocess   
false
rack.multithread    
true
rack.request.cookie_hash    
{"rack.session"=>"BAh7CEkiD3Nlc3Npb25faWQGOgZFRiJFNjU2YTQyY2FlOWM1NTljZWVlYmRl\nMzI2MmZmNjZmZGU0MTk0M2I0NzQ5NmU0NDEzMTgwNjNkN2NkMWE4ZmM4MUki\nCWNzcmYGOwBGIiVlOWViMWI1MTc5ZjFjZmEyZTdiMGFlOTY5MTJjNjk1Zkki\nDXRyYWNraW5nBjsARnsHSSIUSFRUUF9VU0VSX0FHRU5UBjsARiItZThhMjEz\nZmUwMmQ2YTg0NWUyNmIxMWM3NGE4MzU2Y2FhZjU3N2FlOEkiGUhUVFBfQUND\nRVBUX0xBTkdVQUdFBjsARiItMDU1MDVhYTY0OTdhYmQwMzFkNTEzY2EzYzkw\nM2NkODQ3NWE0ZTZlNw==\n--5aab23ce924aa6db4486a46d8b8e3dc5b9b84dc3"}
rack.request.cookie_string  
rack.session=BAh7CEkiD3Nlc3Npb25faWQGOgZFRiJFNjU2YTQyY2FlOWM1NTljZWVlYmRl%0AMzI2MmZmNjZmZGU0MTk0M2I0NzQ5NmU0NDEzMTgwNjNkN2NkMWE4ZmM4MUki%0ACWNzcmYGOwBGIiVlOWViMWI1MTc5ZjFjZmEyZTdiMGFlOTY5MTJjNjk1Zkki%0ADXRyYWNraW5nBjsARnsHSSIUSFRUUF9VU0VSX0FHRU5UBjsARiItZThhMjEz%0AZmUwMmQ2YTg0NWUyNmIxMWM3NGE4MzU2Y2FhZjU3N2FlOEkiGUhUVFBfQUND%0ARVBUX0xBTkdVQUdFBjsARiItMDU1MDVhYTY0OTdhYmQwMzFkNTEzY2EzYzkw%0AM2NkODQ3NWE0ZTZlNw%3D%3D%0A--5aab23ce924aa6db4486a46d8b8e3dc5b9b84dc3
rack.request.query_hash     
{"key"=>"[redacted]", "secret"=>"[redacted]"}
rack.request.query_string   
key=[redacted]&secret=[redacted]
rack.run_once   
false
rack.session    
{"session_id"=>"656a42cae9c559ceeebde3262ff66fde41943b47496e441318063d7cd1a8fc81", "csrf"=>"e9eb1b5179f1cfa2e7b0ae96912c695f", "tracking"=>{"HTTP_USER_AGENT"=>"e8a213fe02d6a845e26b11c74a8356caaf577ae8", "HTTP_ACCEPT_LANGUAGE"=>"05505aa6497abd031d513ca3c903cd8475a4e6e7"}, "consumer_key"=>"[redacted]", "consumer_secret"=>"[redacted]"}
rack.session.options    
{:path=>"/", :domain=>nil, :expire_after=>nil, :secure=>false, :httponly=>true, :defer=>false, :renew=>false, :sidbits=>128, :secure_random=>SecureRandom, :secret=>"[redacted]", :coder=>#<Rack::Session::Cookie::Base64::Marshal:0x000000018745c8>}
rack.session.unpacked_cookie_data   
{"session_id"=>"656a42cae9c559ceeebde3262ff66fde41943b47496e441318063d7cd1a8fc81", "csrf"=>"e9eb1b5179f1cfa2e7b0ae96912c695f", "tracking"=>{"HTTP_USER_AGENT"=>"e8a213fe02d6a845e26b11c74a8356caaf577ae8", "HTTP_ACCEPT_LANGUAGE"=>"05505aa6497abd031d513ca3c903cd8475a4e6e7"}}
rack.url_scheme     
http
rack.version    
[1, 2]
sinatra.accept  
[text/html, application/xhtml+xml, application/xml, */*]
sinatra.error   
#<RuntimeError: SimpleOAuth: Found extra option keys not matching ATTRIBUTE_KEYS: [:consumer_secret]>
sinatra.route   
GET /

You're seeing this error because you have enabled the show_exceptions setting.

and this in the terminal:

[2014-11-26 15:51:25] INFO  WEBrick 1.3.1
[2014-11-26 15:51:25] INFO  ruby 1.9.3 (2013-11-22) [x86_64-linux]
== Sinatra/1.4.5 has taken the stage on 4567 for development with backup from WEBrick
[2014-11-26 15:51:25] INFO  WEBrick::HTTPServer#start: pid=22774 port=4567

(process:22794): GLib-CRITICAL **: g_slice_set_config: assertion 'sys_page_size == 0' failed
localhost - - [26/Nov/2014:15:51:25 PST] "GET / HTTP/1.1" 400 1530
- -> /
localhost - - [26/Nov/2014:15:51:26 PST] "GET /favicon.ico HTTP/1.1" 404 508
- -> /favicon.ico
localhost - - [26/Nov/2014:15:51:27 PST] "GET /favicon.ico HTTP/1.1" 404 508
- -> /favicon.ico
RuntimeError - SimpleOAuth: Found extra option keys not matching ATTRIBUTE_KEYS:
  [:consumer_secret]:
    /var/lib/gems/1.9.1/gems/simple_oauth-0.3.0/lib/simple_oauth/header.rb:88:in `attributes'
    /var/lib/gems/1.9.1/gems/simple_oauth-0.3.0/lib/simple_oauth/header.rb:74:in `signed_attributes'
    /var/lib/gems/1.9.1/gems/simple_oauth-0.3.0/lib/simple_oauth/header.rb:80:in `normalized_attributes'
    /var/lib/gems/1.9.1/gems/simple_oauth-0.3.0/lib/simple_oauth/header.rb:62:in `to_s'
    /var/lib/gems/1.9.1/gems/weary-1.1.3/lib/weary/middleware/oauth.rb:17:in `call'
    /var/lib/gems/1.9.1/gems/weary-1.1.3/lib/weary/middleware/content_type.rb:20:in `call'
    /var/lib/gems/1.9.1/gems/rack-1.5.2/lib/rack/builder.rb:138:in `call'
    /var/lib/gems/1.9.1/gems/weary-1.1.3/lib/weary/request.rb:52:in `call'
    /var/lib/gems/1.9.1/gems/weary-1.1.3/lib/weary/request.rb:118:in `block in perform'
    /var/lib/gems/1.9.1/gems/promise-0.3.0/lib/promise.rb:48:in `call'
    /var/lib/gems/1.9.1/gems/promise-0.3.0/lib/promise.rb:48:in `block in __force__'
    <internal:prelude>:10:in `synchronize'
    /var/lib/gems/1.9.1/gems/promise-0.3.0/lib/promise.rb:45:in `__force__'
    /var/lib/gems/1.9.1/gems/promise-0.3.0/lib/future.rb:35:in `__force__'
    /var/lib/gems/1.9.1/gems/promise-0.3.0/lib/future.rb:26:in `block in initialize'
localhost - - [26/Nov/2014:15:56:50 PST] "GET /?key=QSAMB774tgLv829aAE3UwhpsDEkCYXSyVZQdbXCCgGJsWZnho2&secret=6TXgcYAtAwl2NLjrKHCj5D1V8sL0h5suazvEbGx03Fxrok77B7 HTTP/1.1" 500 56798
http://0.0.0.0:4567/ -> /?key=QSAMB774tgLv829aAE3UwhpsDEkCYXSyVZQdbXCCgGJsWZnho2&secret=6TXgcYAtAwl2NLjrKHCj5D1V8sL0h5suazvEbGx03Fxrok77B7
localhost - - [26/Nov/2014:15:56:50 PST] "GET /__sinatra__/500.png HTTP/1.1" 200 24378
http://0.0.0.0:4567/?key=QSAMB774tgLv829aAE3UwhpsDEkCYXSyVZQdbXCCgGJsWZnho2&secret=6TXgcYAtAwl2NLjrKHCj5D1V8sL0h5suazvEbGx03Fxrok77B7 -> /__sinatra__/500.png

^C== Sinatra has ended his set (crowd applauds)
[2014-11-26 16:10:45] INFO  going to shutdown ...
[2014-11-26 16:10:45] INFO  WEBrick::HTTPServer#start done.
/usr/lib/ruby/1.9.1/psych.rb:297:in `initialize': Too many levels of symbolic links - /home/patrick/.tumblr (Errno::ELOOP)
    from /usr/lib/ruby/1.9.1/psych.rb:297:in `open'
    from /usr/lib/ruby/1.9.1/psych.rb:297:in `load_file'
    from /var/lib/gems/1.9.1/gems/tumblr-rb-2.1.1/lib/tumblr/credentials.rb:25:in `read'
    from /var/lib/gems/1.9.1/gems/tumblr-rb-2.1.1/lib/tumblr/command_line_interface.rb:231:in `has_credentials?'
    from /var/lib/gems/1.9.1/gems/tumblr-rb-2.1.1/lib/tumblr/command_line_interface.rb:207:in `authorize'
    from /var/lib/gems/1.9.1/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
    from /var/lib/gems/1.9.1/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
    from /var/lib/gems/1.9.1/gems/thor-0.18.1/lib/thor.rb:363:in `dispatch'
    from /var/lib/gems/1.9.1/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
    from /var/lib/gems/1.9.1/gems/tumblr-rb-2.1.1/bin/tumblr:5:in `<top (required)>'
    from /usr/local/bin/tumblr:23:in `load'
    from /usr/local/bin/tumblr:23:in `<main>'

As you may have noted, I had to hit Ctrl-C to kill the process, since the authentication in the browser never succeeds.

Maybe this is related to issue #45?

Anyway, I can't post via tumblr-rb at all, even after uninstalling all rubygems, uninstalling the rubygems package, reinstalling rubygems, and reinstalling tumblr-rb. Any help is much appreciated.

Using tumblr 2.1.1 and rubygems 1.8.23 under Linux Mint 17.

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

No branches or pull requests

1 participant