New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't connect twitter after upgrading to 0.9.9-a #58

Open
voss opened this Issue Oct 14, 2018 · 26 comments

Comments

Projects
None yet
6 participants
@voss
Copy link

voss commented Oct 14, 2018

Hi there,

Updated recently to 0.9.9-a by cloning it from the github rep. Afterwards, I installed the twitter plugin from idno/Twitter by cloning the rep as well. I've tried disabling and reenabling the twitter plugin, and I've also tried to refresh my API key and client secret for the app I've made on apps.twitter.com to post on twitter on my behalf, but so far this hasn't worked out.

The behaviour I'm seeing is, that when I go to the /account/twitter url on my site, I see the "Connect Twitter" button. When I click it, I return to the same page, still with the button saying "Connect Twitter". If I try to make a new post, I don't get the Twitter button on the post either. Is there a way to reset the Twitter connection, or something I can check for to investigate what the issue might be?

@mapkyca

This comment has been minimized.

Copy link
Contributor

mapkyca commented Oct 15, 2018

Anything in your logs?

@voss

This comment has been minimized.

Copy link

voss commented Oct 15, 2018

Hi @mapkyca, thanks for your reply!

I checked my logs, and in the access.log for apache, I get the following sequence when trying to connect.

[15/Oct/2018:05:32:05 -0700] "GET /twitter/auth HTTP/1.1" 302 4377 "https://domain.example/account/twitter/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.54 Safari/537.36" [15/Oct/2018:05:32:05 -0700] "GET /account/twitter/ HTTP/1.1" 200 18336 "https://domain.example/account/twitter/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.54 Safari/537.36" [15/Oct/2018:05:32:05 -0700] "GET /styles/site/ HTTP/1.1" 200 1735 "https://domain.example/account/twitter/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.54 Safari/537.36" [15/Oct/2018:05:32:06 -0700] "GET /chrome/manifest.json HTTP/1.1" 200 5734 "https://domain.example/account/twitter/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.54 Safari/537.36" [15/Oct/2018:05:32:07 -0700] "GET /service-worker.min.js HTTP/1.1" 200 1228 "https://domain.example/service-worker.min.js" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.54 Safari/537.36"

I checked error.log, but I don't see any lines written to it, when hitting the "connect twitter" button.

I'm hosted on dreamhost shared hosting, and I'm on PHP 7.0 FastCGI.

I know it's not easy troubleshooting these things from a distance. I was on Known 0.9.9 (release version) before, and the server was on PHP 5.6 FastCGI. Twitter was working then, and I only came across this issue after I updated the server to PHP 7.0 FastCGI, and Known to the 0.9.9-a master from Github.''

