-
Notifications
You must be signed in to change notification settings - Fork 37
Description
Note: Feel free to close this issue as needed - I'm primarily documenting this for future reference so others encountering the same problem can find a solution.
Environment:
OS: Arch Linux
Network setup: iwd + systemd-resolved
Editor: Neovim with tabnine-nvim plugin
Tabnine version: 4.321.0
Issue:
Tabnine cannot authenticate or connect to API endpoints when /etc/resolv.conf is empty or only contains comments. The plugin logs show repeated errors:
WARN [hickory_resolver::system_conf::unix] no nameservers found in config
ERROR Failed to send analytics event... dns error... NoConnections
ERROR Error while fetching messages... ConnectError("dns error", ResolveError { kind: NoConnections })
Despite DNS resolution working system-wide (verified with ping api.tabnine.com), Tabnine's Rust-based DNS resolver (hickory_resolver) reads /etc/resolv.conf directly and fails when it contains no nameserver entries.
Root Cause:
On systems using systemd-resolved, /etc/resolv.conf should be a symlink to /run/systemd/resolve/stub-resolv.conf. In my case, it was a regular file with only comments, causing Tabnine to have no DNS configuration.
# Create proper symlink to systemd-resolved stub
sudo ln -sf /run/systemd/resolve/stub-resolv.conf /etc/resolv.conf
# Ensure systemd-resolved is running
sudo systemctl enable --now systemd-resolved
sudo systemctl restart systemd-resolved
# Verify resolv.conf now has nameserver entries
cat /etc/resolv.confAdditionally, ensure iwd is configured to use systemd-resolved in /etc/iwd/main.conf:
[Network]
NameResolvingService=systemd
Suggestion:
Consider adding a more user-friendly error message when no nameservers are detected, or documenting this common Arch Linux setup issue in troubleshooting guides.