Bug #15680 BK checkout via HTTP not working
Submitted: 12 Dec 2005 13:21 Modified: 13 Dec 2005 16:59
Reporter: Sebastian Nohn Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Documentation Severity:S3 (Non-critical)
Version:- OS:Linux (Linux)
Assigned to: Stefan Hinz CPU Architecture:Any

[12 Dec 2005 13:21] Sebastian Nohn
Description:
This is is documentation/configuration Issue. The category is missing, so I filed it under "MySQL Server":

I installed bk-client like described under http://dev.mysql.com/doc/refman/5.0/en/installing-source-tree.html and tried a checkout via HTTP, but it does not work (Error from sfioball: "Bad URL").

How to repeat:
$ wget http://www.bitmover.com/bk-client.shar
$ sh bk-client.shar
$ cd bk_client-1.1
$ make all
$ PATH=$PWD:$PATH
$ sfioball -r+ http://mysql.bkbits.net/mysql-5.0 mysql-5.0
Bad URL
[13 Dec 2005 11:13] Valeriy Kravchuk
Thank you for a problem report. Please, try to use http://mysql.bkbits.net:8080/mysql-5.0 (explict nondefault port added) and inform about hte results. See http://mysql.bkbits.net/.
[13 Dec 2005 11:57] Sebastian Nohn
$ sfioball -r+ http://mysql.bkbits.net:8080/mysql-5.0 mysql-5.0
Bad URL
[13 Dec 2005 12:06] Valeriy Kravchuk
Sorry, my fault. Not http:// if you are not using firewall, but bk://. Please, read the documentation carefully (http://dev.mysql.com/doc/refman/5.0/en/installing-source-tree.html):

"shell> sfioball -r+ bk://mysql.bkbits.net/mysql-5.0 mysql-5.0"

So, I've just performed the following (after getting and building free client):

[openxs@Fedora bk_client-1.1]$ sfioball -r+ bk://mysql.bkbits.net/mysql-5.0 mysql-5.0
OK-root OK
BitKeeper/tmp/ChangeLog
.cvsignore
COPYING
Makefile.am
README
configure.in
BUILD/.cvsignore
BUILD/FINISH.sh
BUILD/Makefile.am
BUILD/SETUP.sh
BUILD/autorun.sh
BUILD/check-cpu
BUILD/cleanup
BUILD/compile-alpha
...

So, it works just as described in the manual. With explicit port :8080 added it also works...
[13 Dec 2005 12:36] Sebastian Nohn
reopening. The documentation says:

------------------------- cut here -------------------------
If you are behind a firewall and can only initiate HTTP connections, you can also use BitKeeper via HTTP.

[...]

Replace the bk:// with http:// when copying a repository. Example:

shell> sfioball -r+ http://mysql.bkbits.net/mysql-5.0 mysql-5.0
------------------------- cut here -------------------------

I am behind a firewall and I want to use it the way described and it does NOT work like described!
[13 Dec 2005 12:42] Valeriy Kravchuk
What is the value of your http_proxy environment variable? echo $http_proxy?
[13 Dec 2005 13:55] Sebastian Nohn
The way, I understand the documentation, a HTTP proxy is not required unless it's needed to connect to the internet via HTTP. Would'nt make sense either.