Not sure any of the above helps (:

@mapkyca

This comment has been minimized.

Copy link
Contributor

mapkyca commented Oct 15, 2018

Hmm...

I haven't been able to replicate - I can connect to twitter (latest build of the plugin, and latest known from github).

Server is PHP 7 / Apache2.

When you hit the connect to twitter button, do you get forwarded to twitter and are asked to authorise the app there?

@voss

This comment has been minimized.

Copy link

voss commented Oct 15, 2018

When you hit the connect to twitter button, do you get forwarded to twitter and are asked to authorise the app there?

Nope, it just reloads the settings page on Known.

Strange.

@benwerd

This comment has been minimized.

Copy link
Member

benwerd commented Oct 15, 2018

This is going to sound dumb, but try clearing your Known-side cookies.

@voss

This comment has been minimized.

Copy link

voss commented Oct 15, 2018

Hi @benwerd, thanks for the suggestion! I did nuke the site data, including all cookies for my Known instance, but let me give it another go and let you know.

@benwerd

This comment has been minimized.

Copy link
Member

benwerd commented Oct 15, 2018

The reason is, I've seen this sometimes happen with misshapen oauth data. Also: I wonder if this is a browser issue? Safari in particular handles cookie setting on redirect differently to everyone else. If so, that's definitely a bug that needs to be fixed.

@voss

This comment has been minimized.

Copy link

voss commented Oct 15, 2018

Good point. I tried in both an incognito window in Chrome just now, and also in a private session in Firefox (latest release), and it's the same issue. It just reloads the page with the Known account settings for Twitter. I'll try removing the twitter plugin, and adding it again, and see if that helps.

@voss

This comment has been minimized.

Copy link

voss commented Oct 15, 2018

I deleted the Twitter folder from IdnoPlugins, and cloned it again from github. Same result. I have I feeling I did something to break it, since it worked fine before I upgraded to 0.9.9-a, and @mapkyca isn't able to reproduce it. Might try to clone Known again, on another domain, to see if I can make it work there.

@voss voss closed this Oct 15, 2018

@voss voss reopened this Oct 15, 2018

@cdn

This comment has been minimized.

Copy link

cdn commented Oct 15, 2018

Assuming that there are credentials (token/secret) on https://domain.example/admin/twitter/, otherwise such submission loops are quite likely, if one is impatient and forgets that side of the setup?

@voss

This comment has been minimized.

Copy link

voss commented Oct 16, 2018

@cdn got my API secrets and tokens in there. I also regenerated the token and secret just in case there was something wrong there:

twitter-api-secret
Let me try to setup Known on another domain this coming weekend and see if I'm able to reproduce it there.

@voss

This comment has been minimized.

Copy link

voss commented Oct 20, 2018

Update on this.

Cloned 0.9.9-a onto another domain, also hosted on dreamhost. Ran the warmup, where I'm told the installer is not able to tell if mod_rewrite is enabled on the domain, which it is by default on all dreamhost servers. Because of this, the warmup actually goes in an endless loop, and never finishes, but I'll file a separate issue for this against Known.

I handwrote my config.ini as a result of the warmup loop, and then cloned the Twitter plugin into the IdnoPlugin, supplied the consumer key and consumer secret in the settings for the plugin in Known, went to the setup page, clicked "Connect Twitter", and the same thing happens. Page reloads, no errors in the apache error.log.

Next step I'll do, is to install the release 0.9.9 version of Known, and try the same steps and see if that works.

@cdn

This comment has been minimized.

Copy link

cdn commented Oct 20, 2018

My working setup:

Twitter$ git status
On branch master
Your branch is behind 'origin/master' by 45 commits, and can be fast-forwarded.
(use "git pull" to update your local branch)
nothing to commit, working tree clean

Twitter$ ls -lrt
total 44
-rw-rw-r-- 1 cn cn 1006 Dec 31 2015 README.md
drwxrwxr-x 2 cn cn 4096 Dec 31 2015 Pages
-rw-rw-r-- 1 cn cn 21876 Dec 31 2015 Main.php
drwxrwxr-x 3 cn cn 4096 Dec 31 2015 external
-rw-rw-r-- 1 cn cn 381 Dec 31 2015 plugin.ini
drwxrwxr-x 3 cn cn 4096 Dec 31 2015 templates

version.known :

version = "0.9.9-a"
build = 2018101001

PHP 7 / Postgres

@voss

This comment has been minimized.

Copy link

voss commented Oct 20, 2018

@cdn thanks for that extra detail.

I now installed 0.9.9, and cloned the master branch of the twitter plugin. I now end on a page that looks like this when I try to configure the twitter plugin on /admin/twitter:

screenshot 2018-10-20 at 14 40 43

The error message on the page says:

Something went wrong.
Call to undefined method Idno\Core\Language::_()
Click here to try again, or click here to go back to the homepage.

Here's what git status gives on the Twitter plugin folder that I just cloned:
$ Twitter git status
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean

Not sure entirely what I can do to make Twitter work again on a shared dreamhost setup. @cdn are you on Dreamhost as well?

I guess downgrading to 0.9.9 again, and trying to install one of the older commits to the Twitter plugin could be one path.

@mapkyca

This comment has been minimized.

Copy link
Contributor

mapkyca commented Oct 20, 2018

It looks like it's complaining because of the i18n functions, which are missing from the older 0.9.9 build. That build, btw, is over a year old... I suggest tracking github where you can, or using one of my unofficial packages (https://www.marcus-povey.co.uk/known) if you don't like tracking git...

@cdn

This comment has been minimized.

Copy link

cdn commented Oct 20, 2018

You might find a 0.9.9 + commit that adds them; or go straight to a recent 0.9.9-a one.
Or rewind Twitter to before they were added?

No, I’m not on Dreamhost, playing with Known on Raspbian (Raspberry Pi 3B).

@voss

This comment has been minimized.

Copy link

voss commented Oct 21, 2018

@mapkyca I am tracking git, or, at least that's what I wanted to do when I broke the twitter setup (: thanks for the link to your unofficial packages, I might do that instead of tracking git.

So what I have right now, is the 0.9.9-a cloned from github. I did this to be able to just update from master branch using git on shared hosting provider, so it would be easier to roll updates on my install.

But the combination of using the master branch of Known, and the master branch of the Twitter plugin, doesn't seem to work on Dreamhost. Unfortunately.

@cdn got it, that makes sense. I would prefer using the git master branch, and then try to find a twitter version that worked with it on dreamhost. Time to do some experimenting I guess (:

@voss

This comment has been minimized.

Copy link

voss commented Nov 13, 2018

Well, I hope I didn't waste as much of anyone's time as my own looking at this, but I found the error, and of course, it was not related to Known or Dreamhost at all, but rather to me being dim.

When I updated Known, I also updated PHP, and I also changed to https. Updating Known and PHP was the only thing I was thinking could have impacted it, but of course changing to https also had an impact, since I didn't update the URL in the Twitter app I had made to post on my behalf.

Adding https instead of http for the callback in the twitter app, solved the entire issue. Apologies for wasting peoples time on this.

Thanks all!

@mapkyca

This comment has been minimized.

Copy link
Contributor

mapkyca commented Nov 13, 2018

Glad you got it sorted, thanks for letting us know about this!

@voss

This comment has been minimized.

Copy link

voss commented Nov 13, 2018

Thanks for everyone's patience and help.

@davidmead

This comment has been minimized.

Copy link

davidmead commented Jan 2, 2019

I just downloaded Known 0.9.9 from http://withknown.com, and I'm having the same issue with the plugin...

Something went wrong.
Call to undefined method Idno\Core\Language::_()
Click here to try again, or click here to go back to the homepage

@mapkyca If I download a .ZIP of one of your packages are there certain files I need to copy across or do I have to replace everything and start from scratch?

@mapkyca

This comment has been minimized.

Copy link
Contributor

mapkyca commented Jan 2, 2019

Standard procedure - replace everything except your configuration files and the Uploads directory.

For anyone who reads this - avoid using the "official" package on withknown.com, it's hopelessly out of date at this point. I think @benwerd is going to update the whole site, but he's a busy dude.

@raphaeljolivet

This comment has been minimized.

Copy link

raphaeljolivet commented Jan 2, 2019

Hi, I connot find a 0.9.9-a branch or tag on github.
Should I take the tip of "master" in order to have something up to date.

It's a pitty that a great software like Known does not have proper version / release management.

@davidmead

This comment has been minimized.

Copy link

davidmead commented Jan 2, 2019

OK @mapkyca. I'll give that a go tonight.

And by "your configuration files" do you mean the .htaccess and updated config.ini for the database connections? Or is there a folder that I shouldn't touch?

@mapkyca

This comment has been minimized.

Copy link
Contributor

mapkyca commented Jan 2, 2019

Those are they, and also leave the Uploads folder alone

@davidmead

This comment has been minimized.

Copy link

davidmead commented Jan 3, 2019

OK @mapkyca. Using your 0.9.9-a build and was able to connect to Twitter (still had the old app setup from 2015). Post showed up on Twitter fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment