Troubleshooting
Troubleshooting Techniques & Tips
Troubleshooting Guide
This guide provides solutions to common issues and debugging techniques for Vector SDK.
Table of Contents
Common Issues
Issue: Bot fails to connect to relays
Symptoms:
Connection timeouts
No events received
Failed to add relayerrors
Solutions:
Check your internet connection
Verify relay URLs are correct and accessible
Try different relays:
Check if relays are online: https://nostr.watch
Issue: Messages not being received
Symptoms:
Sent messages don't appear for recipient
No incoming messages
Subscription not working
Solutions:
Verify you're using the correct public key:
Check subscription filters:
Ensure relays support the required NIPs (NIP-59 for gift wrap)
Issue: Encryption/decryption failures
Symptoms:
AesGcmErrorexceptionsFailed to decrypt messages
Invalid key or nonce errors
Solutions:
Verify encryption parameters:
Check that keys and nonces are properly transmitted
Ensure no corruption in transmitted data
Verify file integrity with SHA-256 hash
Connection Problems
Relay Connection Issues
Error: Connection failed or WebSocket error
Debugging Steps:
Test relay connectivity manually:
Check firewall settings
Verify proxy configuration if using SOCKS proxy
Try adding more relays for redundancy
Solution:
Tor/Onion Relay Issues
Error: Failed to connect to onion relay
Debugging Steps:
Verify Tor is running:
Check Tor control port is accessible
Verify proxy address is correct:
Solution:
Encryption Errors
AES-GCM Errors
Error: AesGcmError: invalid nonce size or invalid key size
Causes:
Incorrect key size (must be 32 bytes for AES-256)
Incorrect nonce size (must be 16 bytes)
Corrupted key or nonce during transmission
Solution:
Decryption Failures
Error: Failed to decrypt or authentication failed
Causes:
Wrong key or nonce used
Message tampered with in transit
Authentication tag mismatch
Debugging Steps:
Verify the correct key and nonce are being used
Check message integrity with SHA-256 hash
Ensure no modification occurred during transmission
Solution:
File Upload Issues
Upload Failures
Error: Upload failed or All Blossom servers failed
Causes:
Network connectivity issues
Server temporarily unavailable
File too large
Invalid MIME type
Debugging Steps:
Check network connection
Verify Blossom servers are online
Check file size:
Verify MIME type:
Solution:
Slow Uploads
Issue: Uploads taking too long
Causes:
Large files
Slow network connection
Server load
Solutions:
Compress files before upload
Increase chunk size:
Use multiple servers for failover
Monitor progress:
Group Messaging Problems
Group Join Failures
Error: Failed to process welcome or No welcomes available
Causes:
Invalid welcome event
Group already joined
MLS engine not initialized
Debugging Steps:
Verify welcome event is valid:
Check if group already exists:
Ensure MLS engine is initialized:
Solution:
Message Not Received in Group
Issue: Messages sent but not received by group members
Causes:
Member not properly added to group
Key package not published
Relay not receiving events
Debugging Steps:
Verify key package was published:
Check relay connections:
Verify group membership:
Solution:
Logging and Debugging
Enabling Debug Logs
Basic Logging:
Verbose Logging:
Filter Specific Modules:
Debugging Event Processing
Inspect Incoming Events:
Monitoring Upload Progress
Track Upload Progress:
Performance Issues
Slow Message Processing
Issue: Messages take too long to process
Causes:
Too many subscriptions
Large number of events
Inefficient event handling
Solutions:
Limit event count in filters:
Use efficient event processing:
Optimize subscriptions:
High Memory Usage
Issue: Application using too much memory
Causes:
Caching too many events
Large file buffers
Memory leaks in dependencies
Solutions:
Limit event cache size:
Clear file buffers after use:
Use streaming for large files:
FAQs
Why are my messages not encrypted?
Ensure you're using the correct methods:
For direct messages:
send_private_message()For groups:
send_group_message()Verify encryption parameters are being used
Why is the bot not receiving messages?
Check these common issues:
Subscription not set up
Wrong public key in filter
Relays not supporting required NIPs
Bot not connected to relays
Debugging:
Why are file uploads failing?
Check these common issues:
Network connectivity
Server availability
File size limits
Invalid MIME type
Authentication failures
Debugging:
Why is the bot slow to start?
Common causes:
Too many relays connecting
Large number of subscriptions
Slow network connection
MLS engine initialization
Solutions:
Reduce number of relays
Limit initial subscriptions
Add connection timeouts
Pre-initialize MLS engine
Resources
Last updated