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

fix(default-flatpaks): Couldn't resolve host name in some network setups #352

Merged
merged 2 commits into from
Oct 23, 2024

Conversation

fiftydinar
Copy link
Collaborator

@fiftydinar fiftydinar commented Oct 23, 2024

Fixes: #346

This is the attempt to fix this default-flatpaks error in some network setups (when internet connection is not yet fully established when service is started).

If network-online.target in service is not sufficient, network is checked 3 times with 3 seconds pause.
I use the same server which Fedora uses to check the connection.

I also modified the setup, so internet-dependent tasks like adding remotes & installing flatpaks will be just skipped if there is no internet connection, while rest of the offline tasks will be performed.

StartLimitInterval=0 is currently set to infinitely restart the setup until it performs without any errors. This can be problematic if users don't have the internet connection for some good period of time, so I set this to 3, which is sufficient enough imo.

The only thing that is not implemented right now, is that setup doesn't retry on those skipped operations due to no internet connection, because it would then skip other offline operations. So using exit 1 is not sufficient.
It's also tricky that adding remote task can't be skipped if it's already present, as flatpakref & repo URL are not the same for comparison. So we would needlessly restart the setup in this scenario if user doesn't have internet, but has the same remote already present.
It also should be noted that Restart-on-failure doesn't always trigger for some errors (like it doesn't trigger in Couldn't resolve host name when adding remote).
Because of that complexity, I won't implement that.

I tested this locally & it works well.

@fiftydinar fiftydinar marked this pull request as ready for review October 23, 2024 12:33
@fiftydinar fiftydinar merged commit 2f2036d into main Oct 23, 2024
5 checks passed
@fiftydinar fiftydinar deleted the default-flatpaks-internet-connection-workaround branch October 23, 2024 15:53
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

Successfully merging this pull request may close these issues.

fix(default-flatpaks): Couldn't resolve host name with some working internet connections
1 participant