Skip to content

[bug] Indexing fails on local bare repos due to missing remote #1151

@eirc

Description

@eirc

Describe the bug

I have some local bare repos I have mounted to the container and indexing fails becase they have no remote url:

sourcebot-1  | [backend] | 2026-04-25T06:29:18.452Z warn: [repo-compile-utils] Skipping /repos/xxx.git - remote.origin.url not found in git config.

To reproduce

  • Mount a directory with bare repos to the container
volumes:
  - /repos:/repos:ro
  • Configure a connection for them
"connections": {
  "local": {
    "type": "git",
    "url": "file:///repos/*"
  }
}
  • Trigger indexing

Sourcebot deployment information

Sourcebot version (e.g. v3.0.1): v4.16.15

Additional information

I also run into a "dubious ownership" issue that was previously fixed in PR #553. It seems the dockerfile fixed that for the root user but when using the sourcebot 1500:1500 user it still won't work.

The workaround mentioned in PR #986 with git env vars wouldn't work for me, I would get this error:

sourcebot-1  | [backend] | 2026-04-25T06:15:27.635Z error: [connection-manager:job:cmody3pfn0000qn4p4x5uq0y4] Failed job cmody3pfn0000qn4p4x5uq0y4 for connection local (id: 2). Reason: warning: safe.directory '"*"' not absolute
sourcebot-1  | [backend] | fatal: detected dubious ownership in repository at '/repos/xxx.git'
sourcebot-1  | [backend] | To add an exception for this directory, call:
sourcebot-1  | [backend] | 
sourcebot-1  | [backend] | 	git config --global --add safe.directory /repos/xxx.git
sourcebot-1  | [backend] | 

But I managed to fix that by mounting a gitconfig file with:

volumes:
  - .gitconfig:/app/.gitconfig:ro

.gitconfig contents

[safe]
  directory = *

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions