{"thread":{"id":"32538","subject":"Trying to understand the web dav details","startedAt":"2013-01-06T01:32:09Z","lastAt":"2013-01-06T06:20:56Z","messageCount":5,"participants":["Jason Pyeron","Jeff King","Pyeron, Jason J CTR (US)"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"206078","messageId":"151C51E6FBD848739A43A2C17D78DD68@black","threadId":"32538","inReplyTo":null,"subject":"Trying to understand the web dav details","fromName":"Jason Pyeron","fromEmail":"jpyeron@pdinc.us","sentAt":"2013-01-06T01:32:09Z","receivedAt":"2013-01-06T01:32:09Z","isPatch":false,"sender":{"key":"jpyeron@pdinc.us","avatar":"https://gravatar.com/avatar/c2e53452caa53d940768a1ffc9cf76196d851b9b534b7a39cd39852a70a0508f?d=mp&s=160"},"body":"When doing a clone by https (reverse proxied to http) the first request is\n\nGET /git/project/info/refs?service=git-upload-pack\n\nHow does the ?service=xxxx get translated in to the action performed on the web\nserver?\n\nI ask because I have 2 projects, one works the other does not.\n\nI am using httpd-2.0.52-49.ent.centos4 and git-1.7.9.6-1.\n\nI am not even sure what to tell more about or where to look next.\n\n--\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n-                                                               -\n- Jason Pyeron                      PD Inc. http://www.pdinc.us -\n- Principal Consultant              10 West 24th Street #100    -\n- +1 (443) 269-1555 x333            Baltimore, Maryland 21218   -\n-                                                               -\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\nThis message is copyright PD Inc, subject to license 20080407P00.\n"},{"id":"206081","messageId":"20130106041942.GB4879@sigill.intra.peff.net","threadId":"32538","inReplyTo":"151C51E6FBD848739A43A2C17D78DD68@black","subject":"Re: Trying to understand the web dav details","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-01-06T04:19:42Z","receivedAt":"2013-01-06T04:19:42Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sat, Jan 05, 2013 at 08:32:09PM -0500, Jason Pyeron wrote:\n\n> When doing a clone by https (reverse proxied to http) the first request is\n> \n> GET /git/project/info/refs?service=git-upload-pack\n> \n> How does the ?service=xxxx get translated in to the action performed on the web\n> server?\n\nIf you are using the git-http-backend CGI, it will interpret the service\ntag and start smart-http. See \"git help http-backend\" for details on\nplugging it into Apache.\n\nCloning/fetching does not use DAV at all; it is only for non-smart\npushing (and I would not recommend setting it up; the smart protocol\nspoken by git-http-backend does pushing much more efficiently, and is\nbetter maintained).\n\n> I ask because I have 2 projects, one works the other does not.\n> \n> I am using httpd-2.0.52-49.ent.centos4 and git-1.7.9.6-1.\n> \n> I am not even sure what to tell more about or where to look next.\n\nIf you haven't set up git-http-backend, then git is just going to fetch\nthe remote repo's data directly over http. So the usual advice for\naccessing something via http would apply (check the server's access and\nerror logs, try hitting it with a web browser, etc).\n\nIf you set GIT_CURL_VERBOSE=1 in your environment, git will spew a lot\nof debugging information about what http requests it is making. That\nmight give you a clue (you haven't said anything about what does not\nwork, so I can't be more specific).\n\n-Peff\n"},{"id":"206083","messageId":"871B6C10EBEFE342A772D1159D1320853A011871@umechphj.easf.csd.disa.mil","threadId":"32538","inReplyTo":"20130106041942.GB4879@sigill.intra.peff.net","subject":"RE: Trying to understand the web dav details","fromName":"Pyeron, Jason J CTR (US)","fromEmail":"jason.j.pyeron.ctr@mail.mil","sentAt":"2013-01-06T04:49:57Z","receivedAt":"2013-01-06T04:49:57Z","isPatch":false,"sender":{"key":"jason.j.pyeron.ctr@mail.mil","avatar":null},"body":"> -----Original Message-----\n> From: Jeff King\n> Sent: Saturday, January 05, 2013 11:20 PM\n> \n> On Sat, Jan 05, 2013 at 08:32:09PM -0500, Jason Pyeron wrote:\n> \n> > When doing a clone by https (reverse proxied to http) the first\n> request is\n> >\n> > GET /git/project/info/refs?service=git-upload-pack\n> >\n> > How does the ?service=xxxx get translated in to the action performed\n> on the web\n> > server?\n> \n> If you are using the git-http-backend CGI, it will interpret the\n> service\n\nNo, using plain jane http and webdav. This server is not \"allowed\" to use cgi processes.\n\n> tag and start smart-http. See \"git help http-backend\" for details on\n> plugging it into Apache.\n> \n> Cloning/fetching does not use DAV at all; it is only for non-smart\n> pushing (and I would not recommend setting it up; the smart protocol\n> spoken by git-http-backend does pushing much more efficiently, and is\n> better maintained).\n> \n> > I ask because I have 2 projects, one works the other does not.\n\nShould have said I get a 404 versus 200, see below.\n\n> >\n> > I am using httpd-2.0.52-49.ent.centos4 and git-1.7.9.6-1.\n> >\n> > I am not even sure what to tell more about or where to look next.\n> \n> If you haven't set up git-http-backend, then git is just going to fetch\n> the remote repo's data directly over http. So the usual advice for\n> accessing something via http would apply (check the server's access and\n> error logs, try hitting it with a web browser, etc).\n> \n> If you set GIT_CURL_VERBOSE=1 in your environment, git will spew a lot\n\nThat’s what I did before mailing out the first time. I tried to summarize the contents, but I will paste the relevant portions below.\n\n> of debugging information about what http requests it is making. That\n> might give you a clue (you haven't said anything about what does not\n> work, so I can't be more specific).\n\nBelow are two traces, the first one is the one that does not work, the second does. I cannot see any differences on the web server for the two directory trees.\n\n**************************************************************************\n**************************************************************************\n**************************************************************************\n**************************************************************************\n\njason.pyeron@localhost ~/tmp\n$ GIT_TRACE=1 GIT_CURL_VERBOSE=1 git clone https://server/git/project-x\ntrace: built-in: git 'clone' 'https://server/git/project-x'\nCloning into 'project-x'...\ntrace: run_command: 'git-remote-https' 'origin' 'https://server/git/project-x'\n* Couldn't find host server in the .netrc file; using defaults\n* About to connect() to proxy 214.36.0.135 port 8080 (#0)\n*   Trying 214.36.0.135...\n* 0x80076a48 is at send pipe head!\n* STATE: CONNECT => WAITCONNECT handle 0x8007f3c0; (connection #0)\n* Connected to 214.36.0.135 (214.36.0.135) port 8080 (#0)\n* Connected to 214.36.0.135 (214.36.0.135) port 8080 (#0)\n* Establish HTTP proxy tunnel to server:443\n> CONNECT server:443 HTTP/1.1\nHost: server:443\nUser-Agent: git/1.7.9\nProxy-Connection: Keep-Alive\nPragma: no-cache\n\n* STATE: WAITCONNECT => WAITPROXYCONNECT handle 0x8007f3c0; (connection #0)\n* Multi mode finished polling for response from proxy CONNECT\n< HTTP/1.1 200 Connection established\n<\n* Proxy replied OK to CONNECT request\n* successfully set certificate verify locations:\n*   CAfile: /usr/ssl/certs/ca-bundle.crt\n  CApath: none\n* STATE: WAITPROXYCONNECT => WAITCONNECT handle 0x8007f3c0; (connection #0)\n* STATE: WAITCONNECT => PROTOCONNECT handle 0x8007f3c0; (connection #0)\n* SSL connection using DHE-RSA-AES256-SHA\n* Server certificate:\n*        subject: C=US; ST=Maryland; O=PD Inc; OU=Intranet; CN=server; emailAddress=security@pdinc.us\n*        start date: 201\n*        expire date: 201\n*        issuer: C=U\n*        SSL certificate verify result: self signed certificate in certificate chain (19), continuing anyway.\n* STATE: PROTOCONNECT => DO handle 0x8007f3c0; (connection #0)\n> GET /git/project-x/info/refs?service=git-upload-pack HTTP/1.1\nUser-Agent: git/1.7.9\nHost: server\nAccept: */*\nPragma: no-cache\n\n* STATE: DO => DO_DONE handle 0x8007f3c0; (connection #0)\n* STATE: DO_DONE => WAITPERFORM handle 0x8007f3c0; (connection #0)\n* STATE: WAITPERFORM => PERFORM handle 0x8007f3c0; (connection #0)\n* additional stuff not fine /usr/src/ports/curl/curl-7.27.0-1/src/curl-7.27.0/lib/transfer.c:1037: 0 0\n* additional stuff not fine /usr/src/ports/curl/curl-7.27.0-1/src/curl-7.27.0/lib/transfer.c:1037: 0 0\n* The requested URL returned error: 404 Not Found\n* Closing connection #0\n* Couldn't find host server in the .netrc file; using defaults\n* About to connect() to proxy 214.36.0.135 port 8080 (#0)\n*   Trying 214.36.0.135...\n* 0x80076a48 is at send pipe head!\n* STATE: CONNECT => WAITCONNECT handle 0x80139640; (connection #0)\n* Connected to 214.36.0.135 (214.36.0.135) port 8080 (#0)\n* Connected to 214.36.0.135 (214.36.0.135) port 8080 (#0)\n* Establish HTTP proxy tunnel to server:443\n> CONNECT server:443 HTTP/1.1\nHost: server:443\nUser-Agent: git/1.7.9\nProxy-Connection: Keep-Alive\nPragma: no-cache\n\n* STATE: WAITCONNECT => WAITPROXYCONNECT handle 0x80139640; (connection #0)\n* Multi mode finished polling for response from proxy CONNECT\n< HTTP/1.1 200 Connection established\n<\n* Proxy replied OK to CONNECT request\n* successfully set certificate verify locations:\n*   CAfile: /usr/ssl/certs/ca-bundle.crt\n  CApath: none\n* SSL re-using session ID\n* STATE: WAITPROXYCONNECT => WAITCONNECT handle 0x80139640; (connection #0)\n* STATE: WAITCONNECT => PROTOCONNECT handle 0x80139640; (connection #0)\n* SSL connection using DHE-RSA-AES256-SHA\n* Server certificate:\n*        subject: C=US; ST=Maryland; O=PD Inc; OU=Intranet; CN=server; emailAddress=security@pdinc.us\n*        start date: 201\n*        expire date: 201\n*        issuer: C=U\n*        SSL certificate verify result: self signed certificate in certificate chain (19), continuing anyway.\n* STATE: PROTOCONNECT => DO handle 0x80139640; (connection #0)\n> GET /git/project-x/info/refs HTTP/1.1\nUser-Agent: git/1.7.9\nHost: server\nAccept: */*\nPragma: no-cache\n\n* STATE: DO => DO_DONE handle 0x80139640; (connection #0)\n* STATE: DO_DONE => WAITPERFORM handle 0x80139640; (connection #0)\n* STATE: WAITPERFORM => PERFORM handle 0x80139640; (connection #0)\n* additional stuff not fine /usr/src/ports/curl/curl-7.27.0-1/src/curl-7.27.0/lib/transfer.c:1037: 0 0\n* additional stuff not fine /usr/src/ports/curl/curl-7.27.0-1/src/curl-7.27.0/lib/transfer.c:1037: 0 0\n* additional stuff not fine /usr/src/ports/curl/curl-7.27.0-1/src/curl-7.27.0/lib/transfer.c:1037: 0 0\n* additional stuff not fine /usr/src/ports/curl/curl-7.27.0-1/src/curl-7.27.0/lib/transfer.c:1037: 0 0\n* additional stuff not fine /usr/src/ports/curl/curl-7.27.0-1/src/curl-7.27.0/lib/transfer.c:1037: 0 0\n* The requested URL returned error: 404 Not Found\n* Closing connection #0\nfatal: https://server/git/project-x/info/refs not found: did you run git update-server-info on the server?\n\n**************************************************************************\n**************************************************************************\n**************************************************************************\n**************************************************************************\n\njason.pyeron@localhost ~/tmp\n$ GIT_TRACE=1 GIT_CURL_VERBOSE=1 git clone https://server/git/test\ntrace: built-in: git 'clone' 'https://server/git/test'\nCloning into 'test'...\ntrace: run_command: 'git-remote-https' 'origin' 'https://server/git/test'\n* Couldn't find host server in the .netrc file; using defaults\n* About to connect() to proxy 214.36.0.135 port 8080 (#0)\n*   Trying 214.36.0.135...\n* 0x80076968 is at send pipe head!\n* STATE: CONNECT => WAITCONNECT handle 0x8007f2c8; (connection #0)\n* Connected to 214.36.0.135 (214.36.0.135) port 8080 (#0)\n* Connected to 214.36.0.135 (214.36.0.135) port 8080 (#0)\n* Establish HTTP proxy tunnel to server:443\n> CONNECT server:443 HTTP/1.1\nHost: server:443\nUser-Agent: git/1.7.9\nProxy-Connection: Keep-Alive\nPragma: no-cache\n\n* STATE: WAITCONNECT => WAITPROXYCONNECT handle 0x8007f2c8; (connection #0)\n* Multi mode finished polling for response from proxy CONNECT\n< HTTP/1.1 200 Connection established\n<\n* Proxy replied OK to CONNECT request\n* successfully set certificate verify locations:\n*   CAfile: /usr/ssl/certs/ca-bundle.crt\n  CApath: none\n* STATE: WAITPROXYCONNECT => WAITCONNECT handle 0x8007f2c8; (connection #0)\n* STATE: WAITCONNECT => PROTOCONNECT handle 0x8007f2c8; (connection #0)\n* SSL connection using DHE-RSA-AES256-SHA\n* Server certificate:\n*        subject: C=US; ST=Maryland; O=PD Inc; OU=Intranet; CN=server; emailAddress=security@pdinc.us\n*        start date: 201\n*        expire date: 201\n*        issuer: C=U\n*        SSL certificate verify result: self signed certificate in certificate chain (19), continuing anyway.\n* STATE: PROTOCONNECT => DO handle 0x8007f2c8; (connection #0)\n> GET /git/test/info/refs?service=git-upload-pack HTTP/1.1\nUser-Agent: git/1.7.9\nHost: server\nAccept: */*\nPragma: no-cache\n\n* STATE: DO => DO_DONE handle 0x8007f2c8; (connection #0)\n* STATE: DO_DONE => WAITPERFORM handle 0x8007f2c8; (connection #0)\n* STATE: WAITPERFORM => PERFORM handle 0x8007f2c8; (connection #0)\n* additional stuff not fine /usr/src/ports/curl/curl-7.27.0-1/src/curl-7.27.0/lib/transfer.c:1037: 0 0\n* additional stuff not fine /usr/src/ports/curl/curl-7.27.0-1/src/curl-7.27.0/lib/transfer.c:1037: 0 0\n* HTTP 1.1 or later with persistent connection, pipelining supported\n< HTTP/1.1 200 OK\n< Date: Sun, 06 Jan 2013 04:26:14 GMT\n< Server: Apache/2.0.52 (CentOS)\n< Last-Modified: Fri, 02 Nov 2012 05:05:55 GMT\n< ETag: \"714064-3b-172852c0\"\n< Accept-Ranges: bytes\n< Content-Length: 59\n< Content-Type: text/plain; charset=UTF-8\n< Connection: close\n<\n* STATE: PERFORM => DONE handle 0x8007f2c8; (connection #0)\n* Closing connection #0\n* Couldn't find host server in the .netrc file; using defaults\n* About to connect() to proxy 214.36.0.135 port 8080 (#0)\n*   Trying 214.36.0.135...\n* 0x80076968 is at send pipe head!\n* STATE: CONNECT => WAITCONNECT handle 0x801395e8; (connection #0)\n* Connected to 214.36.0.135 (214.36.0.135) port 8080 (#0)\n* Connected to 214.36.0.135 (214.36.0.135) port 8080 (#0)\n* Establish HTTP proxy tunnel to server:443\n> CONNECT server:443 HTTP/1.1\nHost: server:443\nUser-Agent: git/1.7.9\nProxy-Connection: Keep-Alive\nPragma: no-cache\n\n* STATE: WAITCONNECT => WAITPROXYCONNECT handle 0x801395e8; (connection #0)\n* Multi mode finished polling for response from proxy CONNECT\n< HTTP/1.1 200 Connection established\n<\n* Proxy replied OK to CONNECT request\n* successfully set certificate verify locations:\n*   CAfile: /usr/ssl/certs/ca-bundle.crt\n  CApath: none\n* SSL re-using session ID\n* STATE: WAITPROXYCONNECT => WAITCONNECT handle 0x801395e8; (connection #0)\n* STATE: WAITCONNECT => PROTOCONNECT handle 0x801395e8; (connection #0)\n* SSL connection using DHE-RSA-AES256-SHA\n* Server certificate:\n*        subject: C=US; ST=Maryland; O=PD Inc; OU=Intranet; CN=server; emailAddress=security@pdinc.us\n*        start date: 201\n*        expire date: 201\n*        issuer: C=U\n*        SSL certificate verify result: self signed certificate in certificate chain (19), continuing anyway.\n* STATE: PROTOCONNECT => DO handle 0x801395e8; (connection #0)\n> GET /git/test/HEAD HTTP/1.1\n"},{"id":"206085","messageId":"20130106053807.GA8551@sigill.intra.peff.net","threadId":"32538","inReplyTo":"871B6C10EBEFE342A772D1159D1320853A011871@umechphj.easf.csd.disa.mil","subject":"Re: Trying to understand the web dav details","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2013-01-06T05:38:07Z","receivedAt":"2013-01-06T05:38:07Z","isPatch":false,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Sun, Jan 06, 2013 at 04:49:57AM +0000, Pyeron, Jason J CTR (US) wrote:\n\n> > > How does the ?service=xxxx get translated in to the action\n> > > performed on the web server?\n> > \n> > If you are using the git-http-backend CGI, it will interpret the\n> > service\n> \n> No, using plain jane http and webdav. This server is not \"allowed\" to\n> use cgi processes.\n\nThen the service parameter should be ignored by your webserver, and it\nshould just serve the info/refs file from the repository on the\nfilesystem. And you are stuck using WebDAV for push.\n\n> > GET /git/project-x/info/refs HTTP/1.1\n> [...]\n> * The requested URL returned error: 404 Not Found\n\nDoes the info/refs file exist in the project-x repository?\n\n> fatal: https://server/git/project-x/info/refs not found: did you run git update-server-info on the server?\n\nDid you?\n\nIf you can't run any git programs on the server at all (and it sounds\nlike that may be the case), you'll need to run it locally before putting\nthe repository data on the server.\n\nOnce you have WebDAV set up for pushing, it will update the info/refs\nfile for each push. But if you are initially seeding the server with\nrsync or a tarfile, you'll want to make sure it has an up-to-date\ninfo/refs file.\n\n-Peff\n"},{"id":"206109","messageId":"A18DA90EFF3743E5B580CBC68F1C9F7C@black","threadId":"32538","inReplyTo":"20130106053807.GA8551@sigill.intra.peff.net","subject":"RE: Trying to understand the web dav details","fromName":"Jason Pyeron","fromEmail":"jpyeron@pdinc.us","sentAt":"2013-01-06T06:20:56Z","receivedAt":"2013-01-06T06:20:56Z","isPatch":false,"sender":{"key":"jpyeron@pdinc.us","avatar":"https://gravatar.com/avatar/c2e53452caa53d940768a1ffc9cf76196d851b9b534b7a39cd39852a70a0508f?d=mp&s=160"},"body":"Ignore everything below, it was a case sensitive typo. It always worked it.\n\n> -----Original Message-----\n> From: Jeff King\n> Sent: Sunday, January 06, 2013 0:38\n> \n> On Sun, Jan 06, 2013 at 04:49:57AM +0000, Pyeron, Jason J CTR \n> (US) wrote:\n> \n> > > > How does the ?service=xxxx get translated in to the action \n> > > > performed on the web server?\n> > > \n> > > If you are using the git-http-backend CGI, it will interpret the \n> > > service\n> > \n> > No, using plain jane http and webdav. This server is not \n> \"allowed\" to \n> > use cgi processes.\n> \n> Then the service parameter should be ignored by your \n> webserver, and it should just serve the info/refs file from \n> the repository on the filesystem. And you are stuck using \n> WebDAV for push.\n> \n> > > GET /git/project-x/info/refs HTTP/1.1\n> > [...]\n> > * The requested URL returned error: 404 Not Found\n> \n> Does the info/refs file exist in the project-x repository?\n\nYes.\n\n> \n> > fatal: https://server/git/project-x/info/refs not found: \n> did you run git update-server-info on the server?\n> \n> Did you?\n> \n\nMany times.\n\n> If you can't run any git programs on the server at all (and \n> it sounds like that may be the case), you'll need to run it \n> locally before putting the repository data on the server.\n> \n> Once you have WebDAV set up for pushing, it will update the \n> info/refs file for each push. But if you are initially \n> seeding the server with rsync or a tarfile, you'll want to \n\nSeeding it seems to work, it is the bare init that seems to be failing. Might be\non to something there.\n\n> make sure it has an up-to-date info/refs file.\n\nHere is the create script:\n\n#!/bin/bash\n\nif [ $# != 1 ]; then\nexit 1;\nfi\n\nif [ -e \"$1\" ]; then\nexit 2;\nfi\n\nmkdir \"$1\"\ncd \"$1\"\ngit init --bare\ncp hooks/post-update.sample hooks/post-update\nchmod +x hooks/post-update\ngit update-server-info\n\n\n\n\n--\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\n-                                                               -\n- Jason Pyeron                      PD Inc. http://www.pdinc.us -\n- Principal Consultant              10 West 24th Street #100    -\n- +1 (443) 269-1555 x333            Baltimore, Maryland 21218   -\n-                                                               -\n-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-\nThis message is copyright PD Inc, subject to license 20080407P00.\n\n \n"}]}