OpenVPN / openvpn3-linux

OpenVPN 3 Linux client
GNU Affero General Public License v3.0
573 stars 152 forks source link

openvpn3 session-start using config file fails to start on first attempt, works on second attempt #259

Closed remanifest closed 5 months ago

remanifest commented 5 months ago

Sometimes, when I try to start a session using the call openvpn3 session-start --config ~/Documents/openvpn/vpn.ovpn, I get this messge:

[DBus::Connection] Connection flush failed The connection is closed
---- [SessionManager::Proxy] Failed to start new tunnel

However, when I simply run the call again, the session starts successfully and prompts me for authentication. I'm not sure if this is something to do with my config, if there's something I'm not doing, or if the services just aren't "waiting" long enough, but it's odd that this is repeatable.

Happy to provide any logs that may be beneficial.

Thank you for all of your work on migrating openvpn3 to this point. I know it was a massive undertaking.

dsommers commented 5 months ago

Thanks for testing. IIRC, you're using the Arch builds, right?

It would be good if you could try testing the latest git master in both openvpn3-linux and gdbuspp .... Our QA spotted the same behaviour and I believe that should be fixed in master already. I pushed out the latest branches late Friday.

I see @rzvncj has already updated the gdbuspp-git repo. The openvpn3-git is not, so perhaps updating the PKGBUILD @rzvncj provided in #171 will get you up-to-date quicker. There is something like 5-6 bugs fixed in the change-span 8a13d1b..b387eb0d4 (from openvpn3-git version to latest git master).

remanifest commented 5 months ago

Yes, I'm using the Arch builds. I updated the PKGBUILD locally to grab the latest commit from codeberg (e82fca9136), and I'm still running into the same issue on this commit. My gdbusapp-git is built against commit 7d80f553d6.

dsommers commented 5 months ago

Ahh! I spot the detail in the error now. Sorry that took some time. I believe that's been fixed earlier today. I unfortunately didn't manage to push it out before heading out of the office today. I'll get it out ASAP tomorrow, even though I'll be mostly offline tomorrow. Worst case on Wednesday, and then I believe QA has also managed to test this issue too.

Workaround is basically to first import the profile with openvpn3 config-import. If you use --persistent, you don't need to do it more than once.

dsommers commented 5 months ago

The detail is this line:

  Connection flush failed The connection is closed

If you check the line above this one and compare it with the successful runs, you'll see the second attempt will use a preloaded configuration profile. But that is imported with a single-use flag set, so it only works once.

That's why using openvpn3 config-import first works.

dsommers commented 5 months ago

I've just pushed out an updated git master to the public ... I'm pretty sure commit 1ea1c445171bb81f fixes your issue.

remanifest commented 5 months ago

I've just pushed out an updated git master to the public ... I'm pretty sure commit 1ea1c445171bb81f fixes your issue.

That did the trick. Thank you!

dsommers commented 5 months ago

Thanks for testing and the feedback! Closing it now.