Closed (duplicate)
Project:
Drupal for Facebook
Version:
6.x-3.x-dev
Component:
Code
Priority:
Critical
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
13 May 2010 at 21:56 UTC
Updated:
19 Apr 2012 at 10:06 UTC
Hi
I have several issues with the installation. After installing branch 2 i got an API connect 101 error. After several attempts to get this working i decided to upgrade to the most recent branch 3 build. I have removed the old DFF install completely, cleared the site caches, rebuild the database and removed the fb related tables from the database. After that i have installed a fresh copy of the latest branch 3 build, the right facebook PHP platform, and made all necessary additions to the settings file. After enabling the modules i got an error that the module cannot query the database table because it doesn't excist. It seems like the app.install does not create the tables...
Any idea?
Comments
Comment #1
fredvasse commentedWhoops , first time posting. Had this issue assigned to myself :-)
Comment #2
fredvasse commentedAfter several attempt to recreate the database tables I have prepared a clean Drupal test installation and installed the Facebook module agian. Installation now went without errors but again the API 101 error shows up. I am sure that the API key, the secret and the canvas URL are correct. I have created the Facebook test application with the script provided on the Facebook developer site and put it on the same server as Drupal. The test application works fine with the same API key.
Any idea how to get rid of this API 101 connect error?
Regards
Fred
Comment #3
Dave Cohen commentedGlad you fixed the install.
Try deleting all cookies, logging into your drupal site, but not facebook. Then save the app and see if you still get error 101.
I should warn you, in 3.x I get "Exception: 8: This method requires an HTTPS connection" every time I save an app. This does not prevent the save in drupal, but prevents drupal from automatically updating callback URL, etc for the app. So, you'll need to manually edit the app on facebook.
(It was working until last Tuesday, when facebook did something to break it.)
Comment #4
fredvasse commentedHi Dave
No Luck.
I have disabled the modules, ran update.php en re-enabled them, again running update.php after this.
I then switched to a different machine that never had connected to either Drupal nor Facebook and logged in to Drupal to create the app. No joy, again error 101?
regards
Fred
Comment #5
Dave Cohen commentedJust to confirm... this problem is with the 3.x release, right?
I just tried to reproduce the problem, but it works fine for me.
Comment #6
ashnur commentedYes, I had the problem with the 3.x , any ideas how I could debug or troubleshoot it? As I said before, read all the readmes, documentations, tried everything I found on the net. Need something new :)
Comment #7
ashnur commentedBesides the connection between my server and facebook, the correct API and Secret, on what else depends this function? I just checked like third time, and Drupal got all the necessary data from facebook after I press the Save button.
Could you please give me a hint in what file should I look for it?
Comment #8
ashnur commentedOk. I did trace back the error to it's source.
when querying api.facebook.com , the json it gives back is poorly formatted in my case.
it actually looks something like this:
I deleted the personal data from the code, broke to fit in the width , but the main problem are those double quotes on the start and the end of the returning data.
I surely can check for this, and repair it, but do not know what would be the best solution?
update #1. ok, I might be wrong about the "s, but still I do not understand why the json_decode returned NULL when I tried to add my application
and, Yes, finally I could save it, thanks.
Comment #9
giorgio79 commented+1
Comment #10
Dave Cohen commentedI don't understand the description in comment #8. You say that now you can save it?
Do you have the PHP json extension installed?
If you can trace it to where a function in modules/fb returns something incorrect, then maybe we can fix it. There's not much I can do. I can't reproduce the problem.
Comment #11
giorgio79 commented-1 The latest dev has solved this for me :)
Comment #12
ashnur commentedsry, my bad
first of all. there is nothing wrong with your module as far as I can tell.
second, I did saved the application, but after this happened, I changed back the code in the module and common.inc files (yes, I know I shouldn't edit anything there, but was a bit desperate :)
so after I restored the original files, again, when I tried to edit the facebook application node, and save it, the unable to get application properties error came back.
so I decided to go after it once for all.
here is what i found: although the json data coming back from api.facebook is correct, and when I tried in firebug, it understood and processed it very well, the json_decode from php ( i have PHP Version 5.2.0-8+etch16, json version 1.2.1), returns with null.
it has to do something with all the escaping, because if i make a stripslashes, and remove the starting and ending quotes from the string, then json_decode() will also process it without errors.
I do not know how this thing should be solved correctly, but for know I keep my hacking
and, even with my hack there are some errors, like "SSL: fatal protocol error in path/includes/common.inc on line 556" , and " Failed to set application properties on Facebook: This method requires an HTTPS connection 8", but I think these are unrelated.
Comment #13
Dave Cohen commentedPlease share how you've changed the code. Even if it is a hack, it might help for me or others to see it if they have the same problem.
" Failed to set application properties on Facebook: This method requires an HTTPS connection 8" - this is an unrelated problem on facebook's end. But when you save an app on drupal you then have to manually change settings on facebook, because of this stupid bug.
"SSL: fatal protocol error in path/includes/common.inc on line 556" - could be missing openssl module for php, maybe?
Comment #14
ashnur commentedin the fb.module file, line 256 (after "if ($http->data) {")
if(strpos($http->data,"'")===false && $http->data[0] === '"' && $http->data[strlen($http->data)-1] === '"'){
$http->data = stripslashes($http->data);
$http->data = substr($http->data,1,strlen($http->data)-2);
}
I am not sure though that it will work every time, cant figure out what proble the json_decode has with the original string.
I changed the mentioned values manually, I saw this somewhere noted, maybe in README :)
and I have
OpenSSL support enabled
OpenSSL Version OpenSSL 0.9.8c 05 Sep 2006
Comment #15
Dave Cohen commentedHave you updated the php-sdk from facebook in a little while? At some point they added this 'format' parameter and set it to 'json-strings'. I had a similar problem with fb_call_method(). (Right now there's fb_call_methodXXX which is the old way, and fb_call_method() which is newer, both in fb.module.)
Try updating both your dev copy of modules/fb and the php-sdk from facebook. Problem might go away, as it did for giorgio79.
Comment #16
ashnur commentedI have (and had) the latest version from everything. For three days in a row, every morning I started with this, and did an update right now, even if I had these versions already. Unfortunately it did not solve this problem. I will try with every new release, and update if something is changed. Thanks for your help :)
Comment #17
rei commentedI have successfully save the application with 6.x-3.x-dev Out of the box in Live/Production site.
However there is message:
On the other hand Unfortunately in my local development site (XAMPP for windows) the Save failed with error message:
In my local development site, php version:5.2.5, json version:1.2.1
In my Live site, php version: 5.2.13, json version:1.2.1
Both live and local site use the same 6.x-3.x-dev , same facebook sdk version 2.0.4, and same setting.php
Any Idea why it doesn't work on my local site?
Comment #18
Dave Cohen commentedThe error about "requires an HTTPS connection" is facebook's fault. http://drupal.org/node/803614
The "confirm both apikey and secret" is not understood. Since you have one server where that error occurs and one where it does not, we're all curious to know what the difference is. I've never reproduced the problem and don't know how to fix it. On all my systems, the application saves (but the HTTPS error is still a problem).
Comment #19
dwhutton commented+1
Comment #20
andrewc.swanson commentedI've ran into, and resolved, similar issues with the "SSL: fatal protocol error" and "Confirm both apikey and secret" errors. I am running D6 on an Apache server with PHP v5.1.6. I believe the older PHP version was the cause of some of the problems.
I was able to resolve the SSL error with the patch found in this post: http://drupal.org/node/392038.
The API error was caused by the enclosing quotes of the http response from Facebook (specifically the $http->data var used on line 332 in fb.module). I was able to resolve the problem by removing the first and last characters of the JSON string (the quotes) and running it through stripslashes() to get the exact output I need.
I'm sure there's a cleaner method to resolve this problem, but I hadn't found anything that worked.
Comment #21
Dave Cohen commentedCan you show us a patch for that json workaround? Do you have the "migration" for json arrays enabled (on facebook's form)?
Comment #22
Dave Cohen commentedSorry, just trying to consolidate threads.
#369176: Unable to get application properties. Confirm both apikey and secret.
Comment #23
cygii commentedI cannot add apps too. Here is log from Drupal
Comment #24
Dave Cohen commentedWould have been faster for you to google that error message than to post all that and wait for a reply.
http://drupal.org/node/928034
Comment #25
mayur.pimple commentedsame problem is facing :)