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

fredvasse’s picture

Whoops , first time posting. Had this issue assigned to myself :-)

fredvasse’s picture

Assigned: fredvasse » Unassigned

After 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

Dave Cohen’s picture

Title: Several issues with installation » Can't save application on drupal

Glad 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.)

fredvasse’s picture

Hi 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

Dave Cohen’s picture

Just to confirm... this problem is with the 3.x release, right?

I just tried to reproduce the problem, but it works fine for me.

ashnur’s picture

Yes, 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 :)

ashnur’s picture

Besides 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?

ashnur’s picture

Ok. 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:

"{\"about_url\":\"\",\"application_name\":\"XXX\",\"edit_url\":\"\",\"authorize_url\":\"XXXX\\\/authorize\",\"uninstall_url\":\"XXXX\\\/remove\",
\"canvas_name\":\"XXXX\",\"callback_url\":\"XXXX\",\"connect_url\":\"\"}"

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.

giorgio79’s picture

+1

Dave Cohen’s picture

I 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.

giorgio79’s picture

-1 The latest dev has solved this for me :)

ashnur’s picture

sry, 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.

Dave Cohen’s picture

Please 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?

ashnur’s picture

in 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

Dave Cohen’s picture

Have 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.

ashnur’s picture

I 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 :)

rei’s picture

I have successfully save the application with 6.x-3.x-dev Out of the box in Live/Production site.
However there is message:

    * Failed to set the following properties for xxxx application. You may need to manually editing remote settings!
      Array
      (
          [uninstall_url] => http://xxx/fb_app/event/post_remove
          [authorize_url] => http://xxx/fb_app/event/post_authorize
          [callback_url] => http://xxx/fb_cb/dfbtestapp/
          [connect_url] => http://xxx/
      )
    * Failed to set application properties on Facebook: This method requires an HTTPS connection 8
      Exception: 8: This method requires an HTTPS connection

On the other hand Unfortunately in my local development site (XAMPP for windows) the Save failed with error message:

Unable to get application properties. Confirm both apikey and secret.

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?

Dave Cohen’s picture

The 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).

dwhutton’s picture

+1

andrewc.swanson’s picture

I'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.

Dave Cohen’s picture

Can you show us a patch for that json workaround? Do you have the "migration" for json arrays enabled (on facebook's form)?

Dave Cohen’s picture

Status: Active » Closed (duplicate)
cygii’s picture

I cannot add apps too. Here is log from Drupal

    * Failed to get application properties (CVPL) from Facebook: fb_call_method failed calling admin.getAppProperties. Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? 557743920

      Exception: 557743920: fb_call_method failed calling admin.getAppProperties.  Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?

    * Unable to get application properties. Possibly, you've given the wrong apikey or secret. Possibly, this server is unable to reach facebook's servers. Your application will not work properly!
    * Failed to get application properties (CVPL) from Facebook: fb_call_method failed calling admin.getAppProperties. Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? 557736224

      Exception: 557736224: fb_call_method failed calling admin.getAppProperties.  Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?

    * Failed to set the following properties for CVPL application. You may need to manually editing remote settings!

      Array
      (
          [uninstall_url] => http://www.example.com/fb_app/event/CVPL/post_remove/
          [authorize_url] => http://www.examplel/fb_app/event/CVPL/post_authorize/
          [callback_url] => http://www.example/fb_cb/69db5a1274909fcc02beab4ccee0184b/
          [connect_url] => http://www.example/
          [tab_default_name] => TAB
          [profile_tab_url] => fb_tab/view
      )

    * Failed to set application properties on Facebook: fb_call_method failed calling admin.setAppProperties. Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? 557736304

      Exception: 557736304: fb_call_method failed calling admin.setAppProperties.  Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP?

Dave Cohen’s picture

Component: Miscellaneous » User is lazy

Would 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

mayur.pimple’s picture

Component: User is lazy » Code

same problem is facing :)