Connected Services - Error 500

(Btnsoc) #1

Hello, today I tried to get wordpress and tumblr set up with my pod.

Whenever I go through the auth process from D* I just get an error 500 message. Running
I click “authorize” then get error page for the redirect url below… = error 500 -> Error 500

From diaspora.yml:

## OAuth credentials for Twitter
twitter: ## Section

  enable: true
  key: '<key>'
  secret: '<secret>'

## OAuth credentials for Tumblr
tumblr: ## Section

  enable: true
  key: '<key>'
  secret: '<secret>'

wordpress: ## Section

  enable: true
  client_id: '<id>'
  secret: '<secret>'

Any Ideas?

(Jonne Haß) #2

Would be awesome if you could dig out the relevant sections from your log/production.log for these requests :slight_smile:

(Btnsoc) #3

The strange thing was, I didn’t see anything relevant when I grep’d the production log for relevant URLs, perhaps I was a little tired and missed something, or the error is something to do with Apache rather than a problem with the D* source code. Will check again later when I get time.

I trust these integrations are working for other people without issue?

(Btnsoc) #4

Tried reproducing the error, and looking through the logs there is a 401 error, checked the key/secret and saw that I’d missed out the first character of the key.

So, all authorized now, BUT, my “shared” posts are not appearing on Tumblr! Grr…

Shall try and see what the problem is with WP and report back with any issues I have there.

(Btnsoc) #5

Here is the relevant info for Tumblr from my production.log:

[2019-01-25T12:29:19] INFO  PID-24301 TID-69878127153840 Sidekiq: Workers::PostToService JID-fc975132f1b87533863598a0: start
[2019-01-25T12:29:20] INFO  PID-24301 TID-69878127153840 Sidekiq: Workers::PostToService JID-fc975132f1b87533863598a0: fail: 0.359 sec
[2019-01-25T12:29:20] WARN  PID-24301 TID-69878127153840 Sidekiq: {"context":"Job raised exception","job":{"class":"Workers::PostToService","args":[10,86322,""],"retry":10,"queue":"medium","backtrace":15,"jid":"fc975132f1b87533863598a0","created_at":1548419321.9364378,"locale":"en","enqueued_at":1548419359.9158492,"error_message":"no implicit conversion of String into Integer","error_class":"TypeError","failed_at":1548419322.2987447,"retry_count":0,"error_backtrace":["app/models/services/tumblr.rb:21:in `[]'","app/models/services/tumblr.rb:21:in `post'","app/workers/post_to_service.rb:14:in `perform'"]},"jobstr":"{\"class\":\"Workers::PostToService\",\"args\":[10,86322,\"\"],\"retry\":10,\"queue\":\"medium\",\"backtrace\":15,\"jid\":\"fc975132f1b87533863598a0\",\"created_at\":1548419321.9364378,\"locale\":\"en\",\"enqueued_at\":1548419359.9158492,\"error_message\":\"no implicit conversion of String into Integer\",\"error_class\":\"TypeError\",\"failed_at\":1548419322.2987447,\"retry_count\":0,\"error_backtrace\":[\"app/models/services/tumblr.rb:21:in `[]'\",\"app/models/services/tumblr.rb:21:in `post'\",\"app/workers/post_to_service.rb:14:in `perform'\"]}"}
[2019-01-25T12:29:20] WARN  PID-24301 TID-69878127153840 Sidekiq: TypeError: no implicit conversion of String into Integer
[2019-01-25T12:29:20] WARN  PID-24301 TID-69878127153840 Sidekiq: app/models/services/tumblr.rb:21:in `[]'

(Btnsoc) #6

I have set up a development environment on another machine so maybe I can try to take a look at the code to see if I can get it working, however I am (very) new to Ruby/Rails.

(Jonne Haß) #7

Sounds like some kind of error response (which the service should handle better, but…)

That line of code just tries to fetch the blogs from the /v2/user/info endpoint:

Which according to its documentation doesn’t have any optional field on the way:

(Btnsoc) #8

Yes was looking at L21, tried to dump the output from blogs.inspect to a file in /tmp but changes to code are ignored.

Presumably, I can’t just directly edit code in diaspora/app/models/services/… ?

I did a graceful restart of D* after my edits, not sure how to get code changes recognized, wanted to inspect the response from tumblr so as to try to work out where the problem is arising.

Are the bits in /app precompiled somewhere (the fact that it gives an error with a line number seems to suggest not)

Sorry for n00b questions :slight_smile:

(Jonne Haß) #9

Ah, this is most likely called from a sidekiq worker, so make sure to restart your sidekiq(s) after you made a change.

(Benjamin Neff) #10

Maybe that has something to do with this?

(Btnsoc) #11

Ok, this is a bit weird, but I added a second blog to my tumblr account and it now seems to be working. It may have been that or it may have been that I had altered my profile etc on tumblr.

Seems code here is a little flaky so I might try further investigation…

1 down, 1 to go (WP)

Does anybody know how long Twitter usually take to approve apps?