bug(telemetry): salt file not auto-created on macOS — device hash shows '(no salt file)'
#1656 opened on May 1, 2026
Description
Description
On macOS, rtk telemetry status shows device hash: (no salt file) even after running commands that should trigger generate_device_hash() (e.g. rtk gain).
Root cause
The salt_file_path() function uses dirs::data_local_dir(), which on macOS resolves to ~/Library/Application Support/ — not ~/.local/share/ (Linux convention). However, the auto-creation logic in get_or_create_salt() silently fails, leaving no salt file and no error message.
The telemetry status command reads the salt file path correctly (from ~/Library/Application Support/rtk/.device_salt), but since the file was never created, it falls back to (no salt file).
Steps to reproduce
- Fresh install via
brew install rtkon macOS - Run
rtk gainor any command - Run
rtk telemetry status - Observe:
device hash: (no salt file) - Check
~/.local/share/rtk/— directory doesn't exist - Check
~/Library/Application Support/rtk/—.device_saltnot present
Workaround
cp <some-salt> ~/Library/Application\ Support/rtk/.device_salt
After placing the file in the correct macOS path, rtk telemetry status shows the device hash correctly.
Expected behavior
The salt file should be auto-created at ~/Library/Application Support/rtk/.device_salt on first use on macOS.
Environment
- OS: macOS (Darwin 25.4.0)
- RTK version: 0.38.0
- Installed via: Homebrew