Wednesday, November 21, 2012

Today I'm upgrading Drupal 7.11 to 7.17 on the Ubuntu-Bitnami platform. I've run into some issues that took a great deal of Googling to get resolved, so I'm going to document the problems and fixes here in the hopes that it will help someone else.

The following problems were present before upgrading and are what prompted me to try an upgrade as a fix:

Problem #1: Cron stopped working

http://.../admin/reports/status/run-cron

HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request

http://.../cron.php?cron_key=...

HTTP Error 500 (Internal Server Error): An unexpected condition was encountered while the server was attempting to fulfill the request

Solution: Currently unresolved.

Problem #2: Autocomplete stopped working; breaks on article "tags" and on Quotes module authors (only two places I've seen it used on our site).

An AJAX HTTP error occurred.HTTP Result Code: 500Debugging information follows.Path: http://.../taxonomy/autocomplete/field_tagsStatusText: Internal Server ErrorResponseText: {"...":"...","...":"..."}

An AJAX HTTP error occurred.HTTP Result Code: 500Debugging information follows.Path: http://.../quotes/autocomplete/authorStatusText: Internal Server ErrorResponseText: {"...":"..."}

Solution: Currently unresolved.

Problem #3: Automatically checking for updates stopped happening

There was a problem checking available updates for Drupal. See the available updates page for more information and to install your missing updates.

Solution: Successfully upgrading fixed this.

Problem #4: Installing modules stopped working

Initially I was getting an AJAX HTTP error as above while the progress bar was going (same as here), but after successfully upgrading I get this now instead:

Error message Installation failed! See the log below for more information. ... Error installing / updating File Transfer failed, reason: Cannot create directory /opt/bitnami/apps/drupal/htdocs/sites/all/modules/...

and in /admin/reports/dblog

Warning: ftp_mkdir(): Create directory operation failed. in FileTransferFTPExtension->createDirectoryJailed() (line 71 of /opt/bitnami/apps/drupal/htdocs/includes/filetransfer/ftp.inc).

Note: The directory it complained it couldn't create would exist after this error, but the archive was always incompletely extracted

Solution: Only workaround I've found so far is to SSH to host, change to the drupal/htdocs/sites/all/modules/ directory, wget the .tar.gz file, and extract it myself.

At this point I tried doing an upgrade per the directions here and ran into this error, which persisted even after my other upgrade attempt to a local VM, and remains unresolved:

Problem #5: PHP fatal error

Looking at my Apache error logs regarding #4, I noticed this:

[Wed Nov 21 19:02:53.032382 2012] [:error] [pid 3614] [client 10.1.4.181:52711] PHP Fatal error: Call to undefined function tablesort_sql() in /opt/bitnami/apps/drupal/htdocs/modules/php/php.module(80) : eval()'d code on line 10

Solution: Currently unresolved.

This upgrade did not resolve any of the errors above except for cron, which seemed to start running automatically (the built in "poor man's cron") but still refuses to run manually.

At this point I tried grabbing the VMWare VM of Bitnami Drupal (with these directions), but hit a snag when importing my database:

Problem #6: MySQL chokes importing database

I didn't have this problem moving from one AWS EC2 instance to another (newer) one. However, when I imported the bitnami-drupal VM into ESXi to run it locally (thinking maybe I was having memory issues or something, being on a Micro instance on Amazon), I was unable to import the database thusly:

#2006 - MySQL server has gone away

Solution: Found here, was to find the my.cnf file (/opt/bitnami/mysql/my.cnf for me) and add max_allowed_packet=500M (value of your choosing; I saw 16M and 100M mentioned also) under the mysqld section. Then I restarted mysql (/opt/bitnami/ctlscript.sh restart, logged in (mysql -u bitnami -p using the password in the /opt/bitnami/apps/drupal/conf/drupal.conf file), dropped the database (drop bitnami_drupal7;) and recreated it (create database bitnami_drupal7;) then did my import again.



Problem #yyy: Calendar month view broke

My calendar's month view spewed a bunch of these above the calendar:

Warning: Illegal string offset 'data' in template_preprocess_calendar_month() (line 38 of /opt/bitnami/apps/drupal/htdocs/sites/all/modules/calendar/theme/theme.inc). Warning: Illegal string offset 'data' in template_preprocess_calendar_month() (line 43 of /opt/bitnami/apps/drupal/htdocs/sites/all/modules/calendar/theme/theme.inc).

Solution: http://drupal.org/node/1471400#comment-6760506 #4 fixed me right up. Basically add:
if(!is_array($data)) continue;
before
$cell = $data['data'];