Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

empty repository - could not fetch repositories: EOF #483

Open
HawkSK opened this issue May 28, 2024 · 4 comments
Open

empty repository - could not fetch repositories: EOF #483

HawkSK opened this issue May 28, 2024 · 4 comments
Labels
Bitbucket server bug Something isn't working help wanted Extra attention is needed

Comments

@HawkSK
Copy link

HawkSK commented May 28, 2024

Describe the bug
The run command fails if a git repo is empty. Exlcuding the repo does not work.

To Reproduce
Steps to reproduce the behavior:

  1. Have a project ACME containing an empty git repo empty-repo
  2. Run multi-gitter run "/usr/bin/env bash ~/some_script.sh" --config=./config.yaml -B "feature/XY-123" -t "foo" -O ACME
    or also with flag -s ACME/empty-repo
    or also with flag --repo-exclude "empty-repo"
  3. See error could not fetch repositories: EOF

Expected behavior
The run command should finish for all non-empty repositories in the organization. Empty repositories could be reported as a warning/error.

Additional context
config.yaml

base-url: https://acme.com/
git-type: cmd
platform: bitbucket_server
ssh-auth: true

token: XY-...
username: [email protected]

log-level: trace

output

time="2024-05-28T23:43:51+02:00" level=trace msg="http request" host=acme.com request="GET /rest/api/1.0/projects/ACME/repos/empty-repo/branches/default HTTP/1.1\r\nHost: acme.com\r\nUser-Agent: go-bitbucket/1.0.0/go\r\nAuthorization: Bearer <CENSORED>\nContent-Type: application/json\r\nAccept-Encoding: gzip\r\n\r\n" response="HTTP/1.1 204 \r\nCache-Control: private, no-cache\r\nCache-Control: no-cache, no-transform\r\nContent-Type: application/json;charset=UTF-8\r\nDate: Tue, 28 May 2024 21:43:51 GMT\r\nPragma: no-cache\r\nSet-Cookie: BITBUCKETSESSIONID=s2~<CENSORED>; Max-Age=1209600; Expires=Tue, 11 Jun 2024 21:43:51 GMT; Path=/; Secure; HttpOnly\r\nVary: X-AUSERNAME\r\nVary: X-AUSERID\r\nVary: Cookie\r\nX-Arequestid: *1UKQTY0x<CENSORED>\r\nX-Asessionid: 1h<CENSORED>\r\nX-Auserid: 30<CENSORED>\r\nX-Ausername: hawk\r\nX-Content-Type-Options: nosniff\r\n\r\n" took=51.3166ms
could not fetch repositories: EOF
@HawkSK HawkSK added the bug Something isn't working label May 28, 2024
@igstbagusdharmaputra
Copy link

any updates?

@lindell
Copy link
Owner

lindell commented Jun 2, 2024

@ryancurrah This seems to be a bitbucket-server specific problem. I'm not able to repro on other platforms. Are you able to take a look?

@lindell lindell added the help wanted Extra attention is needed label Jun 2, 2024
@gcase555
Copy link
Contributor

gcase555 commented Jul 16, 2024

@lindell I could probably take a look at this after I get bitbucketcloud support done(if no one else grabs it), my team has recently been focusing on bitbucket cloud support but we would like to try this out on bitbucket server as well soon.

@PayBas
Copy link

PayBas commented Sep 3, 2024

Running into the same issue:

TRAC[0006] http request
host=bitbucket.megacorp.local request="GET /rest/api/1.0/projects/FFS/repos/my-empty-repo/branches/default HTTP/1.1
Host: bitbucket.megacorp.local
User-Agent: go-bitbucket/1.0.0/go
Authorization: Bearer <CENSORED>
Content-Type: application/json
Accept-Encoding: gzip"

response="HTTP/1.1 204
Cache-Control: private, no-cache
Cache-Control: no-cache, no-transform
Content-Type: application/json;charset=UTF-8
Date: Tue, 03 Sep 2024 00:10:56 GMT
Pragma: no-cache
Set-Cookie: BITBUCKETSESSIONID=8AB460349757A5CEB2FA7F03D1D01F95; Max-Age=1209600; Expires=Tue, 17 Sep 2024 00:10:56 GMT; Path=/; Secure; HttpOnly
Vary: X-AUSERNAME
Vary: X-AUSERID
Vary: Cookie
X-Arequestid: @1882E6Dx130x15433787x0
X-Asessionid: ni83on
X-Auserid: 13139
X-Ausername: MYACCOUNT
X-Content-Type-Options: nosniff"
took=62.070583ms

could not fetch repositories: EOF

The problem is that defining the repo as repo-exclude: does not help because the list is obtained before any filtering takes place.

I think simply skipping any repo's returning a 204 (No Content) should suffice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bitbucket server bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants