[bug] connection sync failed for local git repository
Describe the bug
Just pulled the project docker compose and attempted to run locally against local repos. After mapping in /repos mount and adding /repos/* to the config per the docs, I get this generic error. There's no further helpful spew in the logs even after attempting to increase log_level to debug. Nothing helpful either in the web ui other than 'failed'. No further errors in the log. No errors in postgres or redis container logs.
Error message:
[bug] error: [connection-manager:job:cmmrcmgnm0000rs56bonu7cck] Failed job cmmrcmgnm0000rs56bonu7cck for connection workspace-git-connection (id: 2). Failing job.
To reproduce
Run against local repos per project docs using docker compose. Map in /repos folder. Add connection to config..
Sourcebot deployment information
[Info] Sourcebot version: v4.15.6
Additional information
No response
hi @lcdupree . I'd like to work on this if you're open to a PR.
I can add better error surfacing for local repo connection failures so the actual failure reason shows up in the logs.
Hey @lcdupree it doesn't seem like your original post included the errors you were seeing. Could you please share any errors/warnings you got in the UI or logs?
edit: nevermind I see that the error is the title of the PR. Could you please share the config and docker compose file you used?
@FaryalRizwaan please let us repro on our side before putting up a PR
There is absolutely nothing worth sharing in the config or the compose that will be helpful. It's straight out of the docs for running in a container against local repos. There is nothing in the spew that helps and unless you have all of my local repos I don't see how you will be able to repro. From my side, I would have to attach a debugger to the running container and catch the local repo connection/job code failing..
FWIW, I did shell into the container and check that it could access the repos and run git commands against them successfully.
{
"$schema": "https://raw.githubusercontent.com/sourcebot-dev/sourcebot/main/schemas/v3/index.json",
"connections": {
"workspace-git-connection": {
"type": "git",
"url": "file:///repos/*"
}
}
}
services:
sourcebot:
image: ghcr.io/sourcebot-dev/sourcebot:latest
pull_policy: always
user: sourcebot
restart: always
container_name: sourcebot
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
ports:
- "3000:3000"
volumes:
- ./config.json:/data/config.json
- sourcebot_data:/data
- /Users/foo/workspace:/repos:ro
environment:
- CONFIG_PATH=/data/config.json
- AUTH_URL=${AUTH_URL:-http://localhost:3000}
- AUTH_SECRET=${AUTH_SECRET:-000000000000000000000000000000000} # CHANGEME: generate via `openssl rand -base64 33`
- SOURCEBOT_ENCRYPTION_KEY=${SOURCEBOT_ENCRYPTION_KEY:-000000000000000000000000000000000} # CHANGEME: generate via `openssl rand -base64 24`
- DATABASE_URL=${DATABASE_URL:-postgresql://postgres:postgres@postgres:5432/postgres} # CHANGEME
- REDIS_URL=${REDIS_URL:-redis://redis:6379} # CHANGEME
- SOURCEBOT_EE_LICENSE_KEY=${SOURCEBOT_EE_LICENSE_KEY:-}
- SOURCEBOT_LOG_LEVEL=debug
# For the full list of environment variables see:
# https://docs.sourcebot.dev/docs/configuration/environment-variables
postgres:
image: docker.io/postgres:${POSTGRES_VERSION:-16}
restart: always
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 3s
timeout: 3s
retries: 10
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres # CHANGEME
POSTGRES_DB: postgres
ports:
- 127.0.0.1:5432:5432
volumes:
- sourcebot_postgres_data:/var/lib/postgresql/data
redis:
image: docker.io/redis:${REDIS_VERSION:-8}
restart: always
ports:
- 127.0.0.1:6379:6379
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 3s
timeout: 10s
retries: 10
volumes:
- sourcebot_redis_data:/data
volumes:
sourcebot_data:
driver: local
sourcebot_postgres_data:
driver: local
sourcebot_redis_data:
driver: local
Totally fair, I'll wait. Happy to help implement once you've had a chance to repro @msukkari
@lcdupree to sanity check, do you have a remote.origin.url set in the git config of your repos?
Adding a failure reason in #1012 which will help debugging. If you could pull latest main and test again, that would be great
Thank you. Was going to point to this line where the error was swallowed after job failure. Browsing through the code, the logging seems pretty bare bones overall.
Having gone through the docs and GitHub issues when previously troubleshooting this, it would have been helpful if docs had pointed at db table to look at as well.
I'll revert back after I have a chance to pull main and run again.
@lcdupree any luck?
@lcdupree bump
It is very picky about any files that are in the root of the glob, but seems fine about ignoring non-git directories. It also does not pick up nested repos.
root/file (job failes) root/foo/bar1 (not indexed) root/foo/bar2 (not indexed) root/non-repo (ignored) root/repo1 (indexed)
sourcebot | [backend] | 2026-03-25T02:57:52.672Z error: [connection-manager:job:cmn5ge83e0000p54yrkltw4g3] Failed job cmn5ge83e0000p54yrkltw4g3 for connection workspace-git-connection (id: 2). Reason: Error: Git.cwd: cannot change to non-directory "/repos/file"
kk - I'll fix the issue with it failing on files.
For it to pickup nested repos, you need to use the recursive ** operator:
file:///repos/**
grazie