#594: TracError: KeyError: 'SCRIPT_NAME'
---------------------------+-------------------------
Reporter: tim | Owner: olemis
Type: defect | Status: accepted
Priority: critical | Milestone: Release 7
Component: multiproduct | Version:
Resolution: | Keywords: wsgi, hooks
---------------------------+-------------------------
Comment (by olemis):
Replying to [comment:11 tim]:
> I generated a new trac environment with {{{./trac-admin boo initenv}}}
to get a new trac.ini file with the default settings. In my old trac.ini
file I have {{{[ticket] default_product = Default}}} but the newly
generated one has no {{{default_product}}} setting. This seems to be
similar to #568.
>
> {{{[multiproduct]}}} doesn't seem to have any settings in either my old
trac.ini or the newly generated one. Should that be manually set or does
it have a reasonable default?
>
Default product will be phased out soon for anything but upgrades.
> I do have {{{[trac] base_url}}} set to something like
{{{http://example.com/}}} (ie full URL to the root directory). Is this
wrong?
No, that option is used to generate the body of notification e-mails.
> I removed it and my ticket urls listed on "/dashboard" seem to have the
proper product urls in them.
>
See below .
>
> I think I may have found something useful:
>
> I noticed that I have the following settings under {{{[trac]}}} that
have nothing in the freshly generated trac.ini:
>
> {{{
> environment_factory = /sites/apache-
bloodhound-0.6/installer/bloodhound/lib/python2.7/site-
packages/multiproduct/hooks.py
> request_factory = /sites/apache-
bloodhound-0.6/installer/bloodhound/lib/python2.7/site-
packages/multiproduct/hooks.py
> }}}
>
> I tried running without those lines and when I try viewing a ticket I am
told "Unable to render product page. Wrong setup?".
Expected behavior.
> I then re-added those lines and when I try to view a ticket I'm told
{{{TracError: KeyError: 'SCRIPT_NAME'}}}. I checked and that file does
exist at that location.
>
>
>
[https://issues.apache.org/bloodhound/attachment/ticket/594/t594_r1503620_hooks_safe_script_name.diff
Your patch] seems to have fixed the issue as long as I have the
{{{environment_factory}}} and {{{request_factory}}} settings in the
trac.ini
Yes , in default installation you need that configuration to run default
hooks . Thanks for your feedback !
Replying to [comment:12 tim]:
> Replying to [comment:10 olemis]:
>>
>> @tim Like @rjollos said these issues might happen if you configure
base_url option in
>> TracIni file. I did not notice this issue until recently while working
with product
>> sub-domains, after releasing 0.6 . Could you apply
>>
[https://issues.apache.org/bloodhound/attachment:t592_r1503620_product_base_url.diff:ticket:592
this patch] and tell us if
>> everything is back to normal ?
>
> I ended up just removing base_url and things seem to be okay so far.
So that's what I thought . AFAICR , that configuration option will be used
in e-mail notifications, and thereby it's useful. If you need it working
soon then the patch mentioned above will solve this particular issue .
--
Ticket URL: <https://issues.apache.org/bloodhound/ticket/594#comment:13>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker