Skip to main content

Common Issues

This guide covers common problems you may encounter when using NapCat and their solutions.

Login Issues

Cannot Login / Login Timeout

Symptoms:
  • Login process hangs or times out
  • QR code doesn’t appear
  • “Login failed” error message
Solutions:
  1. Check NTQQ version compatibility
    • Ensure you’re using a compatible NTQQ version
    • Download the latest version from the Release page
  2. Clear login cache
    • Close NapCat and NTQQ completely
    • Delete the login cache directory
    • Restart and try logging in again
  3. Check network connectivity
    • Ensure you have a stable internet connection
    • Try disabling VPN or proxy temporarily
    • Check if QQ servers are accessible
  4. Update NapCat
    • Older versions may have login compatibility issues
    • Always use the latest stable release

Account Frozen After Login

Symptoms:
  • Login succeeds but account gets frozen
  • “Account at risk” warning
Solutions:
  1. Use official QQ app for verification
    • Login to the official QQ mobile app
    • Complete any security verifications
    • Try NapCat again after verification
  2. Avoid frequent logins
    • Don’t login/logout repeatedly in short time
    • Wait at least 5-10 minutes between attempts
  3. Use stable environment
    • Login from the same IP address consistently
    • Avoid using public or frequently changing IPs

Connection Issues

WebSocket Connection Refused

Symptoms:
  • Error: connect ECONNREFUSED
  • WebSocket client cannot connect
Solutions:
  1. Verify server is running
  2. Check configuration
  3. Check firewall settings
    • Allow the port through firewall
    • On Linux: sudo ufw allow 3001
    • On Windows: Add firewall rule for the port
  4. Verify host binding
    • Use 0.0.0.0 to listen on all interfaces
    • Use 127.0.0.1 for localhost only
    • Make sure client connects to the correct host

HTTP API Returns 403 Forbidden

Symptoms:
  • API calls return 403 status code
  • {"message": "token verify failed!"}
Solutions:
  1. Check authentication token
  2. Verify token in config
    • Ensure token matches exactly (case-sensitive)
    • Check for extra spaces or quotes
    • If token is empty in config, don’t send token in request
  3. Check WebSocket authentication

Reverse WebSocket Not Connecting

Symptoms:
  • 反向WebSocket连接错误
  • 在 5 秒后尝试重新连接
Solutions:
  1. Verify target server is running
    • Ensure your WebSocket server is running and listening
    • Check server logs for connection attempts
  2. Check URL format
  3. Test with a simple WebSocket server

Event and Message Issues

Not Receiving Events

Symptoms:
  • WebSocket connected but no events received
  • Messages sent but no notification
Solutions:
  1. Check connection type
    • Connect to / for events (not /api)
    • /api endpoint is only for API calls
  2. Verify bot is online
    • Check WebUI or logs to confirm bot is logged in
    • Look for lifecycle event after connection
  3. Check event filters
    • Verify reportSelfMessage setting if expecting self-messages
    • Check if events are filtered by your application
  4. Monitor debug logs

Messages Not Sending

Symptoms:
  • API returns success but message not delivered
  • “Send message failed” error
Solutions:
  1. Check API response
  2. Verify message format
  3. Check user/group ID
    • Ensure user ID exists and bot has permission
    • For groups, verify bot is a member
    • For private messages, must be friend or in same group
  4. Check message content
    • Some message types may be restricted
    • Try sending a simple text message first
    • Check for invalid CQ codes

Webhook Not Receiving Events

Symptoms:
  • HTTP client configured but webhook server receives nothing
  • No POST requests arriving
Solutions:
  1. Verify HTTP client is enabled
  2. Check webhook URL accessibility
  3. Check server logs
    • Look for [Http Client] errors in NapCat logs
    • Check webhook server logs for incoming requests
  4. Verify network path
    • If using localhost, ensure both run on same machine
    • Check firewall rules
    • Test with public IP or ngrok for debugging

Configuration Issues

Configuration Not Loading

Symptoms:
  • Changes to config file have no effect
  • Bot uses default configuration
Solutions:
  1. Check config file location
    • Ensure config file is in the correct directory
    • Verify file name is correct
  2. Validate JSON syntax
    • Use a JSON validator to check for syntax errors
    • Check for missing commas, brackets, or quotes
    • Use JSON5 validator if using JSON5 features
  3. Restart NapCat
    • Configuration changes require restart
    • Close completely before restarting
  4. Check file permissions
    • Ensure NapCat can read the config file
    • On Linux: chmod 644 config.json

Invalid Configuration Error

Symptoms:
  • “Invalid configuration” error on startup
  • NapCat fails to start
Solutions:
  1. Check required fields
  2. Verify data types
    • port must be number, not string
    • enable must be boolean, not string
    • Arrays must use [], objects must use {}
  3. Check for typos
    • Field names are case-sensitive
    • Use exact field names from documentation

Performance Issues

High Memory Usage

Symptoms:
  • NapCat uses excessive RAM
  • System becomes slow
Solutions:
  1. Limit message history
    • Reduce message cache size if available
    • Clear old logs periodically
  2. Disable debug logging
  3. Reduce concurrent connections
    • Limit number of WebSocket connections
    • Use fewer network adapters
  4. Update to latest version
    • Newer versions may have memory optimizations

High CPU Usage

Symptoms:
  • CPU usage constantly high
  • System becomes unresponsive
Solutions:
  1. Check heartbeat intervals
  2. Reduce logging verbosity
    • Disable debug mode
    • Reduce log output
  3. Check for message loops
    • Ensure bot isn’t responding to its own messages
    • Use reportSelfMessage: false

Debugging Tips

Enable Debug Logging

Check Logs

Look for error messages in NapCat logs:
  • [OneBot] - OneBot related logs
  • [HTTP Server] - HTTP server logs
  • [WebSocket] - WebSocket logs
  • [Http Client] - Webhook logs

Test with Minimal Configuration

Start with a minimal config to isolate issues:

Use API Testing Tools

  • Postman or Insomnia for HTTP API testing
  • wscat for WebSocket testing

Monitor Network Traffic

Getting Help

Before Asking for Help

  1. Search existing issues - Check GitHub issues for similar problems
  2. Read documentation - Review relevant documentation sections
  3. Check version - Ensure you’re using the latest version
  4. Gather information:
    • NapCat version
    • NTQQ version
    • Operating system
    • Configuration (remove sensitive tokens)
    • Error messages and logs
    • Steps to reproduce

Community Support

Join the NapCat community groups: Get the join password from the WebUI About page. Note: This is a non-profit project. For integration issues, basic questions, or underlying framework issues, please search for solutions on your own.

Reporting Bugs

When reporting bugs on GitHub:
  1. Use a clear, descriptive title
  2. Include steps to reproduce
  3. Provide expected vs actual behavior
  4. Include relevant logs and configuration
  5. Specify environment details

Next Steps