sourcebot icon indicating copy to clipboard operation
sourcebot copied to clipboard

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

Open CyberT17 opened this issue 10 months ago • 0 comments

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

CyberT17 avatar Jan 21 '26 21:01 CyberT17