---------------------------- without proxy ----------------------------
[snohn@ligdev2 install_temp]$ strace sfioball -r+ http://mysql.bkbits.net:8080/mysql-5.0 mysql-5.0
execve("/home/snohn/install_temp/bk_client-1.1/sfioball", ["sfioball", "-r+", "http://mysql.bkbits.net:8080/mysql-5.0", "mysql-5.0"], [/* 30 vars */]) = 0
uname({sys="Linux", node="ligdev2", ...}) = 0
brk(0)                                  = 0x9b3e000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=21878, ...}) = 0
old_mmap(NULL, 21878, PROT_READ, MAP_PRIVATE, 3, 0) = 0xf6ffa000
close(3)                                = 0
open("/lib/tls/libc.so.6", O_RDONLY)    = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\20\17\267"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1525032, ...}) = 0
old_mmap(0xb5c000, 1223868, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb5c000
mprotect(0xc80000, 27836, PROT_NONE)    = 0
old_mmap(0xc81000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x124000) = 0xc81000
old_mmap(0xc85000, 7356, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xc85000
close(3)                                = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf6ff9000
mprotect(0xc81000, 8192, PROT_READ)     = 0
mprotect(0xb58000, 4096, PROT_READ)     = 0
set_thread_area({entry_number:-1 -> 6, base_addr:0xf6ff9aa0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
munmap(0xf6ffa000, 21878)               = 0
write(2, "Bad URL\n", 8Bad URL
)                = 8
exit_group(1)                           = ?
---------------------------- without proxy ----------------------------

---------------------------- with proxy ----------------------------
$ export http_proxy=http://localhost:8080/
[snohn@ligdev2 install_temp]$ strace sfioball -r+ http://mysql.bkbits.net:8080/mysql-5.0 mysql-5.0
execve("/home/snohn/install_temp/bk_client-1.1/sfioball", ["sfioball", "-r+", "http://mysql.bkbits.net:8080/mysql-5.0", "mysql-5.0"], [/* 31 vars */]) = 0
uname({sys="Linux", node="ligdev2", ...}) = 0
brk(0)                                  = 0x9188000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=21878, ...}) = 0
old_mmap(NULL, 21878, PROT_READ, MAP_PRIVATE, 3, 0) = 0xf6ffa000
close(3)                                = 0
open("/lib/tls/libc.so.6", O_RDONLY)    = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\20\17\267"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1525032, ...}) = 0
old_mmap(0xb5c000, 1223868, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb5c000
mprotect(0xc80000, 27836, PROT_NONE)    = 0
old_mmap(0xc81000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x124000) = 0xc81000
old_mmap(0xc85000, 7356, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xc85000
close(3)                                = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf6ff9000
mprotect(0xc81000, 8192, PROT_READ)     = 0
mprotect(0xb58000, 4096, PROT_READ)     = 0
set_thread_area({entry_number:-1 -> 6, base_addr:0xf6ff9aa0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
munmap(0xf6ffa000, 21878)               = 0
write(2, "Bad URL\n", 8Bad URL
)                = 8
exit_group(1)                           = ?
---------------------------- with proxy ----------------------------
[13 Dec 2005 14:10] Valeriy Kravchuk
What exact Linux distribution do you use (uname -a, cat /etc/issue)? Are you sure that your HTTP proxy does work properly? Have you tried without it? Please, remember, that bk:// should be used in URL when you are not connecting through proxy server.

I've tried with plain old Linux Fedora Core 1, without proxies, and, as you can see from my previous comment, it just work. Plese, describe, what exactly should I do to get that "Bad URL" message.
[13 Dec 2005 14:21] Sebastian Nohn
Again: This is NOT an http proxy issue. Please look at the strace output. sfioball is not even trying to connect, it's just complaining about a "bad url".

Linux is Fedora Core 3
[13 Dec 2005 14:40] Valeriy Kravchuk
Please, try without proxy and with bk://... in the URL, just as I did. Inform about the results. I have to figure out where is the bug, if any (in documentation, in client code, or in your setup, maybe).
[13 Dec 2005 14:45] Sebastian Nohn
$ strace sfioball -r+ bk://mysql.bkbits.net:8080/mysql-5.0 mysql-5.0
execve("/home/snohn/install_temp/bk_client-1.1/sfioball", ["sfioball", "-r+", "bk://mysql.bkbits.net:8080/mysql-5.0", "mysql-5.0"], [/* 31 vars */]) = 0
uname({sys="Linux", node="ligdev2", ...}) = 0
brk(0)                                  = 0x8b2d000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat64(3, {st_mode=S_IFREG|0644, st_size=21878, ...}) = 0
old_mmap(NULL, 21878, PROT_READ, MAP_PRIVATE, 3, 0) = 0xf6ffa000
close(3)                                = 0
open("/lib/tls/libc.so.6", O_RDONLY)    = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0\3\0\1\0\0\0\20\17\267"..., 512) = 512
fstat64(3, {st_mode=S_IFREG|0755, st_size=1525032, ...}) = 0
old_mmap(0xb5c000, 1223868, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0xb5c000
mprotect(0xc80000, 27836, PROT_NONE)    = 0
old_mmap(0xc81000, 16384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x124000) = 0xc81000
old_mmap(0xc85000, 7356, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0xc85000
close(3)                                = 0
old_mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf6ff9000
mprotect(0xc81000, 8192, PROT_READ)     = 0
mprotect(0xb58000, 4096, PROT_READ)     = 0
set_thread_area({entry_number:-1 -> 6, base_addr:0xf6ff9aa0, limit:1048575, seg_32bit:1, contents:0, read_exec_only:0, limit_in_pages:1, seg_not_present:0, useable:1}) = 0
munmap(0xf6ffa000, 21878)               = 0
mkdir("mysql-5.0", 0775)                = 0
chdir("mysql-5.0")                      = 0
socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) = 3
brk(0)                                  = 0x8b2d000
brk(0x8b4e000)                          = 0x8b4e000
gettimeofday({1134485112, 472119}, NULL) = 0
getpid()                                = 30136
open("/etc/resolv.conf", O_RDONLY)      = 4
fstat64(4, {st_mode=S_IFREG|0644, st_size=48, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0xf6fff000
read(4, "nameserver 62.96.228.24\nnameserv"..., 4096) = 48
read(4, "", 4096)                       = 0
close(4)                                = 0
munmap(0xf6fff000, 4096)                = 0
uname({sys="Linux", node="ligdev2", ...}) = 0
socket(PF_FILE, SOCK_STREAM, 0)         = 4
fcntl64(4, F_GETFL)                     = 0x2 (flags O_RDWR)
fcntl64(4, F_SETFL, O_RDWR|O_NONBLOCK)  = 0
connect(4, {sa_family=AF_FILE, path="/var/run/nscd/socket"}, 110) = 0
poll([{fd=4, events=POLLOUT|POLLERR|POLLHUP, revents=POLLOUT}], 1, 5000) = 1
writev(4, [{"\2\0\0\0\r\0\0\0\6\0\0\0", 12}, {"hosts\0", 6}], 2) = 18
poll([{fd=4, events=POLLIN|POLLERR|POLLHUP, revents=POLLIN|POLLHUP}], 1, 5000) = 1
recvmsg(4, {msg_name(0)=NULL, msg_iov(1)=[{"hosts\0", 6}], msg_controllen=16, {cmsg_len=16, cmsg_level=SOL_SOCKET, cmsg_type=SCM_RIGHTS, {5}}, msg_flags=0}, MSG_NOSIGNAL) = 6
fstat64(5, {st_mode=S_IFREG|0600, st_size=217016, ...}) = 0
pread(5, "\1\0\0\0h\0\0\0\0\0\0\0\1\0\0\0\302\1MC\0\0\0\0\323\0\0"..., 104, 0) = 104
mmap2(NULL, 217016, PROT_READ, MAP_SHARED, 5, 0) = 0xf6fc4000
close(5)                                = 0
close(4)                                = 0
connect(3, {sa_family=AF_INET, sin_port=htons(8080), sin_addr=inet_addr("192.132.92.3")}, 16

after that it hangs (because of the firewall)
[13 Dec 2005 15:15] Jim Winstead
The documentation is wrong. The free BK client does not support the HTTP access method (and thus doesn't support HTTP proxies at all).

The most up-to-date source you'll be able to get from behind a firewall is the nightly snapshots from http://snaps.mysql.com/
[13 Dec 2005 15:28] Stefan Hinz
I've asked the Bitmover folks for clarification whether or not the free client supports HTTP. They initially said it did. If that information was wrong (apparently so), I'll remove these lines:

If you are behind a firewall and can only initiate HTTP connections, you can also use BitKeeper via HTTP.
If you are required to use a proxy server, set the environment variable http_proxy to point to your proxy:
shell> export http_proxy="http://your.proxy.server:8080/"
Replace the bk:// with http:// when copying a repository. Example:
shell> sfioball -r+ http://mysql.bkbits.net/mysql-5.1 mysql-5.1
[13 Dec 2005 16:59] Stefan Hinz
Thank you for your bug report. This issue has been addressed in the
documentation. The updated documentation will appear on our website
shortly, and will be included in the next release of the relevant
product(s).