Hello,

I just upgraded my drupal for facebook module from a dev version from about a week ago to beta2. Now, when I visit the app:

http://apps.facebook.com/menashapl/

I get this error on the screen:

The URL http://www.menashalibrary.org/fb_cb/11722/ returned HTTP code 200 and no data.
Please try again later. We appreciate your patience as the developers of Menasha Public Library and Facebook resolve this issue. Thanks!

I looked over the readme file before upgrading, double checked all my permissions, and edited the application page in drupal. Double checked all settings and saved.

Any ideas what I may have done wrong?

- jody

Comments

Dave Cohen’s picture

Enable fb devel module, reproduce problem, check logs (both watchdog and apache error logs). Let me know if you see anything.

georgedamonkey’s picture

As soon as I enabled the fb devel module, I got this error on the top of the screen:

Facebook client libraries will not work properly if arg_separator.output is not "&". Currently the value is "&". Please change this in settings.php or php.ini.

Does this have anything to do with this part of the readme file?

The Facebook client libraries has bugs if you do not have the JSON
extension for PHP installed, see
http://us.php.net/manual/en/json.requirements.php.

georgedamonkey’s picture

And, I'm not sure if this is related or not... but now, I can no longer select the fb_fbml theme for blocks. If I click on it to select it, it changes the tab to show I'm on that one, but it still looks like the default theme. Very strange. So, when I add the fb devel block to the fb_fbml theme, it actually adds it to the default theme.

georgedamonkey’s picture

I fixed that error by changing this line:
ini_set('arg_separator.output', '&');

to this line:
ini_set('arg_separator.output', '&');

So, I was able to enable blocks ok on the fb_fbml theme. But, even with the block enabled, I'm just getting that error at the facebook app url. no blocks displayed.

The only watchdog errors I'm getting is this:
array_search() [<a href='function.array-search'>function.array-search</a>]: Wrong datatype for second argument in /var/clients/client0/web2/web/sites/all/modules/jquery_update/jquery_update.module on line 34.

Dave Cohen’s picture

Try going to your facebook app node and saving it again. Probably the URL is http://www.menashalibrary.org/node/11722/edit. Just hit submit even if you make no changes.

georgedamonkey’s picture

I tried that, but it didn't make any difference. I started looking over the settings in the facebook app, and I found out what the problem is... sort of.

If I change the Render Method to IFrame vs FBML, then the app displays just fine.

I updated the fb_fbml theme at the same time I updated the module.

Thanks for taking the time to help me with this, I really appreciate it.

Dave Cohen’s picture

Status: Active » Fixed

so fixed? Is iframe what you wanted?

If not, might simply be that the fb_fbml theme is not enabled?

georgedamonkey’s picture

I'd prefer to use the fb_fbml theme. I double checked, and it is enabled. But using that way, I get that error message.

Dave Cohen’s picture

Hmmm... possibly, the jquery_update.module error is happening before theme_init(). If so, the fb_fbml theme would never be initialized. I don't have that module or know what causes that error. But if you fix the error, canvas pages might work. What function is in that module, line 34?

georgedamonkey’s picture

Here's lines 25-40:

/**
 * Implementation of hook_theme_registry_alter().
 *
 * Make jQuery Update's page preprocess function run *after* everything else's,
 * so that a theme can't call drupal_get_js() and mess everything up.
 */
function jquery_update_theme_registry_alter(&$theme_registry) {
  if (isset($theme_registry['page'])) {
    // If jquery_update's preprocess function is there already, remove it.
    if ($key = array_search('jquery_update_preprocess_page', $theme_registry['page']['preprocess functions'])) {
      unset($theme_registry['page']['preprocess functions'][$key]);
    }
    // Now tack it on at the end so it runs after everything else.
    $theme_registry['page']['preprocess functions'][] = 'jquery_update_preprocess_page';
  } 
}

