error

APC on OS-X: PHP Fatal error: Unknown: apc_fcntl_unlock failed

APC 3.1.9 has a nasty bug, causing a frustrating error: "PHP Fatal error: Unknown: apc_fcntl_unlock failed: in Unknown on line 0" to appear when installed with PECL on Mac OS-X (and reportedly on a variety of Linux platforms).

There's an easy fix.

Recovering from: "std::exception: old lock file, terminating" on a MongoDB server.

If a server running MongoDB crashed or MongoDB did not get to shut down cleanly for some other reason, you may not be able to start Mongo again, getting "exception in initAndListen std::exception: old lock file, terminating" error in Mongo error log. Fix is actually pretty easy, you just need to locate mongod.lock file and remove it. On a Debian server installed from the mongodb-10gen repository it is usually located at: /var/lib/mongodb/mongod.lock.

If it is not there in your installation, check the "dbpath" configuration variable in mongodb.conf file (typically: /etc/mongodb.conf). Lock file should be under the folder indicated by dbpath.

Drupal: Fatal error: Unsupported operand types in

If you have misfortune of having to upgrade Drupal5 website to Drupal6, there's a very good chance that at some point you will run into a fatal error:

Fatal error: Unsupported operand types in...

Fatal errors are never fun, but this one is particularly annoying and hard to hunt down. It helps to understand the cause of the problem, thought. Basically, the main problem is that Drupal url() and l() functions have changed their signatures in a major way. Function operands that used to be literals are supposed to be an array now.

Solution

You need to hunt-down all url() and l() functions and change their signature to Drupal6-compliant format. The functions can be used (and causing problem from) multiple locations: a tpl.php file, a module file or a code in a block in the database! This last one is particularly troublesome to hunt down and can cause the most problem. We suggest disabling all blocks for the time of upgrade by running:

UPDATE blocks set status=0

Also, to find which function causes the problem. open includes/common.inc and at the begining of url() and l() function definitions paste following code:

    if (!is_array($options)) {
      echo "<pre>";
      $backtrace = debug_backtrace();
      var_export($backtrace);
      exit();
    }

Typically first function call in the backtrace is the offender function.

Syndicate content