I try to upgrade from 4.7.3 to 6.0 beta2 and get the following error. Prior to that, I've disabled all modules except for the core.

http://clinicdev.int-prokab.com/update.php?op=start&id=2

An unrecoverable error has occurred. You can find the error message below. It is advised to copy it to the clipboard for reference.
Please continue to the error page
An HTTP error 200 occured. http://clinicdev.int-prokab.com/update.php?id=1&op=do

Going to error page, I get the following message:-

The update process was aborted prematurely while running update #1005 in system.module. All errors have been logged.

So I guess the problem was in function system_update_1005() in system.install. I try to run all the sql queries in that function by hand and everything was fine. Failing that, I try to comment all the code beginning at line 3128 to the end of the function:-

3128   foreach ($types as $type) {
   3129     $type = (object) _node_type_set_defaults($type);
   3130     node_type_save($type);
   3131   }
   3132
   3133   cache_clear_all();
   3134   system_modules();
   3135   menu_rebuild();
   3136   node_types_rebuild();
   3137
   3138   // Migrate old values for 'minimum_x_size' variables to the node_type table.
   3139   $query = db_query('SELECT type FROM {node_type}');

This time, update seem's to finish instead of halting at #1005. Later on, I found that the problem was in system_modules() function call. Commenting this line would make the uprade finish. The only almost similar error message I can got is this issue:-

http://drupal.org/node/82690

My system as follows:-
- Ubuntu 6.06 LTS
- Nginx 0.5.3
- PHP 5.1.2 running as fastcgi at port 9000
- PostgreSQL 8.1.9

As a side note, I had to increase the php memory limit to 80MB for the upgrade to get through.

Comments

psicomante’s picture

Priority: Normal » Minor

drupal 6beta is a beta! not for live production sites. The update is not perfect.

k4ml’s picture

Yeah, that's why I'm giving some hand testing it out. I didn't even mention it was on a production site. I create and drop db at least ten times to post this issue (or shouldn't I ?) ;)

gábor hojtsy’s picture

Version: 6.0-beta2 » 6.x-dev
Priority: Minor » Normal

Well, I also played with crazy things like updating from 4.6 to 6.x which is what people would call unsupported, although the update functions are there in the code. With some modifications, it is possible to make it work. I also run into this error, but I was not sure what causes it. Have you been able to identify why system_modules() is causing this error?

BTW the official information is that you should update to 5.x first and then to 6.x, but this is what inpatient people like us skip :)

k4ml’s picture

I don't understand. Even a blank function system_modules() would cause an error:-

function system_modules() {};

But the blank function if I put in system.install file would let the uprade finish. Could this be something wrong in the file itself (system.admin.inc) rather than the function ? Of course I have renamed the original function first before doing this. I test with other blank function and called it from update_1005():-

function not_exists() {};

If I put the function in system.admin.inc - failed, put in system.install - succeed.

catch’s picture

system_modules() is throwing an E_ALL error as reported here: http://drupal.org/node/190729

I think that same error may be what's breaking this update. Do you have devel module in your modules folder at all?

catch’s picture

Title: Upgrade 4.7.3 to 6.0b2 - An HTTP error 200 occured » system_modules() breaks system_update_1005
gábor hojtsy’s picture

Status: Active » Postponed (maintainer needs more info)

From k4ml's analysis, I would say that now that system_modules() is in system.admin.inc, and I guess the update system does not include system.admin.inc, this could be a simple function not defined error on the update. That results in a PHP error page with status 200. This should appear in the PHP error log.

As this call is in system_update_1005(), which runs for the 4.7 -> 5.0 update, this does not become a critical error for 6.x (we are not officially supporting updates from previous versions, except 5.x).

k4ml: Please try to use an otherwise unmodified Drupal HEAD adding a

include_once './'. drupal_get_path('module', 'system') .'/system.admin.inc';

line right before the system_modules() call, and watch if your update is fixed. From what I understand, this will probably fix the problem. (We might also get away with

include_once './modules/system/system.admin.inc';

to avoid all API problems, but drupal_get_path() is used elsewhere in system.install in updates, so this will be fine IMHO.)

k4ml’s picture

I found the problem just before reading this update. Yep, it's undefined function problem. Using php error_logs instead of browser display caught the error:-

[14-Nov-2007 21:23:46] PHP Fatal error:  Call to undefined function system_modules() in /home/kamal/project/drupal6/modules/system/system.install on line 3134

Adding:

include_once './'. drupal_get_path('module', 'system') .'/system.admin.inc';

just before the function call fixed the error. The update pass through and got some other errors but since this kind of upgrade is unsupported I will deal with it seperately. Maybe a forum post after this to share the result.

Thanks everyone :)

gábor hojtsy’s picture

Status: Postponed (maintainer needs more info) » Fixed

No, no. As soon as we find simple and straightforward fixes like this, we should ship the fixed version in Drupal 6. Since this is Drupal 6 code, we are sure where system_modules() is defined, and can include that file right away. Now committed the fix for Drupal 6 to include that include_once line.

Let me know if you open other issues for similar problems, as my understanding is that as longs as we still ship these update functions with Drupal 6, it does not hurt if they actually work (even if we do not officially support this upgrade path). So while these kinds of errors are not critical for Drupal 6, we should fix them if the fix are ready, just as it was here.

catch’s picture

Status: Fixed » Active

Well although it's not supported, would there be a particular reason not to patch the update so it works?

catch’s picture

Status: Active » Fixed

cross posted. Back to fixed.

Wichmaster25’s picture

Version: 6.x-dev » 6.0-beta2

"Yes, you have right with you quote: That Drupal 6 it is a Beta Version."

But it's better to help also, the Drupal Version it is Beta, because this is the Only way to find errors and to help the Drupal Development-Team to fixed all Errors and that the Development can be faster realease the Drupal 6 Version.

I do not know about you, but I also do not have to do this.

But I ask you such silly sayings to somelike; "Hey This is a beta!"

Because I am fed up with the snout of such silly and sick people.

Help rather in such problems as instead of silly sayings to knock.

So I have found no solution. But I have on another subject
the following solution of an user applied which has worked for me. ;)

Maybe this solution can you help :)

Here the code:

Instead of this:


// Recursively traverse the dependencies, looking for incompatible modules
   foreach ($file->info['dependencies'] as $dependency) {
    if (isset($files[$dependency]) && _system_is_incompatible($incompatible, $files, $files[$dependency])) {
      $incompatible[$file->name] = TRUE;
      return TRUE;
    }

you change in the line 537 follow


// Recursively traverse the dependencies, looking for incompatible modules
  if (!empty($group['fields'])) foreach ($group['fields'] as $field_name => $field) {
    if (isset($files[$dependency]) && _system_is_incompatible($incompatible, $files, $files[$dependency])) {
      $incompatible[$file->name] = TRUE;
      return TRUE;
    }
gábor hojtsy’s picture

Version: 6.0-beta2 » 6.x-dev
Status: Fixed » Active

Actually, we left all 4.7 updates in the code, so updating from 4.7 is not at all impossible as it stands. So we should look into fixing this bug indeed. From looking at your insight, it seems that the problem could be with the change of info file formats.

gábor hojtsy’s picture

Title: system_modules() breaks system_update_1005 » system_modules() breaks updates from 4.7.x to 6.x

Retitled.

catch’s picture

Did the include_once() not fix it then?

chx’s picture

Status: Active » Fixed
Anonymous’s picture

Status: Fixed » Closed (fixed)

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