TeamCity running in docker container on a Mac can't read git repositories

Hello,

I'm running TeamCity 2022.10.3 (build 117072) as Docker Container in Rancher Desktop with dockerd as container engine on Mac OS 13.x. When I create a new project reading a public github repository I get a "stderr: fatal: 'origin' does not appear to be a git repository". What is the cause? How to solve it?

What I have tried so far:

- I set the logging presets to debug vcs -- the log does not provide much more information. I put the logs at the end

- Giving the credentials

- Uploading a ssh key for authentication

- tried a different Mac same error (both Intel, both MacOS 13.x)

- tried different networks

- tried private repository

What to do to reproduce?

1. running Teamcity server

docker run -it -d --name teamcity-server  \                                                                                                                                        ✔  ▼  12:48:06
  -v <your_local_teamcity_data_dir>:/data/teamcity_server/datadir \
  -v <your_local_teamcity_logs_dir>:/opt/teamcity/logs  \
    -p 8111:8111 \
    -u root \
    jetbrains/teamcity-server:2022.10.3

2. default setup of Teamcity with H2 database and all default settings

3. creating a new project with a public github URL e.g https://github.com/Coveros/helloworld

4. Resulting error message:

teamcity-vcs.log

[2023-04-17 10:46:43,525]  DEBUG [uled executor 3] - s.git.command.impl.CommandUtil - Output produced by [/opt/teamcity/bin/.] git version:
git version 2.40.0
[2023-04-17 10:47:34,891]  DEBUG [nio-8111-exec-7] - gers.vcs.git.MirrorManagerImpl - Save mapping to /data/teamcity_server/datadir/system/caches/git/map
[2023-04-17 10:47:36,002]  DEBUG [nio-8111-exec-7] - .vcs.git.TestConnectionCommand - Opening connection for  (/opt/teamcity/temp/git-testcon6503799015409915173, https://github.com/Coveros/helloworld#refs/heads/master)
[2023-04-17 10:47:36,022]  DEBUG [nio-8111-exec-7] - s.git.command.impl.CommandUtil - [/opt/teamcity/bin/.] git version
[2023-04-17 10:47:36,063]  DEBUG [nio-8111-exec-7] - s.git.command.impl.CommandUtil - Output produced by [/opt/teamcity/bin/.] git version:
git version 2.40.0
[2023-04-17 10:47:36,087]  DEBUG [nio-8111-exec-7] - s.git.command.impl.CommandUtil - [git-D60EFE1E.git] git -c credential.helper= ls-remote origin
[2023-04-17 10:47:36,147]   WARN [nio-8111-exec-7] -      jetbrains.buildServer.VCS - Failed to run operation within 1 attempt: jetbrains.buildServer.vcs.VcsException: git -c credential.helper= ls-remote origin command failed.
exit code: 128
stderr: fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
[2023-04-17 10:47:36,148]  DEBUG [nio-8111-exec-7] -      jetbrains.buildServer.VCS - Failed to run operation within 1 attempt
jetbrains.buildServer.vcs.VcsException: git -c credential.helper= ls-remote origin command failed.
exit code: 128
stderr: fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

 

1
1 comment
Does the issue only happen on macs? It doesn't look like an issue with most of the options you shared. The error comes directly from git and it means that the local copy of the repository doesn't have a valid reference of origin. Does it also happen with different repositories? Was the data directory clean before starting up the server or did it contain info from a separate set up?

The git local copies are kept in the data directory, system/caches/git, so you could try to remove it. If for some reason it wasn't created properly or it got corrupted, recreating it might help. Otherwise we might need to see how the VCS Root was configured.

As a separate note I see that you are running it under the root user. We'd normally recommend against it when possible. I'm not sure that your issue can be caused by that, but it shouldn't be necessary.
0

Please sign in to leave a comment.