You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bloodhound.apache.org by Apache Bloodhound <de...@bloodhound.apache.org> on 2013/07/16 17:35:28 UTC

[Apache Bloodhound] #594: TracError: KeyError: 'SCRIPT_NAME'

#594: TracError: KeyError: 'SCRIPT_NAME'
-----------------------+--------------------
 Reporter:  tim        |      Owner:  nobody
     Type:  defect     |     Status:  new
 Priority:  major      |  Milestone:
Component:  dashboard  |    Version:
 Keywords:             |
-----------------------+--------------------
 After migrating from 0.5.3 to 0.6 I am getting errors when accessing
 certain pages.  The error simply says {{{TracError: KeyError:
 'SCRIPT_NAME'}}}.

 I'm using uwsgi and nginx to serve pages.  I modified nginx to include
 {{{uwsgi_param SCRIPT_NAME '';}}} to try working around the problem, but
 I'm wondering if this is why I'm having other problems accessing existing
 tickets.  0.5.3 didn't require me to have that line in the nginx config,
 too.

 Incidentally, there's no 0.6 option in the Version dropdown on this bug
 tracker.

-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/594>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker

Re: [Apache Bloodhound] #594: TracError: KeyError: 'SCRIPT_NAME'

Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#594: TracError: KeyError: 'SCRIPT_NAME'
---------------------------+-------------------------
  Reporter:  tim           |      Owner:
      Type:  defect        |     Status:  review
  Priority:  critical      |  Milestone:  Release 7
 Component:  multiproduct  |    Version:  0.6.0
Resolution:                |   Keywords:  wsgi, hooks
---------------------------+-------------------------
Changes (by olemis):

 * owner:  olemis =>
 * status:  accepted => review


Comment:

 Patches should be ready for review.

-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/594#comment:17>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker

Re: [Apache Bloodhound] #594: TracError: KeyError: 'SCRIPT_NAME'

Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#594: TracError: KeyError: 'SCRIPT_NAME'
------------------------+----------------------
  Reporter:  tim        |      Owner:  olemis
      Type:  defect     |     Status:  accepted
  Priority:  major      |  Milestone:
 Component:  dashboard  |    Version:
Resolution:             |   Keywords:  wsgi
------------------------+----------------------
Changes (by olemis):

 * status:  new => accepted
 * owner:  nobody => olemis


Comment:

 In any case I'll take a look .

-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/594#comment:2>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker

Re: [Apache Bloodhound] #594: TracError: KeyError: 'SCRIPT_NAME'

Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#594: TracError: KeyError: 'SCRIPT_NAME'
------------------------+----------------------
  Reporter:  tim        |      Owner:  olemis
      Type:  defect     |     Status:  accepted
  Priority:  major      |  Milestone:
 Component:  dashboard  |    Version:
Resolution:             |   Keywords:  wsgi
------------------------+----------------------

Comment (by rjollos):

 We might also want to know what you've specified for `[trac] base_url` and
 `[multiproduct] product_base_url`.

-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/594#comment:7>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker

Re: [Apache Bloodhound] #594: TracError: KeyError: 'SCRIPT_NAME'

Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#594: TracError: KeyError: 'SCRIPT_NAME'
---------------------------+-------------------------
  Reporter:  tim           |      Owner:
      Type:  defect        |     Status:  review
  Priority:  critical      |  Milestone:  Release 7
 Component:  multiproduct  |    Version:  0.6.0
Resolution:                |   Keywords:  wsgi, hooks
---------------------------+-------------------------

Comment (by olemis):

 Replying to [comment:15 tim]:
 > Replying to [comment:13 olemis]:
 > > Replying to [comment:11 tim]:
 > > > 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.
 >
 > This doesn't seem to be correct...  if I have the base_url set then the
 links on the /dashboard page go to "/ticket/3" instead of
 "/products/accesspoint/ticket/3" which results in a "does not exist"
 error.

 Patches for #592 suggested in comment:10 seem to solve this issue (at
 least for me) .

-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/594#comment:19>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker

Re: [Apache Bloodhound] #594: TracError: KeyError: 'SCRIPT_NAME'

Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#594: TracError: KeyError: 'SCRIPT_NAME'
------------------------+----------------------
  Reporter:  tim        |      Owner:  olemis
      Type:  defect     |     Status:  accepted
  Priority:  major      |  Milestone:
 Component:  dashboard  |    Version:
Resolution:             |   Keywords:  wsgi
------------------------+----------------------

