The various jobs (19 of them) seem to start as soon as the module is installed. But the value in the "Starting" column is permanently set to "Starting", the Duration never changes from "N/A", the Status icon never changes from "running", and no messages are ever created in any of the Log pages.
This happens both with and without the Poormans option. By preference, I have a server crontab hitting cron.php every 5 minutes - successfully (HTTP status 200).
I also have Background Process with the correct service-host information, and I have Background Process Apache Server Status enabled.
Under what conditions would you expect Ultimate Cron to start jobs but never make any progress with them? Thanks!
Comments
Comment #1
gielfeldt commentedWhen Ultimate Cron starts a cron job, it executes this via Background Process by doing an http request using the service host information declared in the the background_process_service_hosts.
Assuming a single server setup:
In a single server setup, you will usually experience what you are describing in these situations:
Troubleshooting:
if #1 is resolved and webserver is only listening on int-ip, then this could be a solution:
Comment #2
beanluc commentedThanks for this, none of that is any surprise.
My crontab:
Consider:
Crontab's running, HTTP requests are working.
Comment #3
gielfeldt commentedOk. Did you include username/password in your $conf['background_process_service_hosts']? Could you post it? Of course change sensitve data to * or similar if necessary.
Comment #4
beanluc commentedI don't have that set in settings.php, but, it's set on the background process settings page - it's visible when I look at the default service host there.
Comment #5
gielfeldt commentedBackground Process issues a POST request for executing a job, e.g.
Do you have any entries in your apache log for these requests?
In the latest release of Background Process I use a ':' in the URL which might not work on some systems, as it is not RFC-compliant. This is fixed in the dev version of Background Process. Could you try updating Background Process to the dev version?
Comment #6
beanluc commentedI have a lot of lines like that (they appear URL-escaped in the log), they all return with HTTP status 200. Should I still try the dev version?
Comment #7
gielfeldt commentedHmmm .... You could try the dev version just in case, though i'm not sure that will solve the problem. Do you have any log entries in your watchdog from ultimate_cron or bg_process?
Comment #8
beanluc commentedOnly the entries about installing the modules!
Comment #9
gielfeldt commentedAre you using clean urls?
Comment #10
PatchRanger commentedRecently I also got in trouble with this.
The solution was simple in my case : just click on "Determine default service host" on admin/config/system/background-process page (even if everything looks fine) and flush your caches.
In my case I've noticed that port changed.
I think the problem (in my case) was related to port.
Hope it helped.
Comment #11
gielfeldt commentedComment #12
d3vo commentedI am having this issue also. I would really like to get Ultimate Cron to work. I know my cron tabs are working every minute but the cron doesn't seam to be running. After about 12 hrs I have a few jobs with the status N/A and they say starting.
Comment #13
gielfeldt commentedIf you're not already using the dev versions of Ultimate Cron and Background Process, please upgrade to these first.
One thing to note, is that if you're using the latest release of Background Process and also running the Drupal installation on multiple environments you might experience this when you're migrating the database. This particular issue is fixed in the dev version for the cases where $conf['background_process_service_hosts']['default'] is NOT configured manually in the settings.php file.
It could also be Ultimate Cron "simultaneous connections" setting that is too high for the webserver, and therefore the webserver may "drop" some requests without Ultimate Cron/Background Process being aware of it.
If you're using http basic authentication for your website, you will need to configure settings.php manually or click the "Determine default service host" button on each environment after database migration.
Another solution could be to use the Drush setup as explained here: http://drupal.org/node/1443264#comment-5752990
FYI: I'm currently working on making the entire Background Process launching of processes more robust, but that's in a very very unofficial/unready 2.x branch, and I'm not sure how of it can be backported to 1.x.
Comment #14
d3vo commentedI have installed both dev versions and now i get a started "never" and a status "N/A". Its like cron never starts. I can click the run link and the job runs fine. This is my cron job
/usr/bin/wget --no-check-certificate --quiet -O - https://www.pickerspal.com/cron.php?cron_key=******************Comment #15
Anonymous (not verified) commentedHi gielfeldt,
I have run in the same issue as above. Following all the advice in this thread and some others I have installed the dev versions of both, Ultimate Cron and Backgroud Process. The set-up is as follows:
* * * * * wget -O - -q -t 1 http://mydomain.dev/it/cron.php?cron_key=**************************************which runs regularly every minute with HTTP status 200
Could not determine default service host. Please configure background process in your settings.php[client 127.0.0.1] Client sent malformed Host header.This makes me think that there may be an issue with the ":" that you mention in same #5.
Can you give me some info about the not RFC-compliant ":" or anything else that you may think could move me on with this issue?
Comment #16
gielfeldt commentedThe 'http_host' must not be a path. Use e.g:
This should prevent the "malformed Host header" errors.
Are you using the same db for all sites (and db prefixes or not?) Depending on this configuration, you may need to run a wget for each site.
Comment #17
Anonymous (not verified) commentedAs you expected modifying the 'http_host' cleared the malformed Host header' errors. Now I can see the POST requests in the access log but they all have an HTTP status 404. And I still get the same error when I press "Determine default service host" button.
What is the resource that the POST request are trying to get and they cannot find? do I have a way to debug the request?
I am running un db per site and yes, I believe I wll have to set-up one wget per site.
Regards,
adop
Comment #18
gielfeldt commentedHi adop
It should be something like '/it/bgp-start/..... What URL is specified in the access log for the 404 request?
Comment #19
Anonymous (not verified) commentedThis is what I find in the access log:
Comment #20
gielfeldt commentedAh, the plot thickens. It seems that Background Process does not know about the prefix somehow.
Questions:
1.) How is the prefix (it, uk, etc.) implemented?
2.) Do you manually set $base_url in the settings file? If so, how?
Comment #21
Anonymous (not verified) commentedCountry prefixes are implement in Apache config file with Alias and Rewrite statement:
No other setting for url is done.
At the end of the bootstrap process I get the following situation:
Request for mydomain.dev (ie default site)
Request for mydomain.dev/it (ie country-specific site)
Hope this will help.
Regards,
adop
Comment #22
gielfeldt commentedOk. I'm trying to recreate your setup, in order to debug a little. How did you configure your system to choose a different database depending on the site? Do you have separate settings.php for each site? If so, how are they invoked?
Comment #23
Anonymous (not verified) commentedThis is the directory structure that I have:
Each settings.php contains the db array where I set pwd, host, etc.
The bootstrap process provides at the end a $databases array with all the parameters required for the connection.
If you are trying to recreate the setup make sure you use dots in mydomain.dev.it and mydomain.dev.uk.
This could also be useful Drupal multisite in subfolders
If you need more info just let me know.
Regards,
adop
Comment #24
gielfeldt commentedI've now tried using a multisite setup similar to what you described. It works out of the box for me. However, I believe I have found a bug in the "determine service host" logic, which can make it fail on systems where "mydomain.dev" resolves to an ip address that is not accessible from localhost.
After discovering this, there's one little thing in your background process configuration which I didn't notice earlier.
You should add the "it", "uk", etc. to the base_url, for example:
Could you try updating your settings.php's like stated above and see if that works? You have to add it to each site's settings.php.
I'll devise a fix for the "determine service host" logic in the meantime. When the fix is ready, you should be able to use that feature instead of manually configuring background process through settings.php, should you prefer this.
Comment #25
Anonymous (not verified) commentedWith the change in settings.php processes now run regularly and this is what I see in the web server access log:
.
For what you wrote above "determine service host" still gives an error.
Regards,
adop
Comment #26
gielfeldt commentedHi adop
Ok. I've committed a fix to the "determine default service host" logic to 7.x-1.x-dev.
Note, that when manually configuring $conf['background_process_service_hosts']['default'] in the settings file, the "determine default service host" has no effect. Also, in a setup like yours, I would recommend manually configuring background process via the settings file, especially if you have dev/prod environments and do database migration once in a while. In those kind of setups, Background Process might send the request to the wrong environment, if "determine default service host" is used.
Comment #27
Anonymous (not verified) commentedHi gielfeldt,
I have installed the latest dev version of Background Process but there is still an error when I use "determine default service host".
However for me is good enough because I will take your advice to manage backgroud process via settings.php.
Thanks a lot for the work that you have done.
Regards,
adop
Comment #28
gielfeldt commentedI'm gonna set this to fixed for now.
If you ever need the "Determine default service" host functionality, please re-open this ticket or create a new one, and then we'll do some investigation/debugging on this issue.