Fresh installation. Attempting to add a Twitter account.
Notice: Undefined property: stdClass::$data in Twitter->request() (line 280 of /var/aegir/platforms/drupal-7.10/sites/all/modules/twitter/twitter.lib.php).
PDOException: SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'twitter_uid' cannot be null: INSERT INTO {twitter_account} (twitter_uid, screen_name, name, location, description, followers_count, friends_count, statuses_count, favourites_count, url, protected, profile_image_url, profile_background_color, profile_text_color, profile_link_color, profile_sidebar_fill_color, profile_sidebar_border_color, profile_background_image_url, profile_background_tile, verified, created_at, created_time, utc_offset, password, oauth_token, oauth_token_secret, uid) VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7, :db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12, :db_insert_placeholder_13, :db_insert_placeholder_14, :db_insert_placeholder_15, :db_insert_placeholder_16, :db_insert_placeholder_17, :db_insert_placeholder_18, :db_insert_placeholder_19, :db_insert_placeholder_20, :db_insert_placeholder_21, :db_insert_placeholder_22, :db_insert_placeholder_23, :db_insert_placeholder_24, :db_insert_placeholder_25, :db_insert_placeholder_26); Array ( [:db_insert_placeholder_0] => [:db_insert_placeholder_1] => [:db_insert_placeholder_2] => [:db_insert_placeholder_3] => [:db_insert_placeholder_4] => [:db_insert_placeholder_5] => [:db_insert_placeholder_6] => [:db_insert_placeholder_7] => [:db_insert_placeholder_8] => [:db_insert_placeholder_9] => [:db_insert_placeholder_10] => [:db_insert_placeholder_11] => [:db_insert_placeholder_12] => [:db_insert_placeholder_13] => [:db_insert_placeholder_14] => [:db_insert_placeholder_15] => [:db_insert_placeholder_16] => [:db_insert_placeholder_17] => [:db_insert_placeholder_18] => [:db_insert_placeholder_19] => [:db_insert_placeholder_20] => [:db_insert_placeholder_21] => [:db_insert_placeholder_22] => 0 [:db_insert_placeholder_23] => [:db_insert_placeholder_24] => [:db_insert_placeholder_25] => [:db_insert_placeholder_26] => 1 ) in twitter_account_save() (line 56 of /var/aegir/platforms/drupal-7.10/sites/all/modules/twitter/twitter.inc).
Comment | File | Size | Author |
---|---|---|---|
#10 | twitter-1383992-10.patch | 671 bytes | Manuel Garcia |
Comments
Comment #1
troe-lcog CreditAttribution: troe-lcog commentedSame issue. Subscribed.
Comment #2
steinmb CreditAttribution: steinmb commentedHi. Are you getting this with or without OAuth?
Comment #3
Anonymous (not verified) CreditAttribution: Anonymous commentedTwitter.module only. No Oauth.
Comment #4
steinmb CreditAttribution: steinmb commentedThanx. Another thing, could you also have a look in your Drupal log for related error messages when you try to add an Twitter account?
Comment #5
Anonymous (not verified) CreditAttribution: Anonymous commentedHere is the error that shows up in syslog in addition to the other two that show up in the error box above.
Jan 10 21:10:02 19264 drupal: http://d7.example.com|1326251370|twitter|127.0.0.1|http://d7.example.com/user/1/edit/twitter|http://d7.example.com/user/1/edit/twitter|1||exception 'TwitterException' with message 'Connection timed out' in /var/aegir/platforms/drupal-7.10/sites/all/modules/twitter/twitter.lib.php:284 Stack trace: #0 /var/aegir/platforms/drupal-7.10/sites/all/modules/twitter/twitter.lib.php(227): Twitter->request('http://api.twit...', Array, 'GET') #1 /var/aegir/platforms/drupal-7.10/sites/all/modules/twitter/twitter.lib.php(199): Twitter->call('users/show', Array, 'GET', false) #2 /var/aegir/platforms/drupal-7.10/sites/all/modules/twitter/twitter.pages.inc(313): Twitter->users_show('VMdoh', false) #3 /var/aegir/platforms/drupal-7.10/includes/form.inc(1430): twitter_account_form_submit(Array, Array) #4 /var/aegir/platforms/drupal-7.10/includes/form.inc(844): form_execute_handlers('submit', Array, Array) #5 /var/aegir/platforms/drupal-7.10/includes
I'm starting to think it's on my end in my case.
EDIT: Well, I thought that, but I'm not sure. It works on one server, but not on another, which is what leads me to think it may be on my end with the connection timing out.
-BUT-
Doing a bootstrap with a drupal_http_request() by itself works for everything except twitter.com.
Comment #6
Anonymous (not verified) CreditAttribution: Anonymous commentedJust got a notification from the VPS provider that it is a routing issue upstream from them (which I've now confirmed with traceroute). Sorry about that - just made an assumption.
troe-lcog: You might check with your provider and see if they are having the same issue.
Comment #7
steinmb CreditAttribution: steinmb commentedAh. Glad to hear you where able to find the problem. On the other hand this module should not throw PDO exceptions due to network problems, but I'm afraid that could be a part of a more general discussion. Prob. also related to #1358308: Use OAuth to pull tweets if the account is authenticated and other.
Comment #8
troe-lcog CreditAttribution: troe-lcog commentedThanks for pointing me in the right direction, Brian. It was our host blocking the call.
Comment #9
peterpolman CreditAttribution: peterpolman commentedHi guys!
I got in touch with my hostingprovider about this problem and they ask me to what host, ip or through wich port the module wants to connect. Then they can check if the connection is is being blocked by their routers or that twitter blocks them out.
I found this array in de twitter.lib.php file TwitterConf class:
private $attributes = array(
'host' => 'twitter.com',
'api' => 'api.twitter.com',
'search' => 'search.twitter.com',
'tiny_url' => 'tinyurl.com',
);
Is it api.twitter.com that is blocked by hostingproviders routers? Because that one also pops up in the Drupal error logs.
Comment #10
Manuel Garcia CreditAttribution: Manuel Garcia commentedI just print_r'ed the response object in the twitter lib file (here at drupaldevdays barcelona), and here it is:
As you can see, our network's IP has ran out of x-ratelimit-remaining.... so we dont get data back.
So we did some backtracing, find attached the patch that prevents the module from trying to save an empty account.
Comment #11
Manuel Garcia CreditAttribution: Manuel Garcia commentedComment #12
juampynr CreditAttribution: juampynr commentedThanks everyone who helped debugging this.
I have fixed the way we handle errors returned by the Twitter API and after my testing there are no more Integrity Errors and instead the user sees an alert stating what happened.
http://drupalcode.org/project/twitter.git/commitdiff/211ef36
Comment #14
xurizaemonFound a couple of issues which stemmed from 211ef36.
* Exception handling was not PHP5.2-compatible, and a fix for this is in #1814642: Invalid handling of exceptions causes fatal errors on PHP5.2.
* In event of Twitter returning a 401 unauthorised, Twitter::parse_response() returned string $data, causing a fatal error when attempting to use $data['errors'][0]['message'].
These will be fixed as part of #1814642: Invalid handling of exceptions causes fatal errors on PHP5.2.