Hi,

I think I'm missing something quite obvious, for I can't find any instructions anywhere... When the background_process module installs, and after clicking the 'determine...' button, I get an error message asking me to configure the default service host in settings.php. Sure, but how?

I am in a multi-site setup and the settings show OK (I get the above mentioned error but am allowed to save.) I don't get any scary watchdog entries and the process overview regularly shows background tasks. But all batch API ops fail. They hang in their 'init' state.

Would very much appreciate any pointers on configuring the default host in settings.php. Thanks in advance!

Comments

gielfeldt’s picture

Hi

It's not necessary obvious, as my documentation perhaps could be a bit better.

When the "determine..." button fails, it's because Background Process is unable to make an http request to the Drupal installation. This can occur if the webserver is not listening at 127.0.0.1 or if the hostname for the site cannot be resolved locally. It can also happen if the webserver is behind a reverse proxy or http accelerator and the base_url contains e.g. a port number which the webserver doesn't listen on.

To configure manually, determine which port and number the webserver listens on, and what the vhost is (and if it's ssl and/or using basic auth). When this has been determined, you can configure background process like this in settings.php:

<?php
$conf['background_process_service_hosts'] = array(
  'default' => array(
    'base_url' => 'https://user:pass@192.168.1.10:1234',
    'http_host' => 'www.example.com',
  )
);
?>

You may also want to upgrade background process to the latest dev version, as there are some known bugs in the latest release.

I have a couple of questions, if the above does not help/make any sense

1.) Are you using Apache? (on which platform, linux/windows/etc.)
2.) Are you using multiple servers?

EDIT: Added auth in example above

AlfTheCat’s picture

Hi Gielfeldt,

Thank you for your reply and I've seldom seen projects this well documented, including the issue queue! I had noticed the several fixes in the latest dev and I'm using that branche.

I think I have the a maximum of complicating factors readily in place; I use multiple servers in an Aegir setup (where a master server syncs to a slave server, and I use Cloudflare for a reverse proxy. My OS is linux debian, lenny. On my to-do list is the addition of Varnish.

I'll dig in tomorrow to see what ports are being listened to. I've tried adding an array of hostnames but that produced errors. With your guidance I can now try again and see where I end up!

gielfeldt’s picture

Hi

Did you find the problem?

gielfeldt’s picture

Status: Active » Postponed (maintainer needs more info)
dkre’s picture

This is extremely valuable info.

For anyone who is seeing:
Notice: Trying to get property of non-object in progress_estimate_completion() (line 212 of ../all/modules/progress/progress.module).

On the Batch > Overview page it is probably due to Background Process failing to connect with your server and adding the above settings to setting.php should hopefully resolve the issue.

In my case the directory/site was password protected.

Great module!