List for cgit developers and users
 help / color / mirror / Atom feed
* CGIT not working with PATH_INFO under Ubuntu 10.04 / Lighttpd
       [not found] <1299460168.2198.18.camel@nirvana>
@ 2011-03-07  7:52 ` hjemli
  2011-03-07  9:07   ` angus
  0 siblings, 1 reply; 5+ messages in thread
From: hjemli @ 2011-03-07  7:52 UTC (permalink / raw)


[added cc:cgit list]

On Mon, Mar 7, 2011 at 02:09, Angus Turnbull <angus at twinhelix.com> wrote:
> I've compiled CGIT v0.8.3.5 against Git 1.7.3 under Ubuntu 10.04.2 LTS
> on a Xen HVM VPS with the default compiler g++ 4.4.3-4ubuntu5,
> zlib1g-dev 1.2.3.3.dfsg-15ubuntu1, libssl-dev 0.9.8k-7ubuntu8 and served
> with lighttpd 1.4.26.
>
> The web interface will load and list respositories, but as soon as you
> click one, it displays the root title header and hangs as soon as it
> gets to "Name" and "Description". This is with a URL
> like /cgit/reponame/ -- I've got it on http://git.twinhelix.com if you
> want to see it. Manually keying in /cgit?r=reponame results in the
> expected repo contents list.

This is very strange. On you site, /cgit?r=fsmenu works as expected,
while /cgit?url=fsmenu does not, and instead shows a path-filtered
repolist (url=fsmenu is how $PATH_INFO is handled internally).

When specifying r=fsmenu, "fsmenu" is passed as argument to
cgit_get_repoinfo() [1], and when specifying url=fsmenu, "fsmenu" is
passed as argument to cgit_parse_url() [2], which in turn invokes
cgit_get_repoinfo() [3] on its argument. This should Just Work.

If you could add a fprintf() to cgit_get_repoinfo() [4], like this

  fprintf(stderr, "cgit_get_repoinfo(%s)\n", url);

and report back what you get in your webserver logfiles when accessing
  /cgit/fsmenu
  /cgit?r=fsmenu
  /cgit?url=fsmenu

That might help us pin down the cause of the problem.

--
larsh

[1] http://hjemli.net/git/cgit/tree/cgit.c?h=stable#n206
[2] http://hjemli.net/git/cgit/tree/cgit.c?h=stable#n211
[3] http://hjemli.net/git/cgit/tree/parsing.c?h=stable#n26
[4] http://hjemli.net/git/cgit/tree/shared.c?h=stable#n72




^ permalink raw reply	[flat|nested] 5+ messages in thread

* CGIT not working with PATH_INFO under Ubuntu 10.04 / Lighttpd
  2011-03-07  7:52 ` CGIT not working with PATH_INFO under Ubuntu 10.04 / Lighttpd hjemli
@ 2011-03-07  9:07   ` angus
  2011-03-10 15:52     ` hjemli
  0 siblings, 1 reply; 5+ messages in thread
From: angus @ 2011-03-07  9:07 UTC (permalink / raw)


> This is very strange. On you site, /cgit?r=fsmenu works as expected,
> while /cgit?url=fsmenu does not, and instead shows a path-filtered
> repolist (url=fsmenu is how $PATH_INFO is handled internally).
> 
> When specifying r=fsmenu, "fsmenu" is passed as argument to
> cgit_get_repoinfo() [1], and when specifying url=fsmenu, "fsmenu" is
> passed as argument to cgit_parse_url() [2], which in turn invokes
> cgit_get_repoinfo() [3] on its argument. This should Just Work.
> 
> If you could add a fprintf() to cgit_get_repoinfo() [4], like this
> 
>   fprintf(stderr, "cgit_get_repoinfo(%s)\n", url);
> 
> and report back what you get in your webserver logfiles when accessing
>   /cgit/fsmenu
>   /cgit?r=fsmenu
>   /cgit?url=fsmenu
> 
> That might help us pin down the cause of the problem.
> 
> --
> larsh
> 
> [1] http://hjemli.net/git/cgit/tree/cgit.c?h=stable#n206
> [2] http://hjemli.net/git/cgit/tree/cgit.c?h=stable#n211
> [3] http://hjemli.net/git/cgit/tree/parsing.c?h=stable#n26
> [4] http://hjemli.net/git/cgit/tree/shared.c?h=stable#n72

Thanks for the feedback. I've added the patch (pasted that as the first
line of the function), recompiled and discovered that Lighty doesn't use
the error log but redirects to STDOUT :). Anyway, results:

"/cgit/fsmenu"
cgit_get_repoinfo(fsmenu)

"/cgit/fsmenu/"
cgit_get_repoinfo(fsmenu/)
cgit_get_repoinfo(fsmenu)

"/cgit?r=fsmenu"
cgit_get_repoinfo(fsmenu)

"/cgit?url=fsmenu"
cgit_get_repoinfo(fsmenu)

The server is Ubuntu 10.04 x64, and I've tried compiling cgit on my
desktop which is 10.10 x64 against a fresh tarball of Git v1.7.3.5,
still the same result (where I ran the above tests actually). Perhaps
try an Ubuntu x64 virtual machine using something like KVM or VirtualBox
and see if you can spot the issue too? All my packages are from the
standard repos.

Angus





^ permalink raw reply	[flat|nested] 5+ messages in thread

* CGIT not working with PATH_INFO under Ubuntu 10.04 / Lighttpd
  2011-03-07  9:07   ` angus
@ 2011-03-10 15:52     ` hjemli
  2011-03-11  3:35       ` angus
       [not found]       ` <1301186716.2172.16.camel@nirvana>
  0 siblings, 2 replies; 5+ messages in thread
From: hjemli @ 2011-03-10 15:52 UTC (permalink / raw)


On Mon, Mar 7, 2011 at 10:07, Angus Turnbull <angus at twinhelix.com> wrote:
>> When specifying r=fsmenu, "fsmenu" is passed as argument to
>> cgit_get_repoinfo() [1], and when specifying url=fsmenu, "fsmenu" is
>> passed as argument to cgit_parse_url() [2], which in turn invokes
>> cgit_get_repoinfo() [3] on its argument. This should Just Work.
>>
>> If you could add a fprintf() to cgit_get_repoinfo() [4], like this
>>
>> ? fprintf(stderr, "cgit_get_repoinfo(%s)\n", url);
>>
>> and report back what you get in your webserver logfiles when accessing
>> ? /cgit/fsmenu
>> ? /cgit?r=fsmenu
>> ? /cgit?url=fsmenu
>>
>> That might help us pin down the cause of the problem.
>
> Thanks for the feedback. I've added the patch (pasted that as the first
> line of the function), recompiled and discovered that Lighty doesn't use
> the error log but redirects to STDOUT :). Anyway, results:
>
> "/cgit/fsmenu"
> cgit_get_repoinfo(fsmenu)
>
> "/cgit/fsmenu/"
> cgit_get_repoinfo(fsmenu/)
> cgit_get_repoinfo(fsmenu)
>
> "/cgit?r=fsmenu"
> cgit_get_repoinfo(fsmenu)
>
> "/cgit?url=fsmenu"
> cgit_get_repoinfo(fsmenu)

Even more strange (I was hoping to see some munging of query params
due to url rewriting or some such). But with identical input, you
should get identical output (ctx->repo should point at the correct
repo-struct in all the above cases), so I assume that ctx->repo
somehow becomes NULL after the call to cgit_get_repoinfo(), but only
when initialized via cgit_parse_url().

Could you try running cgit under gdb to find the culprit? E.g:

$ PATH_INFO=fsmenu gdb ./cgit
(gdb) break cgit_parse_url
(gdb) run

-- 
larsh




^ permalink raw reply	[flat|nested] 5+ messages in thread

* CGIT not working with PATH_INFO under Ubuntu 10.04 / Lighttpd
  2011-03-10 15:52     ` hjemli
@ 2011-03-11  3:35       ` angus
       [not found]       ` <1301186716.2172.16.camel@nirvana>
  1 sibling, 0 replies; 5+ messages in thread
From: angus @ 2011-03-11  3:35 UTC (permalink / raw)


> Even more strange (I was hoping to see some munging of query params
> due to url rewriting or some such). But with identical input, you
> should get identical output (ctx->repo should point at the correct
> repo-struct in all the above cases), so I assume that ctx->repo
> somehow becomes NULL after the call to cgit_get_repoinfo(), but only
> when initialized via cgit_parse_url().
> 
> Could you try running cgit under gdb to find the culprit? E.g:
> 
> $ PATH_INFO=fsmenu gdb ./cgit
> (gdb) break cgit_parse_url
> (gdb) run

I'm not running any URL rewriting on my CGIT instance except for setting
the index page for the subdomain to "/cgit".

Output from GDB at a console:

GNU gdb (GDB) 7.2-ubuntu
...
This GDB was configured as "x86_64-linux-gnu".
...
(gdb) break cgit_parse_url
Breakpoint 1 at 0x4080fc: file parsing.c, line 22.
(gdb) run
Starting program: /pathname/cgit 
[Thread debugging using libthread_db enabled]

Breakpoint 1, cgit_parse_url (url=0x6ca030 "fsmenu") at parsing.c:22
22	parsing.c: No such file or directory.
	in parsing.c
(gdb) 

If run normally, it generates a page with the main index logo/header
and:

<div class='content'><table summary='repository list' class='list
nowrap'></table><div class='error'>No repositories found</div>
</div>





^ permalink raw reply	[flat|nested] 5+ messages in thread

* CGIT not working with PATH_INFO under Ubuntu 10.04 / Lighttpd
       [not found]       ` <1301186716.2172.16.camel@nirvana>
@ 2011-03-27  7:58         ` hjemli
  0 siblings, 0 replies; 5+ messages in thread
From: hjemli @ 2011-03-27  7:58 UTC (permalink / raw)


On Sun, Mar 27, 2011 at 01:45, Angus Turnbull <angus at twinhelix.com> wrote:
>> Even more strange (I was hoping to see some munging of query params
>> due to url rewriting or some such). But with identical input, you
>> should get identical output (ctx->repo should point at the correct
>> repo-struct in all the above cases), so I assume that ctx->repo
>> somehow becomes NULL after the call to cgit_get_repoinfo(), but only
>> when initialized via cgit_parse_url().
>>
>> Could you try running cgit under gdb to find the culprit? E.g:
>>
>> $ PATH_INFO=fsmenu gdb ./cgit
>> (gdb) break cgit_parse_url
>> (gdb) run
>>
>> --
>> larsh
>
> For what it's worth, I've gone back to this and built cgit v0.9-8-g568d
> against Git v.1.7.4.1 and it now works well under Ubuntu Server 10.04
> with my existing configuration. I suppose the issue has resolved
> somehow!

Good to hear (even though the cause of the problem remains a mystery).

-- 
larsh




^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2011-03-27  7:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <1299460168.2198.18.camel@nirvana>
2011-03-07  7:52 ` CGIT not working with PATH_INFO under Ubuntu 10.04 / Lighttpd hjemli
2011-03-07  9:07   ` angus
2011-03-10 15:52     ` hjemli
2011-03-11  3:35       ` angus
     [not found]       ` <1301186716.2172.16.camel@nirvana>
2011-03-27  7:58         ` hjemli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).