I do think some of this will be addressed by this issue - http://drupal.org/node/304163 - which has been committed. It will help if the rewrite is done with a check to verify that the $base_url is what it should be, however, it still doesn't really solve the problem I ran into.

In a normal process of launching a Drupal site, you set up a sub-domain, and have something like this in your settings.php file:
$base_url = 'http://www3.example.com'; // NO trailing slash!

When you go to launch the site you redirect everything in Apache to http://example.com using Apache's rewriteEngine module. You don't want to eliminate the references to http://www3.example.com right away because of DNS propagation.

In anycase, if the $base_url isn't set to http://example.com and you go to http://example.com/update.php you should get a warning message. If you aren't using the same url you won't be able to successfully update your site because when the update_batch() function is refers to the $base_url, and the user wasn't logged in with this url then the batch_process function is sent the wrong data:

 batch_process($base_url . '/update.php?op=results', $base_url . '/update.php');

Not sure where the right place to put a warning in would be from a usability perspective. I also know that this isn't a common problem. I've been upgrading Drupal sites now for almost 4 years and I don't ever remember seeing this problem before. It was an annoying one to track down though as it didn't produce any error messages in the logs (watchdog or apache) and never finished or timed out due to the AJAX.

Because AJAX is hard to debug, it's good to do all we can to eliminate these problems.

Mike

Comments

crifi’s picture

Component: update system » ajax system
Status: Active » Closed (duplicate)

This problem is caused by a wrong configuration of $base_url and should be prevented by inserting a warning message to the requirements system. Therefore I created a new issue and this is now a duplicate of #1046682: Install/Update process fails if $base_url is set to a wrong URL. Please reopen if I'm wrong. Thanks!