Skip to content

[bug] ALWAYS_INDEX_FILE_PATTERNS env var not being honored due to shell expansion #772

@CyberT17

Description

@CyberT17

Describe the bug

As per the sourcebot docs, the correct usage of ALWAYS_INDEX_FILE_PATTERNS is like this ALWAYS_INDEX_FILE_PATTERNS=**/*.sum,**/*.lock
The issue is that zoekt indexer will throw the following error message

[backend] | 2026-01-21T21:36:53.623Z error: [repo-index-manager] Index syncer worker error. Command failed: zoekt-git-index -allow_missing_branches -index /data/.sourcebot/index -max_trigram_count 50000 -file_limit 2097152 -branches "HEAD" -tenant_id 1 -repo_id 6 -shard_prefix 1_6 -large_file **/*.go /data/.sourcebot/repos/6

The issue here is that when the Node's exec() runs the command through a shell (/bin/sh), it will expand glob patterns like **/*.go before passing them to the command.

To reproduce

Add the following ALWAYS_INDEX_FILE_PATTERNS=**/*.sum,**/*.lock to the sourcebot config. When the indexing begins zoekt will throw the above mentioned error.

Sourcebot deployment information

Sourcebot version: Since 4.10.1, was added in #631

Additional information

No response

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions