List for cgit developers and users
 help / color / mirror / Atom feed
* Can I get detailed Cgit logs?
@ 2014-02-25 17:53 nolan
  2014-02-25 18:08 ` john
  0 siblings, 1 reply; 6+ messages in thread
From: nolan @ 2014-02-25 17:53 UTC (permalink / raw)


Hello,

I'm encountering the infamous "no repositories found" issue. I've 
exhaustively checked permissions, up to and including assigning a shell 
to the www-data user and verifying that it can read my Git repositories. 
I've checked every directory permission from /, and it all looks good.

One complicating factor of my setup is that it is in Docker 
(http://docker.io) containers. I currently have a Docker container 
hosting Git repositories via Gitolite, another running Jenkins, and 
Cgit. Jenkins communicates with Gitolite just fine, though it uses SSH 
which I know works.

It would be very helpful if Cgit gave me an exact error as to why it 
can't access my repositories. I had to jump through a hoop with Selinux 
on 13.10 in the Gitolite container, so if that's tripping up Cgit for 
some reason then knowing would be helpful.

Is there any way to get detailed error logs? I don't see any in my 
Apache logs, which could mean a misconfiguration on that end. But having 
access to some sort of detailed error log would be very helpful in 
debugging this.

Thanks.


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

* Can I get detailed Cgit logs?
  2014-02-25 17:53 Can I get detailed Cgit logs? nolan
@ 2014-02-25 18:08 ` john
  2014-02-25 18:40   ` nolan
  0 siblings, 1 reply; 6+ messages in thread
From: john @ 2014-02-25 18:08 UTC (permalink / raw)


On Tue, Feb 25, 2014 at 11:53:30AM -0600, Nolan Darilek wrote:
> I'm encountering the infamous "no repositories found" issue. I've 
> exhaustively checked permissions, up to and including assigning a shell 
> to the www-data user and verifying that it can read my Git repositories. 
> I've checked every directory permission from /, and it all looks good.
> 
> One complicating factor of my setup is that it is in Docker 
> (http://docker.io) containers. I currently have a Docker container 
> hosting Git repositories via Gitolite, another running Jenkins, and 
> Cgit. Jenkins communicates with Gitolite just fine, though it uses SSH 
> which I know works.
> 
> It would be very helpful if Cgit gave me an exact error as to why it 
> can't access my repositories. I had to jump through a hoop with Selinux 
> on 13.10 in the Gitolite container, so if that's tripping up Cgit for 
> some reason then knowing would be helpful.

How is CGit able to see the repositories?  Unlike Jenkins, CGit does not
speak any of the Git protocols, it expects to see repositories in the
file system.

Are you Docker containers sharing an underlying filesystem, or do you
have some external job that is cloning the repositories for CGit?

> Is there any way to get detailed error logs? I don't see any in my 
> Apache logs, which could mean a misconfiguration on that end. But having 
> access to some sort of detailed error log would be very helpful in 
> debugging this.

Since CGit is a CGI program, you can just run it and see what happens.
You may want to export PATH_INFO=/ before doing so to make sure it
generates the index.

You can run under strace to monitor what is going on during repository
discovery.


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

* Can I get detailed Cgit logs?
  2014-02-25 18:08 ` john
@ 2014-02-25 18:40   ` nolan
  2014-02-25 19:24     ` nolan
  2014-02-25 19:25     ` john
  0 siblings, 2 replies; 6+ messages in thread
From: nolan @ 2014-02-25 18:40 UTC (permalink / raw)



On 02/25/2014 12:08 PM, John Keeping wrote:
> How is CGit able to see the repositories? Unlike Jenkins, CGit does 
> not speak any of the Git protocols, it expects to see repositories in 
> the file system. Are you Docker containers sharing an underlying 
> filesystem, or do you have some external job that is cloning the 
> repositories for CGit? 



>> Sharing an underlying filesystem, yes. Git repositories are in a volume shared by Gitolite and Cgit.

>> Is there any way to get detailed error logs? I don't see any in my
>> Apache logs, which could mean a misconfiguration on that end. But having
>> access to some sort of detailed error log would be very helpful in
>> debugging this.
> Since CGit is a CGI program, you can just run it and see what happens.
> You may want to export PATH_INFO=/ before doing so to make sure it
> generates the index.
OK, new complicating factor. If I spin up a container that I can 
interact with (I.e. running a shell) then running cgit.cgi directly 
shows my repositories. If I spin up a non-interactive container (I.e. 
running in the background) then I see no repositories. The only 
difference between these environments should be the lack of an attached 
stdin/stdout.

So is there any way to redirect CGI errors to the Apache error log? I 
have the following in my configuration:

   LogLevel info
   CustomLog |cat combined

My assumption is that this will redirect all relevant logs to stdout so 
they are visible in the "docker logs" command. But I only see server 
accesses, no CGI errors.

Thanks.


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

* Can I get detailed Cgit logs?
  2014-02-25 18:40   ` nolan
@ 2014-02-25 19:24     ` nolan
  2014-02-25 19:29       ` john
  2014-02-25 19:25     ` john
  1 sibling, 1 reply; 6+ messages in thread
From: nolan @ 2014-02-25 19:24 UTC (permalink / raw)


OK, figured it out. I was proxying to the Cgit docker container via 
Nginx, and specified:

proxy_pass http://cgit.prod.docker;

instead of:

proxy_pass http://cgit.prod.docker/;

Maybe some sort of "debug mode" might have helped diagnose the issue? 
Presumably Cgit was looking for repositories in a directory that didn't 
exist. Having a way to output "No repositories found in 
/srv/git/doesnotexist" might have helped me track that down more 
quickly. Or maybe such a thing exists and my Google powers are weak. :)

Thanks.



On 02/25/2014 12:40 PM, Nolan Darilek wrote:
>
> On 02/25/2014 12:08 PM, John Keeping wrote:
>> How is CGit able to see the repositories? Unlike Jenkins, CGit does 
>> not speak any of the Git protocols, it expects to see repositories in 
>> the file system. Are you Docker containers sharing an underlying 
>> filesystem, or do you have some external job that is cloning the 
>> repositories for CGit? 
>
>
>
>>> Sharing an underlying filesystem, yes. Git repositories are in a 
>>> volume shared by Gitolite and Cgit.
>
>>> Is there any way to get detailed error logs? I don't see any in my
>>> Apache logs, which could mean a misconfiguration on that end. But 
>>> having
>>> access to some sort of detailed error log would be very helpful in
>>> debugging this.
>> Since CGit is a CGI program, you can just run it and see what happens.
>> You may want to export PATH_INFO=/ before doing so to make sure it
>> generates the index.
> OK, new complicating factor. If I spin up a container that I can 
> interact with (I.e. running a shell) then running cgit.cgi directly 
> shows my repositories. If I spin up a non-interactive container (I.e. 
> running in the background) then I see no repositories. The only 
> difference between these environments should be the lack of an 
> attached stdin/stdout.
>
> So is there any way to redirect CGI errors to the Apache error log? I 
> have the following in my configuration:
>
>   LogLevel info
>   CustomLog |cat combined
>
> My assumption is that this will redirect all relevant logs to stdout 
> so they are visible in the "docker logs" command. But I only see 
> server accesses, no CGI errors.
>
> Thanks.



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

* Can I get detailed Cgit logs?
  2014-02-25 18:40   ` nolan
  2014-02-25 19:24     ` nolan
@ 2014-02-25 19:25     ` john
  1 sibling, 0 replies; 6+ messages in thread
From: john @ 2014-02-25 19:25 UTC (permalink / raw)


On Tue, Feb 25, 2014 at 12:40:40PM -0600, Nolan Darilek wrote:
> On 02/25/2014 12:08 PM, John Keeping wrote:
> > How is CGit able to see the repositories? Unlike Jenkins, CGit does 
> > not speak any of the Git protocols, it expects to see repositories in 
> > the file system. Are you Docker containers sharing an underlying 
> > filesystem, or do you have some external job that is cloning the 
> > repositories for CGit? 
> 
> Sharing an underlying filesystem, yes. Git repositories are in a
> volume shared by Gitolite and Cgit.
> 
> >> Is there any way to get detailed error logs? I don't see any in my
> >> Apache logs, which could mean a misconfiguration on that end. But having
> >> access to some sort of detailed error log would be very helpful in
> >> debugging this.
> > 
> > Since CGit is a CGI program, you can just run it and see what happens.
> > You may want to export PATH_INFO=/ before doing so to make sure it
> > generates the index.
> 
> OK, new complicating factor. If I spin up a container that I can 
> interact with (I.e. running a shell) then running cgit.cgi directly 
> shows my repositories. If I spin up a non-interactive container (I.e. 
> running in the background) then I see no repositories. The only 
> difference between these environments should be the lack of an attached 
> stdin/stdout.

Is there any chance that the CGIT_CONFIG environment variable is defined
differently for the two invocations?  If it is not defined then CGit
will default to a built-in location (by default /etc/cgitrc).

> So is there any way to redirect CGI errors to the Apache error log? I 
> have the following in my configuration:
> 
>    LogLevel info
>    CustomLog |cat combined
> 
> My assumption is that this will redirect all relevant logs to stdout so 
> they are visible in the "docker logs" command. But I only see server 
> accesses, no CGI errors.

I have never tried using a CustomLog like that, but with a default
logging setup I do see CGit errors in /var/log/apache2/error_log.


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

* Can I get detailed Cgit logs?
  2014-02-25 19:24     ` nolan
@ 2014-02-25 19:29       ` john
  0 siblings, 0 replies; 6+ messages in thread
From: john @ 2014-02-25 19:29 UTC (permalink / raw)


On Tue, Feb 25, 2014 at 01:24:02PM -0600, Nolan Darilek wrote:
> OK, figured it out. I was proxying to the Cgit docker container via 
> Nginx, and specified:
> 
> proxy_pass http://cgit.prod.docker;
> 
> instead of:
> 
> proxy_pass http://cgit.prod.docker/;
> 
> Maybe some sort of "debug mode" might have helped diagnose the issue? 
> Presumably Cgit was looking for repositories in a directory that didn't 
> exist. Having a way to output "No repositories found in 
> /srv/git/doesnotexist" might have helped me track that down more 
> quickly. Or maybe such a thing exists and my Google powers are weak. :)

CGit does log "Error opening directory" if either the directory
specified to scan does not exist or a directory listed in the project
list does not exist.


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

end of thread, other threads:[~2014-02-25 19:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-25 17:53 Can I get detailed Cgit logs? nolan
2014-02-25 18:08 ` john
2014-02-25 18:40   ` nolan
2014-02-25 19:24     ` nolan
2014-02-25 19:29       ` john
2014-02-25 19:25     ` john

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).