Comment (by tim):

 I don't know if it's related to this issue so this may require another bug
 ticket but I'll explain the other issues that have come up when I add the
 {{{uwsgi_param SCRIPT_NAME '';}}} to the nginx configuration.

 1.  some tickets open fine but others simply show a page saying "Error:
 Invalid ticket number"
 2.  I seem to be unable to create any tickets with anything other than the
 default product.  When I click "Create Ticket" and then "more fields" I
 get sent to "/newticket".  I can't seem to find any link or navigation
 that takes me to "/product/[my product]/newticket".  Using the short form
 with a product set results in a 500 error.
 3. if I manually put in "/product/[some product]" into the URL, the page
 has several links that seem to go back to the non-product / default link.

-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/594#comment:4>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker

Re: [Apache Bloodhound] #594: TracError: KeyError: 'SCRIPT_NAME'

Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#594: TracError: KeyError: 'SCRIPT_NAME'
------------------------+----------------------
  Reporter:  tim        |      Owner:  olemis
      Type:  defect     |     Status:  accepted
  Priority:  major      |  Milestone:
 Component:  dashboard  |    Version:
Resolution:             |   Keywords:  wsgi
------------------------+----------------------

Comment (by tim):

 As far as I can tell...  the pages that are giving me the {{{TracError:
 KeyError: 'SCRIPT_NAME'}}} are the same pages with the drop-down in the
 breadcrumb bar to switch between products.  The pages that are working
 without me manually setting SCRIPT_NAME in the nginx config also don't
 have that product drop-down.

-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/594#comment:5>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker

Re: [Apache Bloodhound] #594: TracError: KeyError: 'SCRIPT_NAME'

Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#594: TracError: KeyError: 'SCRIPT_NAME'
---------------------------+-------------------------
  Reporter:  tim           |      Owner:  rjollos
      Type:  defect        |     Status:  closed
  Priority:  critical      |  Milestone:  Release 7
 Component:  multiproduct  |    Version:  0.6.0
Resolution:  fixed         |   Keywords:  wsgi, hooks
---------------------------+-------------------------
Changes (by rjollos):

 * status:  review => closed
 * resolution:   => fixed


Comment:

 (In [1512122])

 Ensure `SCRIPT_NAME` var is set. Refs #594.

 Patch by Olemis.

-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/594#comment:23>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker

Re: [Apache Bloodhound] #594: TracError: KeyError: 'SCRIPT_NAME'

Posted by Ryan Ollos <ry...@wandisco.com>.
On Tue, Jul 16, 2013 at 8:35 AM, Apache Bloodhound <
dev@bloodhound.apache.org> wrote:

> #594: TracError: KeyError: 'SCRIPT_NAME'
> -----------------------+--------------------
>  Reporter:  tim        |      Owner:  nobody
>      Type:  defect     |     Status:  new
>  Priority:  major      |  Milestone:
> Component:  dashboard  |    Version:
>  Keywords:             |
> -----------------------+--------------------
>  After migrating from 0.5.3 to 0.6 I am getting errors when accessing
>  certain pages.  The error simply says {{{TracError: KeyError:
>  'SCRIPT_NAME'}}}.
>
>  I'm using uwsgi and nginx to serve pages.  I modified nginx to include
>  {{{uwsgi_param SCRIPT_NAME '';}}} to try working around the problem, but
>  I'm wondering if this is why I'm having other problems accessing existing
>  tickets.  0.5.3 didn't require me to have that line in the nginx config,
>  too.
>
>  Incidentally, there's no 0.6 option in the Version dropdown on this bug
>  tracker.
>

I'd like to add a version to the Version enum, but it requires having at
least TICKET_ADMIN. We previously discussed giving everyone on the pmc
elevated permissions in the issue tracker and our mentor suggested this
should be done. Is there any reason this hasn't already been done, or any
reason to not do it now? I can't see a good reason to not allow everyone on
the pmc to make simple edits like this.

Re: [Apache Bloodhound] #594: TracError: KeyError: 'SCRIPT_NAME'

Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#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 tim):

 Replying to [comment:13 olemis]:
 > Replying to [comment:11 tim]:
 > > 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.

 This doesn't seem to be correct...  if I have the base_url set then the
 links on the /dashboard page go to "/ticket/3" instead of
 "/products/accesspoint/ticket/3" which results in a "does not exist"
 error.

-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/594#comment:15>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker

Re: [Apache Bloodhound] #594: TracError: KeyError: 'SCRIPT_NAME'

Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#594: TracError: KeyError: 'SCRIPT_NAME'
------------------------+----------------------
  Reporter:  tim        |      Owner:  olemis
      Type:  defect     |     Status:  accepted
  Priority:  major      |  Milestone:
 Component:  dashboard  |    Version:
Resolution:             |   Keywords:  wsgi
------------------------+----------------------

Comment (by rjollos):

 Replying to [comment:4 tim]:
 > 1.  some tickets open fine but others simply show a page saying "Error:
 Invalid ticket number"

 This sounds similar to #568/#569. Have you set `[multiproduct]
 default_product_prefix` or `[ticket] default_product` in `trac.ini`?

 > 2.  I seem to be unable to create any tickets with anything other than
 the default product.  When I click "Create Ticket" and then "more fields"
 I get sent to "/newticket".  I can't seem to find any link or navigation
 that takes me to "/product/[my product]/newticket".  Using the short form
 with a product set results in a 500 error.

 Yeah, this seems to be a problem. We need to add a product select
 somewhere on the `/newticket` page.

 > 3. if I manually put in "/product/[some product]" into the URL, the page
 has several links that seem to go back to the non-product / default link.

 Which links specifically?

-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/594#comment:6>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker

Re: [Apache Bloodhound] #594: TracError: KeyError: 'SCRIPT_NAME'

Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#594: TracError: KeyError: 'SCRIPT_NAME'
------------------------+----------------------
  Reporter:  tim        |      Owner:  olemis
      Type:  defect     |     Status:  accepted
  Priority:  major      |  Milestone:
 Component:  dashboard  |    Version:
Resolution:             |   Keywords:  wsgi
------------------------+----------------------

Comment (by tim):

 I put the logging level to debugging and got the following:
 {{{
 2013-07-16 20:28:46,314 Trac[main] DEBUG: Dispatching
 <ProductRequestWithSession "GET '/favicon.ico'">
 2013-07-16 20:28:46,316 Trac[session] DEBUG: Retrieving session for ID
 u'tim'
 2013-07-16 20:28:46,317 Trac[main] DEBUG: Negotiated locale: None -> en_US
 2013-07-16 20:28:46,325 Trac[api] WARNING: Unable to find repository
 '(default)' for synchronization
 2013-07-16 20:28:46,325 Trac[chrome] DEBUG: Prepare chrome data for
 request
 2013-07-16 20:28:46,330 Trac[PyGIT] DEBUG: PyGIT.Storage instance 86982352
 constructed
 2013-07-16 20:28:46,330 Trac[PyGIT] DEBUG: requested weak PyGIT.Storage
 instance 86982352 for '/opt/access_point.git'
 2013-07-16 20:28:46,330 Trac[git_fs] DEBUG: disabled CachedRepository for
 '/opt/access_point.git'
 2013-07-16 20:28:46,331 Trac[PyGIT] DEBUG: PyGIT.Storage instance 85756176
 constructed
 2013-07-16 20:28:46,331 Trac[PyGIT] DEBUG: requested weak PyGIT.Storage
 instance 85756176 for '/opt/metrics_mainserver.git'
 2013-07-16 20:28:46,331 Trac[git_fs] DEBUG: disabled CachedRepository for
 '/opt/metrics_mainserver.git'
 2013-07-16 20:28:46,334 Trac[web_ui] DEBUG: {'active': False, 'name':
 'wiki', 'label': <Element "a">}
 2013-07-16 20:28:46,334 Trac[web_ui] DEBUG: {'active': False, 'name':
 'browser', 'label': <Element "a">}
 2013-07-16 20:28:46,334 Trac[web_ui] DEBUG: {'active': False, 'name':
 'tickets', 'label': <Element "a">}
 2013-07-16 20:28:46,334 Trac[main] WARNING: [130.63.114.112] HTTPNotFound:
 404 Not Found (No handler matched request to /favicon.ico)
 }}}

 It's a little strange that there's nothing about the fact that the front
 end browser is getting a 500 error.

-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/594#comment:3>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker

Re: [Apache Bloodhound] #594: TracError: KeyError: 'SCRIPT_NAME'

Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#594: TracError: KeyError: 'SCRIPT_NAME'
------------------------+--------------------
  Reporter:  tim        |      Owner:  nobody
      Type:  defect     |     Status:  new
  Priority:  major      |  Milestone:
 Component:  dashboard  |    Version:
Resolution:             |   Keywords:  wsgi
------------------------+--------------------
Changes (by olemis):

 * keywords:   => wsgi


Comment:

 Replying to [ticket:594 tim]:
 > After migrating from 0.5.3 to 0.6 I am getting errors when accessing
 certain pages.  The error simply says {{{TracError: KeyError:
 'SCRIPT_NAME'}}}.
 >

 More information is needed so as to reproduce this issue , figure out
 what's wrong and fix these errors . Do you see any error messages in the
 log ? Any tracebacks ?

 > I'm using uwsgi and nginx to serve pages.  I modified nginx to include
 {{{uwsgi_param SCRIPT_NAME '';}}}

 You should not be doing so considering the [pep:333#environ-variables
 purpose of SCRIPT_NAME var].

 > to try working around the problem, but I'm wondering if this is why I'm
 having other problems accessing existing tickets.

 Could you please mention what kinds of problems ?

 > 0.5.3 didn't require me to have that line in the nginx config, too.
 >

 AFAICT this should not be necessary. Updating `SCRIPT_NAME` is a
 responsibility of the web server . Maybe this is an issue specific to
 nginx ?

 > Incidentally, there's no 0.6 option in the Version dropdown on this bug
 tracker.

 Eventually ...

-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/594#comment:1>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker

Re: [Apache Bloodhound] #594: TracError: KeyError: 'SCRIPT_NAME'

Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#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):

 @tim : What happens if you apply
 [attachment:t594_r1503620_hooks_safe_script_name.diff this patch] and
 remove `uwsgi_param SCRIPT_NAME '';` from nginx config ?

-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/594#comment:9>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker

Re: [Apache Bloodhound] #594: TracError: KeyError: 'SCRIPT_NAME'

Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#594: TracError: KeyError: 'SCRIPT_NAME'
---------------------------+-------------------------
  Reporter:  tim           |      Owner:
      Type:  defect        |     Status:  review
  Priority:  critical      |  Milestone:  Release 7
 Component:  multiproduct  |    Version:  0.6.0
Resolution:                |   Keywords:  wsgi, hooks
---------------------------+-------------------------

Comment (by olemis):

 Replying to [comment:20 rjollos]:
 > Since the patches in #592 have been applied, will we still need
 [attachment: t594_r1503620_hooks_safe_script_name.diff] to resolve this
 ticket?

 yes

-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/594#comment:21>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker

Re: [Apache Bloodhound] #594: TracError: KeyError: 'SCRIPT_NAME'

Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#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 tim):

 Replying to [comment:1 olemis]:
 > Replying to [ticket:594 tim]:
 > > I'm using uwsgi and nginx to serve pages.  I modified nginx to include
 {{{uwsgi_param SCRIPT_NAME '';}}}
 >
 > You should not be doing so considering the [pep:0333#environ-variables
 purpose of SCRIPT_NAME var].

 After doing a lot of reading...  It seems like SCRIPT_NAME should always
 be an empty string in my case since I'm running bloodhound in the root
 path.  Shouldn't the product url's be part of the PATH_INFO as it's the
 "virtual location" '''within''' the application.

-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/594#comment:14>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker

Re: [Apache Bloodhound] #594: TracError: KeyError: 'SCRIPT_NAME'

Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#594: TracError: KeyError: 'SCRIPT_NAME'
---------------------------+-------------------------
  Reporter:  tim           |      Owner:  olemis
      Type:  defect        |     Status:  accepted
  Priority:  critical      |  Milestone:  Release 7
 Component:  multiproduct  |    Version:  0.6.0
Resolution:                |   Keywords:  wsgi, hooks
---------------------------+-------------------------
Changes (by tim):

 * version:   => 0.6.0


-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/594#comment:16>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker

Re: [Apache Bloodhound] #594: TracError: KeyError: 'SCRIPT_NAME'

Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#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:4 tim]:
 >
 [...]
 > 3. if I manually put in "/product/[some product]" into the URL, the page
 has several links that seem to go back to the non-product / default link.

 @tim Like @rjollos said these issues might happen if you configure
 `base_url` option for in TracIni file. I did not notice [ticket:592 this
 issue] until recently while working with product sub-domains, after
 releasing `0.6` . Could you apply
 [attachment:t592_r1503620_product_base_url.diff:ticket:592 this patch] and
 tell us whether everything is back to normal ?

 If you need any assistance please ask . Hopefully this will be fixed in
 [milestone:"Release 7"] .

-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/594#comment:10>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker

Re: [Apache Bloodhound] #594: TracError: KeyError: 'SCRIPT_NAME'

Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#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

Re: [Apache Bloodhound] #594: TracError: KeyError: 'SCRIPT_NAME'

Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#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 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?

 I do have {{{[trac] base_url}}} set to something like
 {{{http://example.com/}}}  (ie full URL to the root directory).  Is this
 wrong?  I removed it and my ticket urls listed on "/dashboard" seem to
 have the proper product urls in them.


 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?".  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

-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/594#comment:11>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker

Re: [Apache Bloodhound] #594: TracError: KeyError: 'SCRIPT_NAME'

Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#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 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 [ticket:592 this
 issue] until recently while working with product sub-domains, after
 releasing `0.6` . Could you apply
 [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.

-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/594#comment:12>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker

Re: [Apache Bloodhound] #594: TracError: KeyError: 'SCRIPT_NAME'

Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#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
---------------------------+-------------------------
Changes (by olemis):

 * priority:  major => critical
 * keywords:  wsgi => wsgi, hooks
 * component:  dashboard => multiproduct
 * milestone:   => Release 7


Comment:

 Interesting . I think a have a clue about what might be wrong .

-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/594#comment:8>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker

Re: [Apache Bloodhound] #594: TracError: KeyError: 'SCRIPT_NAME'

Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#594: TracError: KeyError: 'SCRIPT_NAME'
---------------------------+-------------------------
  Reporter:  tim           |      Owner:
      Type:  defect        |     Status:  review
  Priority:  critical      |  Milestone:  Release 7
 Component:  multiproduct  |    Version:  0.6.0
Resolution:                |   Keywords:  wsgi, hooks
---------------------------+-------------------------

Comment (by rjollos):

 Since the patches in #592 have been applied, will we still need
 [attachment: t594_r1503620_hooks_safe_script_name.diff] to resolve this
 ticket?

-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/594#comment:20>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker

Re: [Apache Bloodhound] #594: TracError: KeyError: 'SCRIPT_NAME'

Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#594: TracError: KeyError: 'SCRIPT_NAME'
---------------------------+-------------------------
  Reporter:  tim           |      Owner:  rjollos
      Type:  defect        |     Status:  review
  Priority:  critical      |  Milestone:  Release 7
 Component:  multiproduct  |    Version:  0.6.0
Resolution:                |   Keywords:  wsgi, hooks
---------------------------+-------------------------
Changes (by rjollos):

 * owner:   => rjollos


Comment:

 I'll apply to patch and close this ticket for [milestone:"Release 7"]. If
 we have any related issues with the next release, please create a new
 ticket.

-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/594#comment:22>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker

Re: [Apache Bloodhound] #594: TracError: KeyError: 'SCRIPT_NAME'

Posted by Apache Bloodhound <de...@bloodhound.apache.org>.
#594: TracError: KeyError: 'SCRIPT_NAME'
---------------------------+-------------------------
  Reporter:  tim           |      Owner:
      Type:  defect        |     Status:  review
  Priority:  critical      |  Milestone:  Release 7
 Component:  multiproduct  |    Version:  0.6.0
Resolution:                |   Keywords:  wsgi, hooks
---------------------------+-------------------------

Comment (by olemis):

 Replying to [comment:14 tim]:
 > Replying to [comment:1 olemis]:
 > > Replying to [ticket:594 tim]:
 > > > I'm using uwsgi and nginx to serve pages.  I modified nginx to
 include {{{uwsgi_param SCRIPT_NAME '';}}}
 > >
 > > You should not be doing so considering the [pep:0333#environ-variables
 purpose of SCRIPT_NAME var].
 >
 > After doing a lot of reading...  It seems like SCRIPT_NAME should always
 be an empty string in my case since I'm running bloodhound in the root
 path.

 That would be the case for the global environment .

 > Shouldn't the product url's be part of the PATH_INFO as it's the
 "virtual location" '''within''' the application.

 For products no . The reasons for doing so are documented in bep:0003 . In
 a few words in order to achieve backwards compatibility with ''Trac'' code
 the multi-product architecture is a reimplementation of
 [wiki:Proposals/BEP-0003/MultienvParentDir this deployment] within a
 single ''Trac'' environment powered by what we named [bep:0003#product-
 envs product environments]. The later are self contained units equivalent
 to ''Trac'' (i.e. global) environments . All this implies that product
 environments expect `PATH_INFO` to be set to /wiki , /ticket , ... in
 spite of dispatching requests to the right handler . That's why the whole
 path is shifted to the left like shown [http://bhnet.blood-
 hound.net/browser/bloodhound/bloodhound_multiproduct/multiproduct/hooks.py?marks=69-72#L69
 here]

-- 
Ticket URL: <https://issues.apache.org/bloodhound/ticket/594#comment:18>
Apache Bloodhound <https://issues.apache.org/bloodhound/>
The Apache Bloodhound issue tracker