{"thread":{"id":"22612","subject":"XML Parsing Error: junk after document element","startedAt":"2010-02-11T07:47:22Z","lastAt":"2010-02-17T09:46:54Z","messageCount":5,"participants":["Siju George","Jakub Narebski"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"134215","messageId":"b713df2c1002102347g70cc212et21d507d44bb5aead@mail.gmail.com","threadId":"22612","inReplyTo":null,"subject":"XML Parsing Error: junk after document element","fromName":"Siju George","fromEmail":"sgeorge.ml@gmail.com","sentAt":"2010-02-11T07:47:22Z","receivedAt":"2010-02-11T07:47:22Z","isPatch":false,"sender":{"key":"sgeorge.ml@gmail.com","avatar":null},"body":"Hi,\n\nI get this error when I take gitweb in a browser.\n\nXML Parsing Error: junk after document element\nLocation: http://172.16.3.27/cgi-bin/gitweb.cgi\nLine Number 28, Column 8:</html><!DOCTYPE HTML PUBLIC \"-//IETF//DTD\nHTML 2.0//EN\">\n-------^\n\nHow can I solve it?\n\nThanks\n\n--Siju\n"},{"id":"134217","messageId":"m3ocjw82ai.fsf@localhost.localdomain","threadId":"22612","inReplyTo":"b713df2c1002102347g70cc212et21d507d44bb5aead@mail.gmail.com","subject":"Re: XML Parsing Error: junk after document element","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-02-11T11:01:36Z","receivedAt":"2010-02-11T11:01:36Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"Siju George <sgeorge.ml@gmail.com> writes:\n\n> Hi,\n> \n> I get this error when I take gitweb in a browser.\n> \n> XML Parsing Error: junk after document element\n> Location: http://172.16.3.27/cgi-bin/gitweb.cgi\n> Line Number 28, Column 8:</html><!DOCTYPE HTML PUBLIC \"-//IETF//DTD\n> HTML 2.0//EN\">\n> -------^\n> \n> How can I solve it?\n\nWhich version of gitweb?[1]  Which version of git?[2]  What web server?\nWhich version of CGI.pm is used by web server?[3]\n\nThe included fragment after closing '</html>' tag doesn't look like\nsomething coming from gitweb, as gitweb uses XHTML 1.0 DTD since it's\nfirst version.\n\nTry to view source, or use different web browser that doesn't do\nstrict XML validation to find the source of this error.\n\nIf everything else fals, you can always edit gitweb.cgi to comment out\ncontent-type negotiation, to always serve as text/html mimetype -\nwhich should torn off XML validation, as below:\n\n\tmy $content_type;\n\t# require explicit support from the UA if we are to send the page as\n\t# 'application/xhtml+xml', otherwise send it as plain old 'text/html'.\n\t# we have to do this because MSIE sometimes globs '*/*', pretending to\n\t# support xhtml+xml but choking when it gets what it asked for.\n\t# Disable content-type negotiation when caching (use mimetype good for all).\n\t#if (defined $cgi->http('HTTP_ACCEPT') &&\n\t#    $cgi->http('HTTP_ACCEPT') =~ m/(,|;|\\s|^)application\\/xhtml\\+xml(,|;|\\s|$)/ &&\n\t#    $cgi->Accept('application/xhtml+xml') != 0) {\n\t#\t$content_type = 'application/xhtml+xml';\n\t#} else {\n\t\t$content_type = 'text/html';\n\t#}\n\n\nThe commands below are _examples_ only:\n[1] grep -F 'our $version' /var/www/cgi-bin/gitweb.cgi\n[2] git --version\n[3] perl -MCGI -le 'print $CGI::VERSION'\n-- \nJakub Narebski\nPoland\nShadeHawk on #git\n"},{"id":"134290","messageId":"b713df2c1002112023k757a54faq933b9a9bdacc7d1c@mail.gmail.com","threadId":"22612","inReplyTo":"m3ocjw82ai.fsf@localhost.localdomain","subject":"Re: XML Parsing Error: junk after document element","fromName":"Siju George","fromEmail":"sgeorge.ml@gmail.com","sentAt":"2010-02-12T04:23:06Z","receivedAt":"2010-02-12T04:23:06Z","isPatch":false,"sender":{"key":"sgeorge.ml@gmail.com","avatar":null},"body":"Thanks a lot Jakub for the response :-)\n\nOn Thu, Feb 11, 2010 at 4:31 PM, Jakub Narebski <jnareb@gmail.com> wrote:\n>\n> Which version of gitweb?[1]\n>\n\n gitweb-1.6.0.6  - all packages are from pkgsrc on DragonFly BSD\nv2.5.1.672.gf81ef-DEVELOPMENT #17: Tue Feb\n\n> Which version of git?[2]\n>\n\nscmgit-1.6.6.1\n\n>What web server?\n>\n\n apache-2.2.14nb1\n\n> Which version of CGI.pm is used by web server?[3]\n>\n\n$CGI::revision = '$Id: CGI.pm,v 1.263 2009/02/11 16:56:37 lstein Exp $';\n$CGI::VERSION='3.43';\n\n\n\n\n> Try to view source, or use different web browser that doesn't do\n> strict XML validation to find the source of this error.\n>\n\nI was using firefox 3.6-2.\nTrying with Konqueror Version 4.3.4 (KDE 4.3.4) Using KDE 4.3.4 (KDE\n4.3.4) I dont get the error but it does not list my projectts. I get\nthis message on the page.\n\n=================================================\n\nprojects /\n\n\n 404 - No projects found\n\nOPMLTXT\nOK\nThe requested URL /cgi-bin/gitweb.cgi was not found on this server.\n\n======================================================\n\nthis page is shown when I take the URL\n\nhttp://172.16.3.27/cgi-bin/gitweb.cgi\n\nbut I have the projectroot configure in gitweb.conf and there is a git\nproject in that location.\n\n# cat /usr/pkg/etc/gitweb.conf | grep projectroot\nour $projectroot = \"/Backup1/Data/git-repositories\";\n# ls -l /Backup1/Data/git-repositories\ntotal 0\ndrwxr-xr-x  1 root  wheel  0 Feb 11 10:40 systems-configuration\n# ls -l /Backup1/Data/git-repositories/systems-configuration/.git/\ntotal 0\n-rwxr-x---  1 root  wheel  393 Feb 11 11:03 COMMIT_EDITMSG\n-rwxr-x---  1 root  wheel   23 Feb 11 10:40 HEAD\n-rwxr-x---  1 root  wheel   92 Feb 11 10:40 config\n-rwxr-x---  1 root  wheel   73 Feb 11 10:40 description\ndrwxr-x---  1 root  wheel    0 Feb 11 10:40 hooks\n-rwxr-x---  1 root  wheel  120 Feb 11 11:29 index\ndrwxr-x---  1 root  wheel    0 Feb 11 10:40 info\ndrwxr-x---  1 root  wheel    0 Feb 11 10:58 logs\ndrwxr-x---  1 root  wheel    0 Feb 11 11:03 objects\ndrwxr-x---  1 root  wheel    0 Feb 11 10:40 refs\n#\n\n\n> If everything else fals, you can always edit gitweb.cgi to comment out\n> content-type negotiation, to always serve as text/html mimetype -\n> which should torn off XML validation, as below:\n>\n>        my $content_type;\n>        # require explicit support from the UA if we are to send the page as\n>        # 'application/xhtml+xml', otherwise send it as plain old 'text/html'.\n>        # we have to do this because MSIE sometimes globs '*/*', pretending to\n>        # support xhtml+xml but choking when it gets what it asked for.\n>        # Disable content-type negotiation when caching (use mimetype good for all).\n>        #if (defined $cgi->http('HTTP_ACCEPT') &&\n>        #    $cgi->http('HTTP_ACCEPT') =~ m/(,|;|\\s|^)application\\/xhtml\\+xml(,|;|\\s|$)/ &&\n>        #    $cgi->Accept('application/xhtml+xml') != 0) {\n>        #       $content_type = 'application/xhtml+xml';\n>        #} else {\n>                $content_type = 'text/html';\n>        #}\n>\n>\n\nyes I tried it and the first error disappears from firefor and now I\nget the same error from konqueror in firefox too\n\nWhat could be the trouble?\n\nThanks\n\n--Siju\n"},{"id":"134313","messageId":"201002121148.37761.jnareb@gmail.com","threadId":"22612","inReplyTo":"b713df2c1002112023k757a54faq933b9a9bdacc7d1c@mail.gmail.com","subject":"Re: XML Parsing Error: junk after document element","fromName":"Jakub Narebski","fromEmail":"jnareb@gmail.com","sentAt":"2010-02-12T10:48:33Z","receivedAt":"2010-02-12T10:48:33Z","isPatch":false,"sender":{"key":"jnareb@gmail.com","avatar":"https://avatars.githubusercontent.com/u/2706?v=4"},"body":"On Fri, Feb 12, 2010, Siju George wrote:\n> On Thu, Feb 11, 2010 at 4:31 PM, Jakub Narebski <jnareb@gmail.com> wrote:\n> >\n> > Which version of gitweb?[1]\n> \n> gitweb-1.6.0.6  - all packages are from pkgsrc on DragonFly BSD\n> v2.5.1.672.gf81ef-DEVELOPMENT #17: Tue Feb\n> \n> > Which version of git?[2]\n> \n> scmgit-1.6.6.1\n\nI don't think that difference in version numbers would be the problem.\n\nIs this a version of git that gitweb (or to be more accurate web server)\nsees?  Take a look at HTML source of page returned by gitweb, and at\nthe top there would be 'git core binaries version' in comment, and\n'git/<version>' in the meta generator tag (this can be seen also in\n\"View Page Info\" view, not only in \"View Page Source\").\n \n> > What web server?\n>  \n>  apache-2.2.14nb1\n>\n> > Which version of CGI.pm is used by web server?[3]\n> >\n> \n> $CGI::revision = '$Id: CGI.pm,v 1.263 2009/02/11 16:56:37 lstein Exp $';\n> $CGI::VERSION='3.43';\n\nThis should not be a problem then.\n\n> > Try to view source, or use different web browser that doesn't do\n> > strict XML validation to find the source of this error.\n> >\n> \n> I was using firefox 3.6-2.\n> Trying with Konqueror Version 4.3.4 (KDE 4.3.4) Using KDE 4.3.4 (KDE\n> 4.3.4) I dont get the error but it does not list my projectts. I get\n> this message on the page.\n> \n> =================================================\n> \n> projects /\n> \n> \n>  404 - No projects found\n> \n> OPMLTXT\n> OK\n> The requested URL /cgi-bin/gitweb.cgi was not found on this server.\n\nYou have two problems here.  First is that gitweb doesn't find your\nprojects because of problem with filesystem permissions.\n\nSecond is what it looks misconfigured web server.  The second part,\nstarting after [OPML][TXT] is not from gitweb, but from a web server.\nIt looks like you have either two web servers, or two parts of web\nserver configuration, or some worker of web server that didn't get\nupdated configuration, and it doesn't have permissions to access\ngitweb.cgi or doesn't have configuration to know what to do with\nthe above URL.\n\nWhat might help is, if you can, to restart your web server, something\nlike\n\n  # apachectl restart           # as root\n\n(I don't know what the proper command would be on DragonFlyBSD).\n\n> ======================================================\n> \n> this page is shown when I take the URL\n> \n> http://172.16.3.27/cgi-bin/gitweb.cgi\n> \n> but I have the projectroot configure in gitweb.conf and there is a git\n> project in that location.\n> \n> # cat /usr/pkg/etc/gitweb.conf | grep projectroot\n> our $projectroot = \"/Backup1/Data/git-repositories\";\n> # ls -l /Backup1/Data/git-repositories\n> total 0\n> drwxr-xr-x  1 root  wheel  0 Feb 11 10:40 systems-configuration\n> # ls -l /Backup1/Data/git-repositories/systems-configuration/.git/\n> total 0\n> -rwxr-x---  1 root  wheel  393 Feb 11 11:03 COMMIT_EDITMSG\n> -rwxr-x---  1 root  wheel   23 Feb 11 10:40 HEAD\n> -rwxr-x---  1 root  wheel   92 Feb 11 10:40 config\n> -rwxr-x---  1 root  wheel   73 Feb 11 10:40 description\n> drwxr-x---  1 root  wheel    0 Feb 11 10:40 hooks\n> -rwxr-x---  1 root  wheel  120 Feb 11 11:29 index\n> drwxr-x---  1 root  wheel    0 Feb 11 10:40 info\n> drwxr-x---  1 root  wheel    0 Feb 11 10:58 logs\n> drwxr-x---  1 root  wheel    0 Feb 11 11:03 objects\n> drwxr-x---  1 root  wheel    0 Feb 11 10:40 refs\n\nApache web server usually runs as apache:apache (user apache, group\napache); it most certainly *not* run as root, or is in wheel\n(root-like) group.  So as you can see web server, and gitweb which\nruns with the same uid and guid, doesn't have permissions to read\n(access) your repositories.\n\nYou need to fix permissions, perhaps (as it seems to be your private\nmachine and private gitweb) by setting group to some common group\nbetween you and web server and giving sticky group bit, or making\ngit repository world-readable: take a look at \"shared repository\"\nthing: see description of core.sharedRepository config variable\n(so that git wouldn't take world-readable permissions back).\n\nBTW. what are you doing working as root?\n\n> What could be the trouble?\n\nFilesystem permissions on git repository, and some strange error in\nweb server configuration.  Unfortunately I haven't got a clue what\nto do about the latter.\n\n-- \nJakub Narebski\nPoland\n"},{"id":"134854","messageId":"b713df2c1002170146xbf484b6u58e3babf247dd6de@mail.gmail.com","threadId":"22612","inReplyTo":"201002121148.37761.jnareb@gmail.com","subject":"Re: XML Parsing Error: junk after document element","fromName":"Siju George","fromEmail":"sgeorge.ml@gmail.com","sentAt":"2010-02-17T09:46:54Z","receivedAt":"2010-02-17T09:46:54Z","isPatch":false,"sender":{"key":"sgeorge.ml@gmail.com","avatar":null},"body":"On Fri, Feb 12, 2010 at 4:18 PM, Jakub Narebski <jnareb@gmail.com> wrote:\n> You have two problems here.  First is that gitweb doesn't find your\n> projects because of problem with filesystem permissions.\n>\n> Second is what it looks misconfigured web server.  The second part,\n> starting after [OPML][TXT] is not from gitweb, but from a web server.\n> It looks like you have either two web servers, or two parts of web\n> server configuration, or some worker of web server that didn't get\n> updated configuration, and it doesn't have permissions to access\n> gitweb.cgi or doesn't have configuration to know what to do with\n> the above URL.\n>\n\nHi once i changed the permissions of the git repositories every thing\nis looking fine :-)\n\nThanks\n\n--Siju\n"}]}