I have a requirement to change the context root URL of Allura. With the hint from a TurboGears forum, I could change the context root URL by making this change in development.ini
[filter:proxy-prefix]
use = egg:PasteDeploy#prefix
prefix = /my-site
[app:main]
use = egg:Allura
full_stack = true
filter-with = proxy-prefix
With this change, all the Allura pages go through http://localhost:8080/my-site.
But the issue is that taskd tasks don't work anymore. Allura.log shows up this warning:
16:23:25,927 WARNI [taskd:forgetracker.tasks.update_bin_counts:61237e1fe992b56fe76a7387:allura.command.taskd] Unexpected http response from taskd request: 404 Not Found. Headers: [('Cache-Control', 'no-cache'), ('Pragma', 'no-cache'), ('Content-Type', 'text/html; charset=utf-8'), ('Content-Length', '4448'), ('Set-cookie', '_session_id=b03d71ba8fd1fdb753e1582f86a4260a7d5f5ce613411d1012cd6e51ebd4dae0191bd6adb0f879b7; Path=/')]
Any pointers on how to make taskd aware of the context root url change?
Hi,
taskd makes a "Request" object and runs it through a turbogears wsgi app. This is so that all code can use variables like app_globals (g), tmpl_context (c), request, etc whether the code runs in a web request or a task. This starts here:
And
wsgi_app
ends up using the[app:task]
section from your.ini
file, which is probably like this:So task.py's
TaskController
is what is supposed to finally run the task.I haven't tried the proxy-prefix, so I'm not real sure what its implications are. But I would try putting logging in
TaskController.__call__
to see if its executing at all. Probably not. The log output with the 404 error means that its not finding the TaskController.My guess is the
/my-site
prefix is extra or missing, when running tasks. So some ideas you could try:/my-site
tobase_url
in theRequest.blank
object. Or remove it if its already part of the base_url[app:task]
section too. Or remove it if you have it there alreadydef make_app
where it handles theoverride_root
setting and make sure its finding and loadingTaskController
as the root