wrenchTroubleshooting

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 relay errors

Solutions:

  1. Check your internet connection

  2. Verify relay URLs are correct and accessible

  3. Try different relays:

  4. Check if relays are online: https://nostr.watcharrow-up-right

Issue: Messages not being received

Symptoms:

  • Sent messages don't appear for recipient

  • No incoming messages

  • Subscription not working

Solutions:

  1. Verify you're using the correct public key:

  2. Check subscription filters:

  3. Ensure relays support the required NIPs (NIP-59 for gift wrap)

Issue: Encryption/decryption failures

Symptoms:

  • AesGcmError exceptions

  • Failed to decrypt messages

  • Invalid key or nonce errors

Solutions:

  1. Verify encryption parameters:

  2. Check that keys and nonces are properly transmitted

  3. Ensure no corruption in transmitted data

  4. Verify file integrity with SHA-256 hash


Connection Problems

Relay Connection Issues

Error: Connection failed or WebSocket error

Debugging Steps:

  1. Test relay connectivity manually:

  2. Check firewall settings

  3. Verify proxy configuration if using SOCKS proxy

  4. Try adding more relays for redundancy

Solution:

Tor/Onion Relay Issues

Error: Failed to connect to onion relay

Debugging Steps:

  1. Verify Tor is running:

  2. Check Tor control port is accessible

  3. 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:

  1. Verify the correct key and nonce are being used

  2. Check message integrity with SHA-256 hash

  3. 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:

  1. Check network connection

  2. Verify Blossom servers are online

  3. Check file size:

  4. Verify MIME type:

Solution:

Slow Uploads

Issue: Uploads taking too long

Causes:

  • Large files

  • Slow network connection

  • Server load

Solutions:

  1. Compress files before upload

  2. Increase chunk size:

  3. Use multiple servers for failover

  4. 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:

  1. Verify welcome event is valid:

  2. Check if group already exists:

  3. 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:

  1. Verify key package was published:

  2. Check relay connections:

  3. 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:

  1. Limit event count in filters:

  2. Use efficient event processing:

  3. Optimize subscriptions:

High Memory Usage

Issue: Application using too much memory

Causes:

  • Caching too many events

  • Large file buffers

  • Memory leaks in dependencies

Solutions:

  1. Limit event cache size:

  2. Clear file buffers after use:

  3. Use streaming for large files:


FAQs

chevron-rightHow do I check if a relay is working?hashtag

Use the Nostr network monitor:

Or test with curl:

chevron-rightWhy are my messages not encrypted?hashtag

Ensure you're using the correct methods:

  • For direct messages: send_private_message()

  • For groups: send_group_message()

  • Verify encryption parameters are being used

chevron-rightHow do I handle decryption errors gracefully?hashtag

Wrap decryption in error handling:

chevron-rightWhy is the bot not receiving messages?hashtag

Check these common issues:

  1. Subscription not set up

  2. Wrong public key in filter

  3. Relays not supporting required NIPs

  4. Bot not connected to relays

Debugging:

chevron-rightHow do I increase upload timeout?hashtag

Configure upload timeout:

chevron-rightWhy are file uploads failing?hashtag

Check these common issues:

  1. Network connectivity

  2. Server availability

  3. File size limits

  4. Invalid MIME type

  5. Authentication failures

Debugging:

chevron-rightHow do I debug MLS group issues?hashtag

Enable detailed logging:

Check group state:

chevron-rightWhy is the bot slow to start?hashtag

Common causes:

  1. Too many relays connecting

  2. Large number of subscriptions

  3. Slow network connection

  4. MLS engine initialization

Solutions:

  1. Reduce number of relays

  2. Limit initial subscriptions

  3. Add connection timeouts

  4. Pre-initialize MLS engine


Resources

Last updated