And, line 34 specifically:

    if ($key = array_search('jquery_update_preprocess_page', $theme_registry['page']['preprocess functions'])) {

I also noticed that error pop up on every page after the upgrade.

Dave Cohen’s picture

So I really don't think this is related to the upgrade. I predict if you disable jquery_update module, the fb_fbml theme will work as expected.

Or change that code to have no errors/warnings.

georgedamonkey’s picture

Unfortunately, I need that module for a few others... I'll have to look into what to do to fix that.

Thank you for taking the time to help me with this. I really appreciate it!

Dave Cohen’s picture

If you disable it just temporarily or on a devel copy of the site, I'd be curious if it solves the problem. Until I hear a way to reproduce, I'm leaving this issue "fixed".

georgedamonkey’s picture

I just removed and uninstalled the jquery_update module and also the module that required it. I still get the same code 200 error message when I tell facebook to render with FBML.

Dave Cohen’s picture

Status: Fixed » Active

Can you check your logs? I'm curious what the apache access log says for the request returning no data.

Also is there anything in your apache or PHP error logs? I'm really not sure what's wrong.

georgedamonkey’s picture

Status: Active » Fixed

Thanks again for taking the time to help me with this.

In drupal, I'm not seeing any errors. In my apache logs, the last error was from 3 days ago, and didn't notice anything for facebook.

If I refresh the app, and view the log file immediately afterwards, the only line with the right timestamp is this:

69.63.180.246 - - [05/Feb/2010:11:59:25 -0600] "POST /fb_cb/26/ HTTP/1.1" 200 - "-" "Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_2; en-us) AppleWebKit/531.21.8 (KHTML, like Gecko) Version/4.0.4 Safari/531.21.10"

I'm stumped...

Dave Cohen’s picture

Huh, you're log looks different from mine. I don't see all the browser ID information. You see that with the app set to FBML and not iframe? Weird that the request appears to come from both mozilla and safari at the same time.

The code 200 and no data is essentially the "white screen of death" but returned to facebook and not your browser. Those are usually caused by PHP fatal errors. Sometimes it's tricky to get PHP to report its errors. Do you have access to php.ini and can you make it more verbose? I don't know exactly what settings to tweak but google can probably tell you.

georgedamonkey’s picture

I made sure logging was on, and set it to go into it's own error log. All I get is this:

cat php_error.log
[05-Feb-2010 13:06:32] PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20060613/mod_ldap.so' - /usr/lib/php5/20060613/mod_ldap.so: cannot open shared object file: No such file or directory in Unknown on line 0
[05-Feb-2010 13:06:32] PHP Warning:  Module 'imagick' already loaded in Unknown on line 0
[05-Feb-2010 13:06:32] PHP Warning:  Module 'mcrypt' already loaded in Unknown on line 0
[05-Feb-2010 13:06:32] PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20060613/pdo_sqlite.so' - /usr/lib/php5/20060613/pdo_sqlite.so: cannot open shared object file: No such file or directory in Unknown on line 0
[05-Feb-2010 13:06:32] PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/lib/php5/20060613/sqlite.so' - /usr/lib/php5/20060613/sqlite.so: cannot open shared object file: No such file or directory in Unknown on line 0

But, I wouldn't think any of those have to do with the drupal module?

georgedamonkey’s picture

Do you know of any other fbml enabled themes? Maybe I could try one in case it's an issue with the theme?

arinba’s picture

Category: support » bug
Status: Fixed » Active

Hi Dave
I have recently installed the latest DFF modules ( core modules enabled , not contrib or optional)
followed all instructions in README.txt
and I have noticed that when I'm using FBML render option in application settings I can get only the frontpage. clicking on any specific post, or getting post by URL apps.facebook.com/myfbapp/node/2
will get the "returned HTTP code 200 and no data"
No errors written to APACHE log
and the most wierd - when I'm setting the devel info/2 block on the canvas footer area of the FB_FBML theme - the problem disappear , and I can get the specific post whether I click on it or by URL.

The problem dose not exists if the render option in application setting is set to Iframe. !!
for now I have no choice but to use the I frame but this is not a good solution as the FBML render method gives the look and feel of facebook
I know that these kinds of bugs are pain in the ... cause opening sort of "debug" mode information cause this problem to disappear

Thanks
Arin

Dave Cohen’s picture

The no data error is essentially the "white screen of death" but returned via facebook. I think nine times out of ten, PHP will give you the reason why, if you have proper error logging enabled, and know where to look for the error.

Check your apache access log to make sure facebook is actually pinging your server. And check php error log for further clues.

arinba’s picture

Hi Dave
thanks for dropping by. I have checked the access log and there is a ping:
69.63.186.246 - - [21/Feb/2010:20:02:43 +0200] "POST /fb_cb/5/node/4 HTTP/1.1" 200 -

however nothing from the php error log. ( I have set log_error = On and error_log = and error_reporting = E_ALL )
I do want to use the FMBL instead of of the iframe however I just can't, what am i doing wrong ?

Thanks for your help

Arin

Dave Cohen’s picture

I really don't know. Sounds very strange that things work when a certain block is enabled, and otherwise they fail. Without an error message I have no idea. Please let us know if you solve it or get more info.

arinba’s picture

Hi David
I have installed the new beta-3 version and noticed the following pattern:
when using the URL http://apps.facebook.com//
(only one "parameter" after the application name) things are ok - so I can reach the contact page, the user login page, any other custom page with no trailing arguments in the url etc
however if the URL include additional URL such as http://apps.facebook.com//user/password or http://apps.facebook.com//node/3 I get the above "200 code and no data" error.
I hope that give us a clue
I will happily pm you the url if you want
and I'm willing to do every step to further investigate that phantom bug

Thanks
Arin

Dave Cohen’s picture

Please submit a new issue when your question has nothing to do with the current thread.

That said, when you want to support canvas pages you need to create a canvas URL on the facebook application form (the one on facebook.com).

arinba’s picture

Hi Dave
Thanks for the prompt reply.
I will try to explain my self. the last post was not a new issue - it is the same old error that I still get (blank page). I just wanted to say that I recognize a pattern that might help in pinpointing it.
the pattern is quite simple - any URL that have more then one element after application name (equivalent to second drupal argument, like "node/2" for instance) will cause that problem, while URL with only one argument after the appname e.g. "node" or "page1" will display OK.
Please let me know if you want me to send you the actual URL so you can see for yourself

Thanks

Arin

felixbachman’s picture

Version: 6.x-2.0-beta2 » 6.x-2.0-beta4
StatusFileSize
new2.54 KB

Hi Dave,
I don't know if the original issue was ever resolved. In any case I have exactly the same issue (HTTP code 200 and no data).
It is a fresh installation, no upgrade. When canvas is set to iframe the page is displayed, when setting to FBML I get the error.
I changed my index.php file to log exactly what comes in and what gets out. The right parameters come in and it looks to me the correct output is produced and sent to the server. Log file attached.
Any suggestion welcome.

felixbachman’s picture

StatusFileSize
new10.47 KB

Some more information ...
I enabled the Facebook Devel Info block to be displayed in the canvas footer. By doing so the page is displayed correctly now.
The output produced is different now (see attached file). Try to hunting this down further ...

georgedamonkey’s picture

I've continued to have this issue, so I thought I'd try enabling the Facebook Devel Info block in the canvas footer. Unfortunately for me, I still get the code 200...

Dave Cohen’s picture

I find this problem and WSOD rarely occur without a log message being written somewhere. Configure your PHP to report more errors, look in php and apache error logs, etc.

felixbachman’s picture

Well Dave,
php and apache error log have no entry. Drupal's watchdog has no entry. Apache's access log shows three consecutive POSTs from facebook.
As you can see from the printout I attached, output IS produced. I assume that something in this output might be wrong so that fb interprets this as empty. I am using the standard fb_fbml theme. Nothing altered.

felixbachman’s picture

georgedamonkey,
would you mind changing for index.php file on a test installation to write input and output into a log file? I could then compare your log with mine and see if we both have the same problem or not. Here is the index.php file I use:

<?php
// $Id: index.php,v 1.94 2007/12/26 08:46:48 dries Exp $

/**
 * @file
 * The PHP page that serves all page requests on a Drupal installation.
 *
 * The routines here dispatch control to the appropriate handler, which then
 * prints the appropriate page.
 *
 * All Drupal code is released under the GNU General Public License.
 * See COPYRIGHT.txt and LICENSE.txt.
 */

require_once './includes/bootstrap.inc';
$fh = fopen('test.log', 'a');
$out = "GET:\n" . print_r($_GET, TRUE);
$out .= "POST:\n" . print_r($_POST, TRUE);
fwrite($fh, $out);
drupal_bootstrap(DRUPAL_BOOTSTRAP_FULL);

$return = menu_execute_active_handler();

// Menu status constants are integers; page content is a string.
if (is_int($return)) {
  switch ($return) {
    case MENU_NOT_FOUND:
      drupal_not_found();
      break;
    case MENU_ACCESS_DENIED:
      drupal_access_denied();
      break;
    case MENU_SITE_OFFLINE:
      drupal_site_offline();
      break;
  }
}
elseif (isset($return)) {
  // Print any value (including an empty string) except NULL or undefined:
  $out = theme('page', $return);
fwrite($fh, $out);
  print $out;
}

drupal_page_footer();
fclose($fh);

Make sure the root directory of your installation is writable by the web server. This creates a file test.log in the root directory in which you can see the GET and POST variables and the output produced by the theme.

Dave Cohen’s picture

Well, those two logs you've generated indicate that drupal is in fact returning something, in both cases. But facebook claims its not receiving. Maybe try wireshark or something like that to really see what's going on. Maybe add flush() to the very end of index.php.

georgedamonkey’s picture

StatusFileSize
new24.9 KB

I added that in, loaded the facebook app. Then, I added flush(); to the end of the file per Dave's suggestion and loaded the app again. I've attached the output of the log file.

arinba’s picture

Hi Guys
I have tried to revert to the normal setting of arg separator in the setting.php
and now I don't have the "200 code and no data" on the fbml
I currently have the beta-3 installed

ini_set('arg_separator.output', '&');

georgedamonkey, let me know what is the setup at your site and if it is only '&' try to revert it back to the default and see if the problem still exist

Best Regards

Arin

georgedamonkey’s picture

I checked, and i had this in settings.php:

ini_set('arg_separator.output', '&');

I tried changing it back to:

ini_set('arg_separator.output', '&amp;');

Cleared the cache, reloaded the app, still get the 200 code error.

Dave Cohen’s picture

StatusFileSize
new815 bytes

I may have found it... I'm not sure how this happened or how long it's been the case...

There's a mismatch in fb_canvas.module where ob_buffer is started and ended. See if this patch fixes...

felixbachman’s picture

Yeah! Worked!
Many thanks Dave.

georgedamonkey’s picture

Outstanding my friend!! Worked perfectly!!

Do you by any chance have a wishlist on amazon?

arinba’s picture

Component: Canvas Pages » Code

Hi Dave
When are you planning to integrate the fix to the main branch ?

Arin
Algoma LTD
http://algoma.info

Dave Cohen’s picture

Status: Active » Fixed

I didn't check in that fix exactly, but some code that accomplishes the same thing. this should not be an issue with the latest beta. Is it?

also I couldn't close this out until I found my amazon wish list! http://amzn.com/w/2USVELZVDSYQS

;)

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.