slack-libpurple icon indicating copy to clipboard operation
slack-libpurple copied to clipboard

Invalid JSON response

Open barefootcoder opened this issue 5 years ago • 7 comments

I started getting the error above on 9/22. Since I hadn't updated the plugin in a while, I did that, and the problem went away. Today it's back, and it looks like there's been no new updates for me to try.

It shows this error when initially connecting; restarting Pidgin doesn't have any impact. I'm happy to provide any further logs or debugging if you can give me a pointer on how to enable or access that.

Thx for all your work on this plugin!

barefootcoder avatar Sep 29 '20 02:09 barefootcoder

Can you get a debug log?

From the buddy list, Help->Debug Window, and then reconnect to the account.

EionRobb avatar Sep 29 '20 03:09 EionRobb

Wow. That's a lot. Okay, I put it into a gist and tried to "black out" (figuratively speaking) any PII—please let me know if I missed anything so I can correct it ASAP. :-)

Let me know if there's more I can provide.

barefootcoder avatar Sep 29 '20 07:09 barefootcoder

Ah, so this line:

(23:36:28) slack: api call: https://[email protected]//api/rtm.connect?token=...&batch_presence_aware=1&presence_sub=true

shows that I didn't quite fix it enough in https://github.com/dylex/slack-libpurple/commit/058df128752e2891e847eaf74138b3b6b4e42fcd :( (the commit fixes when using the legacy tokens, but doesn't completely resolve using the legacy username)

As a workaround, you can edit the Slack account settings in Pidgin so that the 'host' is your subdomain, and that 'username' is your user.

EionRobb avatar Sep 29 '20 09:09 EionRobb

Hmmm ... I guess I'm not sure what you mean by that. :-) Currently what I have is something like:

If I change that to, say,

then, after saving, the Accounts window shows my username as myname%[email protected]/, which gives me the same error.

I tried several different variations, but it always seems to want to glue the two pieces together with a %, which is (obviously, I think?) not working.

barefootcoder avatar Sep 29 '20 20:09 barefootcoder

Wait! Now it's working. :-)

The magic incantation was:

I thought I'd tried that one already, but either I misremembered, or I did try it and it just had a transient error. But I stopped staring at it for a while and it just magically connected. Turns out the % is just fine. :+1:

So I'm good for now. You can close the issue, or keep it open until you do a formal fix if you prefer. Or is this the sort of thing that's not worth fixing?

barefootcoder avatar Sep 29 '20 20:09 barefootcoder

oh, that's a bit of an odd setup.... normally the username would have transitioned from

  • Username: [email protected] and you'd set it to be
  • Username: myname
  • Host: mycompany.slack.com

Is this an enterprise account, with your own custom hostname, rather than using the slack TLD?

EionRobb avatar Sep 29 '20 20:09 EionRobb

It's definitely an enterprise account ... whether or not we have a custom hostname, I honestly don't know. Once I'm logged into Slack via the browser, the URL just starts with https://app.slack.com, but how I actually get there I don't know, because we have a password manager, so the URL it's actually going to to login is in there, and apparently I'm not allowed to view it, because it's a company-wide one rather than a personal one I set up myself.

But when I click on Slack in the password manager and try to watch the URL bar in my browser very closely, I think I do briefly see an URL inside our domain rather than a slack.com URL. But it flashes by so quickly that I can't be 100% sure.

Hope that helps ...

barefootcoder avatar Sep 30 '20 00:09 barefootcoder