-
Notifications
You must be signed in to change notification settings - Fork 0
Troubleshooting
Here are some basic troubleshooting tips.
The connection name doesn't match. The name in your defaults write command must match the Viscosity connection name exactly, including case and spacing.
Check what's configured:
defaults read net.skycmd.viscosity-otpCompare with the connection name shown in Viscosity's menu bar or preferences.
No command has been mapped for this connection. Add one:
defaults write net.skycmd.viscosity-otp "<connection-name>" "<otp-command>"See Configuration for details.
The configured shell command returned a non-zero exit code. The error message shown is the command's stderr output.
Test the command directly:
defaults read net.skycmd.viscosity-otp "<connection-name>" | shCommon causes:
- The CLI tool isn't installed or isn't at the expected path
- You're not signed in to your password manager
- The item UUID or name is incorrect
- The CLI tool needs an unlocked session (e.g. Bitwarden)
The script is being run outside of Viscosity. BeforeConnect.applescript relies on the $displayName environment variable that Viscosity sets when calling Before Connect scripts. It cannot be run standalone.
Viscosity caches Before Connect scripts. After updating BeforeConnect.applescript:
- Open Viscosity → Preferences
- Edit the connection
- Under Advanced, clear the Before Connect Script
- Save
- Edit again and re-select the updated script
- Save
This is the TCC SystemPolicyAppData prompt. See Known Limitations for details and workarounds.
Viscosity gives Before Connect scripts approximately 10 seconds to complete. If the 1Password Touch ID prompt appears and you don't approve it quickly enough, Viscosity may terminate the script.
Solution: Approve the Touch ID prompt promptly when it appears.
The shell environment inside do shell script (which Viscosity uses to run AppleScript) is minimal — it does not load your .zshrc, .bashrc, or .bash_profile.
Solution: Use absolute paths for all commands in your OTP command:
# Bad
defaults write net.skycmd.viscosity-otp "My VPN" "op item get abc123 --otp"
# Good
defaults write net.skycmd.viscosity-otp "My VPN" "/usr/local/bin/op item get abc123 --otp"To find the absolute path of a command:
which op