Topic-icon Twitter stream module breaks homepage loading

Active Subscriptions:

None
Hi,

Developed a website, where I have a Twitter stream module using SCSocial Stream.
On the testing server, everything went smoothly. After changing the files to the client's server, I see the message "Error while loading position" where I should see the Twitter stream.
Also, the page takes a lot to load. If I unpublish the module, the page loads fine, with no other error on the website.

Do you know what could be causing this?

Thanks,
Tiago
The topic has been locked.
Support Specialist
8 years 2 weeks ago #57846 by alzander
It sounds like the Twitter stream is having issues loading. If there's a long load time, it likely means that JFBConnect is trying to fetch the stream from Twitter but can't. That can cause a long load time or timeout, which explains the long delay. Of course, JFBConnect normally caches that result, so when it works, there's usually only a slight delay every once in a while on one page load... and that result is stored for the cache duration so there is no delay on future page loads.

Now, as to why the issue is happening, I'd suggest the following:
* Go to the Channels -> Twitter configuration area and make sure the test stream shows there. That's the easiest method to test that JFBConnect can fetch the stream.
** If there's an error message there, let us know what it is.
** If the stream doesn't load, double check the channel configuration and/or re-authenticate with Twitter on the front-end to re-fetch the proper authentication token.
* When that works, try on the front-end. If it doesn't work still, set the Error Reporting setting in JFBConnect to 'Yes' and let us know any errors that display.

Let us know how that goes and we'll gladly help investigate however we can.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
8 years 2 weeks ago #57851 by tsoares05
Hi Alex,

Thanks for the reply.
It shows this message:
"An error has occurred.
0 Failed to connect to api.twitter.com port 443: Connection timed out"

Should I try to reconnect at front-end and re-create the module?

Thanks,
Tiago
The topic has been locked.
Support Specialist
8 years 2 weeks ago #57855 by alzander
That message seems like your site can't connect to Twitter for some reason. Have you been able to authenticate using Twitter on that site?

The error message is vague, but there are various things that could cause it:
* Your server isn't doing DNS lookups properly (translating api.twitter.com to it's IP address)
* An SSL connection couldn't be established (your server root certificates aren't up to date)
* Various other firewall or blocking issues that would prevent your server from making outgoing connections.

I hope that helps give you some ideas. Once we know if Twitter authentication works or not, that will help narrow things down a bit.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
8 years 2 weeks ago #57870 by tsoares05
Sorry Alex, but I'm a totally newbie on this. Where can I check these settings with the client's server?

Regarding the front-end login, I've created an home twitter log field to authenticate on the social profile. After a successful login, if I come back to the JFC channel, it still gets a lot to load and returns the same error.
Should I recreate the module after logging in on Twitter?

Thanks for the help.
Tiago
The topic has been locked.
Support Specialist
8 years 1 week ago #57879 by alzander

Sorry Alex, but I'm a totally newbie on this. Where can I check these settings with the client's server?

If authentication works, then I'm not sure exactly what could be wrong. Authentication shows that your server can communicate with Twitter, so there likely aren't any firewalls or server issues preventing loading the stream.

Should I recreate the module after logging in on Twitter?

It doesn't hurt to delete the Channel and try to set it up again. I don't know why that would fix things, but it's worth a shot.

The only other suggestion I can recommend is to implement a minor code fix that we're already planning in the upcoming v7 release. This change will disable a verification step during an SSL connection, which could solve your problem. It makes communication between your server and Twitter slightly less secure, but still encrypted. To implement the fix, edit the following file:
/component/com_jfbconnect/libraries/joomla/http/transport/curl.php
Around line 138, you should see:
// Set the cURL options.
           curl_setopt_array($ch, $options);
Add the following right *before* that line:
$options[CURLOPT_SSL_VERIFYPEER] = false;

Let us know how that goes.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
8 years 1 week ago #57900 by tsoares05
Hi Alex,

It might be something with the server.
Changed the code as you mentioned, recreated the social channel, waited for the channel to load the tweets and nothing. It gives me an "Failed to connect to api.twitter.com port 443: Connection timed out".
Could it be something related with a firewall or blocking setting?

Thanks,
Tiago
The topic has been locked.
Support Specialist
8 years 1 week ago #57905 by alzander
The message itself means that your server is unable to connect to that address, api.twitter.com. As for the why, that's the million dollar question that I don't have an immediate answer too. It's strange since, if you can login with Twitter, you likely are connecting to some of twitter.com domains.

The problem could be various things from Joomla itself (a firewall or security extension for it) to lower level stuff like your server (a firewall, misconfigured apache or proxy settings) to your hosting company itself (blocking outgoing connections or limiting things in other ways).

We can help with the Joomla issues. The suggestions above were meant to do that. Lower level stuff is out of our domain as it could be anything and I don't know your server/host/etc. One easy thing to try is simply SSH into your server and type:
curl https://api.twitter.com
That should load some HTML from their server in the prompt. If you get an error, it means your server can't make the connection. If you don't have SSH access, I'd contact your host to see if they can run a similar test of have any suggestions for why a connection can't be made.

I hope that helps explain things further. I wish I had the magic bullet for you, but I'm a bit confused too.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
8 years 1 week ago #57909 by tsoares05
Ok. I'm kind of lost in here.
Tested the server connection to Twitter's api and it seems to have no problems.
Removed the channel, user, twitter api key and started the process again... now, on the front-end's login fields, I see the message "Connect this site to your Social network?". Clicking the button I receive the message "The request token for this page is invalid. It may have already been used, or expired because it is too old. Please go back to the site or application that sent you here and try again; it was probably just a mistake.".
Check if the api key was correct and now I can't see the user on the users map.

Any ideas? Why do I have the felling that I'm doing something wrong in here that is turning this into circles?

Thanks,
Tiago
The topic has been locked.
Support Specialist
8 years 1 week ago #57919 by alzander
Yeah, this doesn't sound like a lot of fun. There's a lot of really, really conflicting information I'm hearing. I don't think it's you, just something very strange happening.

Can you Private Message me FTP credentials and a super admin login to the back end of your site? We'll gladly investigate further on-site and should be able to narrow down the issue pretty quickly once we can add some debug code.

You can PM me by clicking the mail icon under my name to the left.

Thanks,
Alex
The topic has been locked.