Twitter Issues Again :( (Smoothwall)

Continuing the discussion from Twitter Module Issues:

Well this is very annoying! :frowning:

Twitter has decided to stop working! We had it going for a couple of days and now nothing! Logs Below:

14006 15-11-06 08:43:42 CMS Twitter getToken Error contacting Twitter API:
14005 15-11-06 08:43:42 CMS Config isProxyException https://api.twitter.com/oauth2/token in . Pos =
14004 15-11-06 08:43:42 CMS module SetMediaInformation Existing Assigned Media XML is: \n <?xml version="1.0"?>

81.jpg


14003 15-11-06 08:43:42 CMS Layout GetLayoutXml OUT
14002 15-11-06 08:43:42 CMS Twitter getToken Bearer Token served from API
14001 15-11-06 08:43:42 CMS Layout GetLayoutXml IN
14000 15-11-06 08:43:42 CMS Cache has bearer_VnlXSDM3VTJ1Z3luN3g3WGF6WjZqNk1sMzpBdVlhRWVuUTRZblV2UkRHeTJrTnF1ajJCb0FYdnFwbjViT1ZLQTVLcmV0RVZGRDFiZg== not present
13999 15-11-06 08:43:42 CMS module Module created with MediaID: 81 LayoutID: 9 and RegionID: 587056377aadea7c5
13998 15-11-06 08:43:42 CMS Twitter getTwitterFeed Querying API for CathaysHigh

Any Help will be much appreciated!

Looks like you’ve configured twitter to be a proxy exception in your Xibo configuration - when you actually want it to go via the Smoothwall box?

Oh Right, where would that code be located then?
And yes everything has to go via the Smoothwall filter for an outside connection.

It’s in the CMS settings with the other proxy settings.

Settings -> Network -> Proxy Exceptions

No just checked and that box is blank. :confused:
When I was trying to get it working the first time i may have added something to the code? but i was following instructions on Github at the time.

Beyond that then there’s nothing in the log that makes me think there should be a problem.

What code changes did you make? I don’t recall any being necessary in recent times for Twitter?

Perhaps upgrading to 1.7.5 would sort it if there were code changes put in place earlier that are no longer necessary.

I was following everything on here: https://github.com/xibosignage/xibo/issues/231 (my original post to github)

I did backup the file i modified and have since restored it, i have also just installed the latest 1.7.5 and still no luck.

Just keep getting this:
15813 15-11-06 12:16:46 CMS Twitter getToken Error contacting Twitter API:

What comes just after that error line in the log? I’d expect to see some kind of message.

Can you also check in Smoothwall that nothing is being blocked from the CMS’s IP address?

Nothing :confused:
Attached is the logs

Thing is our internet connection (and smoothwall filtering) is controlled by our LEA. So anything to do with smoothwall is done by County IT.
I can ask them, but they takes ages getting back to us usually.

The fact there isn’t anything after the API: means that curl_error() is empty: https://github.com/xibosignage/xibo-cms/blob/master/modules/twitter.module.php#L683

It could be that the return from curl_exec() is completely empty, which would validate as false and therefore error (without there actually being a curl error).

You could change the logging line of the above linked code to:

Debug::Error('Error contacting Twitter API: ' . curl_error($curl) . ', Result: ' . var_export($result));

Just to see what is coming back.

Beyond that it could be that Smoothwall is just returning an empty result rather than a HTTP error - the logging change should give indication.

Thanks Dan.
Shall have a look at this today. Will let you know the result.
:slight_smile:

Hi Dan,
Now tried that and it just shows the word Result at the end. (see below)

Cheers
Arran

Dan that line in the log “isProxyException” - Does that mean it’s thinking it should use that as an exception?

No - its checking whether its a proxy exception and finding that it isn’t

So you are getting an entirely empty reply - my best guess is that smoothwall or something else on the network is gobbling up the request completely.

I’m not sure what to suggest at this point - without an error or result from CURL its very difficult to imagine what might be happening.

Right well I’ve heard from County IT and they are asking does the Twitter module use SSL?
As the filtering intercepts all SSL traffic, they can put an exception in for that specific IP address, but that leads me on to ask, does the server load up the twitter info or does the client? which IP would need to have the exception?

Fixed!!! :slight_smile:

Once a week smoothwall will come up asking every user to Accept County IT’s usage policy which happens any time you try to visit a HTTPS website.
After typing my last reply, I though I’d login to the server and go to google and hit the accept button.
Then I tried the twitter module, and it worked!
Spoken to County IT and they are going to put an exception in for the server.
So after all that it was the accept button getting in the way!

Hope this thread will be useful for others using SmoothWall! :smiley:
And thanks once again to Dan and Alex for their great help!

Cheers!
Arran

2 Likes

Cool.

Yes it does use SSL - hence the need in your last case to add the Smoothwall CA certs to Curl. Glad it’s working now.