Skip to content

[bug] setTemplatesFromConfig: unknown git hosting site "https://example.com/path/to/repo.git" #434

@brendan-kellam

Description

@brendan-kellam

Describe the bug

When using a generic git host connection (i.e., type: git) with a locally checked out repo (i.e., url contains file:///), a error message like the following can appear:

[backend] | 2025-08-05T23:54:15.511Z error: [zoekt] 2025/08/05 23:54:15 setTemplatesFromConfig(/my-repos/go-sdk): unknown git hosting site "https://gitea.com/gitea/go-sdk.git"

The repo will still be searchable, but this error message will appear everytime the repo is indexed.

To reproduce

  1. Create a new folder and clone a repo from any host other than GitHub. E.g., the gitea Go SDK: https://gitea.com/gitea/go-sdk
  2. Create a config that specifies the local repository:
{
  "$schema": "https://raw.githubusercontent.com/sourcebot-dev/sourcebot/main/schemas/v3/index.json",
  "connections": {
    "my-repos": {
      "type": "git",
      "url": "file:///my-repos/*"
    }
  }
}
  1. Run Sourcebot:
docker run \
    -p 3000:3000 \
    --pull=always \
    --rm \
    -v $(pwd)/repos:/my-repos:ro \
    -v $(pwd):/data \
    -e CONFIG_PATH=/data/config.json \
    --name sourcebot \
    ghcr.io/sourcebot-dev/sourcebot:latest

Expected

The repo indexes with no error messages

Actual

The above error message appears

Sourcebot deployment information

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

Additional information

This only happens with repos hosted in a code host other than GitHub. Suspect function is: https://github.com/sourcebot-dev/zoekt/blob/12a2f4ad075359a09bd8a91793acb002211217aa/gitindex/index.go#L293

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingzoektIssue related to the Zoekt code search engine. https://github.com/sourcebot-dev/zoekt

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions