1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.4 Twitter Integration

Discussion in 'Troubleshooting and Problems' started by Valhalla, Nov 18, 2014.

  1. Valhalla

    Valhalla Well-Known Member


    What may cause using the "Log in with Twitter" button on the log-in form to work intermittently?

    When using (testing) this feature, occasionally I will receive "An unexpected error occurred. Please try again later.", however, when trying again a few seconds later it will work as expected (requesting permission on Twitter).

    One more thing, assuming everything works as expected, and you decide not to go ahead with the authorisation, and you click "Cancel", and then "Return to [site]", it will redirect you to an error message: "An unexpected error occurred. Please try again later".
  2. Jeremy

    Jeremy Well-Known Member

    Are there any errors logged into your site? Can you get this to work all the time with add-ons disabled?
  3. Valhalla

    Valhalla Well-Known Member


    I disabled all add-ons on my site, and it was still performing intermittently - sometimes taking me to Twitter, sometimes returns with the error. (I kept trying it for a while with add-ons disabled.)

    Then I re-enabled add-ons, with the same result. A while later, it began working more solidly, but I observe it still returns the error maybe 10% of the time.

    There were no server error logs, apart from three all the same. I received these ones before disabling add-ons (before posting this thread) during one of the times it *did* successfully take me to Twitter. When I clicked "Sign In", it redirected me to my site, with the error here:

    Detailed error:

    I didn't get that error (immediately above) all the time I tried though, sometimes it actually worked, and I connected my Twitter account with the forum account.

    Lastly, the whole process is very slow. "Redirecting you back to the application" seems to take ten seconds.

    (By the way, the last thing I mentioned in my first post is actually reproducible on this site, but I'm not sure if that error is designed, rather than returning you to the site as suggested.)

  4. Jeremy

    Jeremy Well-Known Member

    I missed that comment about this site. It isn't designed, but if it is taking ~10 seconds to redirect back when it does work, it is likely some service issues with Twitter that are ultimately outside the control of the software.
  5. Valhalla

    Valhalla Well-Known Member

    Thanks, I shall post if anything changes.
  6. Valhalla

    Valhalla Well-Known Member

    Something similar is happening with Facebook log-in.

    Clicking "Log in with Facebook" as a guest (or "Associate with Facebook" from Your Account when logged-in) redirects me to Facebook as expected.

    When clicking "OK" to confirm access, it redirects me back to my site with the message "An error occurred while connecting with Facebook. Please try again later".
  7. Valhalla

    Valhalla Well-Known Member

    I'm still trying to resolve this problem. I haven't been able to offer this option of log-in or sign-up yet because of the number of times it tends to fail.

    The actual error (although not logged) behind the "An unexpected error occurred. Please try again later" message is below.

    Some other details:
    - The forum in which this is occurs is running XenForo 1.4.2.
    - I have received this error when all add-ons were disabled.
    - I created a test forum on the same server and did not receive any errors. The Twitter integration worked well each time I tried it (of course, modifying the Website URL value within the Twitter App Settings.). I had no errors on the separate test forum. The test forum I created was using XenForo version 1.4.3 (I haven't had opportunity to check if anything was changed - just a thought.)

    Thank you,
  8. Valhalla

    Valhalla Well-Known Member

    I believe this to be related to PHP configuration - although I haven't narrowed it down completely just yet.

    (My live forum, where I received the intermittent error, was using PHP 5.6, while the test forum, where I received no errors, was using PHP 5.4.)

    I just changed the PHP instance of my live site, and it seems to work.
  9. Valhalla

    Valhalla Well-Known Member


    I have again reached the problem detailed above when attempting to use the in-built Twitter integration using PHP 5.6.0 (this is on a Windows server, and it's a separate instance to my live forum which has used this feature on PHP 5.3 and 5.4 without any problems).

    Running the Twitter Integration test (?tools/test-twitter) returns in one of a series of errors:

    Either simply:

    Or something similar to this:

    I do not believe it to be a problem with my Twitter app settings.
    The test forum on which I am trying this on does not have any add-ons installed (XF 1.4.3).

    (A similar problem occurs with the Facebook integration feature - errors are returned instead of the integration being successful.)

    I shall update this thread should I find a solution.
    Last edited: Feb 21, 2015
  10. Valhalla

    Valhalla Well-Known Member

    Yes, I appeared not to have put a Callback URL as part of the App settings. It appears to be working now.

    (Although I can't explain the earlier problems because I'm sure I tried with and without a Callback URL countless times.)
  11. Valhalla

    Valhalla Well-Known Member

    It appears those events were merely fortuitous.

    When testing Twitter/Facebook integrations, sometimes it will work, sometimes it will not. I receive error messages such as:

    - Your server could not connect to Facebook (https://graph.facebook.com). Try again later. If the issue persists, contact your host.
    - Twitter returned the following error: Error in HTTP request.

    (My XF Server Error log has errors from members trying to use the feature.)

  12. Brogan

    Brogan XenForo Moderator Staff Member

  13. Valhalla

    Valhalla Well-Known Member

    I do believe so (just checked again too).

    Just to note that on the occasions it does work, clicking on 'Run Test' does not immediately direct me to Twitter/Facebook to authenticate - it hangs for a while, then either takes me to Twitter/Facebook or produces the error similar to above.
  14. Brogan

    Brogan XenForo Moderator Staff Member

    If it's failing randomly then that may point to an issue on the server.
    Valhalla likes this.
  15. Mike

    Mike XenForo Developer Staff Member

    It seems like there are outgoing connectivity issues -- both of those errors seem to point to that. Unfortunately it's hard to say what specifically would be causing that. It's lower level than XenForo (it's mostly related to your network stack).
    Valhalla likes this.

Share This Page