WordPress.org

Forums

Latest Tweets Widget
[resolved] 0: Error -1, couldn't connect to host (15 posts)

  1. James Davies
    Member
    Posted 1 year ago #

    Hi,

    Can someone please help. I've installed and input the Twitter tokens but get this message:

    0: Error -1, couldn't connect to host

    Not sure where to go next

    Thanks

    http://wordpress.org/plugins/latest-tweets-widget/

  2. timwhitlock
    Member
    Plugin Author

    Posted 1 year ago #

    unlikely to be a problem with the plugin. sounds like a network problem.

    can other scripts on your server access remote hosts?

  3. James Davies
    Member
    Posted 1 year ago #

    yes, I have a facebook plugin working ok

  4. timwhitlock
    Member
    Plugin Author

    Posted 1 year ago #

    can other scripts access https://api.twitter.com ?

  5. James Davies
    Member
    Posted 1 year ago #

    Sorry Tim, I'm just an amateur trying to build myself a smallish hobby site. I wouldn't know where to begin or how to find that out.

  6. timwhitlock
    Member
    Plugin Author

    Posted 1 year ago #

    well it still sounds like a network problem. The plugin uses WordPress's built-in HTTP methods, which in turn use PHP's cURL library, which in turn uses the local OS it's all running on.

    so the quickest way to find the problem is start at the bottom of that stack. Your computer/server - wherever the site is running.

    If you have Terminal/Command line access, try running:

    curl "https://api.twitter.com/1.1/" -i

    You should get a 400 Bad Request, which counts as connecting to the host. If that works on the same machine as your WordPress is running, then we'll have to dig deeper.

  7. timwhitlock
    Member
    Plugin Author

    Posted 1 year ago #

    closing this after two weeks with no follow up

  8. cleveridge
    Member
    Posted 1 year ago #

    I have the same issue...
    The response of curl "https://api.twitter.com/1.1/" -i command is

    HTTP/1.1 400 Bad Request
    content-length: 24
    content-type: text/plain
    date: Wed, 09 Jul 2014 09:03:43 UTC
    server: tfe
    set-cookie: guest_id=v1%3A140489662379400000; Domain=.twitter.com; Path=/; Expires=Fri, 08-Jul-2016 09:03:43 UTC
    strict-transport-security: max-age=631138519
    
    Bad Authentication data
  9. timwhitlock
    Member
    Plugin Author

    Posted 1 year ago #

    The response of your test is correct, it just shows you can "connect to the host".

  10. cleveridge
    Member
    Posted 1 year ago #

    Is there something I have to change on my server?

  11. cleveridge
    Member
    Posted 1 year ago #

    The response is correct, but it doesn't work, at all? I double checked keys, tokens and secrets. They are correct... I even have set the apps permissions to full access. But still
    0: Error -1, name lookup timed out

    This time it is name lookup time out

  12. timwhitlock
    Member
    Plugin Author

    Posted 1 year ago #

    yes the response is correct for the purpose of the test. This thread is someone reporting a "could not connect to host" problem, so the solution I gave was to see if they had network trouble - to which they didn't reply. The test above is not supposed to give an authenticated response, because it doesn't attempt to authenticate with any keys. Any response at all, with any error code at all means they CAN connect to the host in order for the host to give them an error.

    Your apparently intermittent problem - "name lookup time out" sounds like a network problem too and nothing to do with keys and secrets.

  13. cleveridge
    Member
    Posted 1 year ago #

    I pinged for the twitter api from the server and it seems it takes a long time to respond.
    I don't know if it could be a solution but... is it possible to alter the (the waiting for a) response time?

  14. timwhitlock
    Member
    Plugin Author

    Posted 1 year ago #

  15. timwhitlock
    Member
    Plugin Author

    Posted 1 year ago #

    see filter http_request_timeout

    This plugin uses WordPress's HTTP transport.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.