1

Bitbucket self-hosted server.

We have repositories that we could clone in the past. Now what happens is: clone fetches data, and at the end I have just an empty folder, not even a .git/ folder, just nothing.

  • Tried with 4 different accounts, one of which is administrator.
  • Tried on Windows 10 and Mac OS.
  • Tried on different repositories and projects.
  • Tried from command line and from Sourcetree.
  • I can clone from other servers.
  • I can do a combo of git init / git remote add / git fetch etc. and then I will have (I hope) the equivalent of a cloned repo, and this way it works.

I can work (pull/push) on old repositories already cloned in the past on my computer, but cannot clone them again. Everything was working fine until few months ago.

a@a ~/PhpstormProjects/testClone
λ git clone https://www.myserver.com/bitbucket/scm/proj/repo.git
Cloning into 'repo'...
remote: Counting objects: 89, done.
remote: Compressing objects: 100% (79/79), done.
remote: Total 89 (delta 17), reused 0 (delta 0)
Unpacking objects: 100% (89/89), done.
a@a  ~/PhpstormProjects/testClone
λ ls -l
total 0
a@a ~/PhpstormProjects/testClone
λ ls -al
total 4
drwxr-xr-x 1 a 1049089 0 Feb 19 14:50 ./
drwxr-xr-x 1 a 1049089 0 Feb 19 14:48 ../
  • Is there any chance there is an anti virus or other security system that is blocking the files from being written? Very strange that it would see that there are 89 files, yet not add any or display an error. – dmoore1181 Feb 21 '19 at 14:13
  • The same behaviour happens to me and 3 other colleagues, on Windows and Mac OS. Also, I noticed that while doing the clone, the .git/ folder appears, but later it is removed. – Pierpaolo D. Feb 21 '19 at 14:22
  • That really makes me think that there must be some sort of security setting in your organization be it an anti virus or even a group policy that is not allowing the git files to be written. Or possibly deleting them after they are written. Do you see anything strange in your event viewer? Does the Bit Bucket server have any kind of error logging? (I have only used their online version recently). – dmoore1181 Feb 21 '19 at 14:35
  • As noted in the question, I can actually pull and push data from the repo using previously cloned repositories. I can also "clone" new ones using a combination of "git init, git remote add.., git fetch, git checkout --track branchname".. so files can travel through our network and be created, the weird behaviour happens only when using specifically "git clone" – Pierpaolo D. Feb 21 '19 at 14:41
  • Just out of curiosity, if you do `mkdir repo; git clone repo`, what happens? It seems as though your `git clone` operation is removing its clone after making it, which is weird: it should only do that if you interrupt it (control-C or SIGINT). – torek Feb 21 '19 at 17:14
  • @torek : I just tried, ended up with an empty "repo" folder. – Pierpaolo D. Feb 22 '19 at 08:55
  • Interesting. That suggests (but doesn't prove) the clone operation itself is not bringing things over, as `git clone` had (at least until recently) a bug where it would remove the empty directory it *didn't* make in interrupt cases. There's something very odd about the source repository, it seems. – torek Feb 22 '19 at 15:40
  • Can you try doing an SSH clone also? Are you using the clone button on the side bar to get the clone URL? – eeijlar Feb 24 '19 at 07:22

1 Answers1

1

My guess is you're running out of free space on the server and are running into BSERV-11132. tl;dr a conflict between Bitbucket's caching behaviour and its free space cache eviction behaviour causes it to generate the pack to send to the client, cache it, evict the cache, and serve you nothing. Bitbucket's cache eviction usually kicks in at 5GB so you must be running pretty low.

There are a few things you can do:

  1. Upgrade to a fixed version of Bitbucket (5.15.0, 5.13.3, 5.14.1, or anything 6+)
  2. Clear up free space so you have more than 5GB free.
  3. Lower the cache eviction threshold by setting plugin.bitbucket-scm-cache.minimum.free.space= in bytes in your $BITBUCKET_HOME/shared/bitbucket.properties file, e.g. plugin.bitbucket-scm-cache.minimum.free.space=2147483648 to set it to 2GB

Realistically I would recommend performing options 1 and 2. Option 3 is a workaround, and not a permanent solution.

Full disclosure: I work on Atlassian's Premier Support team and spent a couple of years supporting Bitbucket Server.

daveruinseverything
  • 4,775
  • 28
  • 40
  • Yes, I believe this is the answer! We had disk space problems weeks ago, but couldn't link that as a reason to the cloning problem. We cleaned up space, now we can clone, although cloning a large repo gives a warning, while cloning a smaller one doesn't, but in both cases the clone now works. – Pierpaolo D. Apr 01 '19 at 13:20