Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serious Connection and Resource Management Issues in DefGuard Client #265

Open
NerdvanaExplorer opened this issue Jul 30, 2024 · 0 comments

Comments

@NerdvanaExplorer
Copy link

NerdvanaExplorer commented Jul 30, 2024

Hey team,

I've noticed some important issues with the DefGuard client that need attention. Here's a breakdown of what's happening:

The Issues I'm Facing

The DefGuard client is experiencing multiple critical issues, including unexpected errors, connection failures, shutdown problems, and difficulties establishing WireGuard VPN connections due to routing configuration errors.

Specific Problems

  1. After several connect-disconnect cycles, I'm getting an "unexpected error" message that prevents further connections.
  2. Once this error occurs, it's impossible to establish new connections.
  3. When closing the app, sometimes the WireGuard interface remains active and continues to send packets.
  4. The client repeatedly fails to create WireGuard interfaces (it tries from utun3 to utun17) due to routing configuration errors.

How to Reproduce These Issues

  1. Open the DefGuard client.
  2. Try to connect to a VPN location.
  3. You'll likely see a failure to create a WireGuard interface due to routing errors.
  4. If a connection is established, disconnect from the VPN.
  5. Repeat steps 2-4 several times.
  6. Try to connect again after encountering the "unexpected error".
  7. Close the app and monitor network activity - you may see ongoing activity.

What Should Be Happening

  • The client should remain stable through multiple connect/disconnect cycles.
  • Errors should be handled gracefully, allowing further connection attempts.
  • Closing the app should properly shut down all processes and network interfaces.
  • The client should be able to create a WireGuard interface without issues.
  • Routes should be correctly configured for the new interface.
  • A VPN connection should be successfully established.

The Error Message I'm Seeing

I consistently get this error:

Failed to configure routing for WireGuard interface utunX: Command returned error status: ``

(X is a number between 3 and 17, depending on which interface it's trying to set up)

Potential Causes

I'm considering several possibilities:

  1. Resource leaks during connect/disconnect cycles.
  2. State inconsistencies between the client and server.
  3. Accumulation of minor errors leading to system instability.
  4. Possible race conditions or deadlocks in multi-threaded operations.
  5. Incomplete cleanup during app shutdown.
  6. Desynchronization between the main app and the WireGuard service.
  7. Conflicts with existing network configurations or other VPN software.

Technical Details

  • Client Version: 0.4.0
  • Operating System: macOS
  • Date First Observed: July 29, 2024
  • Frequency: Consistently reproducible after multiple connect/disconnect cycles

Relevant Logs

[2024-07-30][02:22:53][INFO][defguard_client::appstate] Removed connection from active connections: ActiveConnection {
location_id: 1,
connected_from: "192.168.0.7",
start: 2024-07-30T02:21:24.813626,
interface_name: "utun3",
connection_type: Location,
}
[2024-07-30][02:22:54][ERROR][defguard_client::appstate] Couldn't find connection with id: 1, connection_type: Location in active connections.
[2024-07-30][02:22:54][WARN][defguard_client::utils] Interface data stream disconnected

Impact

These issues are severely affecting the reliability and usability of the DefGuard client. I'm unable to establish VPN connections, and there's a risk of unexpected data transmission and resource consumption even after the application is closed.

This issue needs to be prioritized for investigation and resolution. Any insights or suggestions would be greatly appreciated.

Let me know if you need any more information or clarification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant