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 with some working internet connections #346

Closed
fiftydinar opened this issue Oct 14, 2024 · 6 comments · Fixed by #352
Closed

Comments

@fiftydinar
Copy link
Collaborator

fiftydinar commented Oct 14, 2024

Even with user-flatpak-setup service, which starts later, this issue can arrise when adding remote or installing flatpaks in some working internet connections.

We have this in service unit already covered:

Wants=network-online.target
After=network-online.target

Anecdotally, I switched to fiber internet a week ago & since then, I noticed this issue.
I tried to change DNS to Cloudflare, but issue still persists.

Interesting thing is that I also have fiber internet from same operator in another place & flatpak-setup works fine there.

Here's the log on when it happens for me:

okt 15 00:12:15 gidro-fedora user-flatpak-setup[2333]: Adding remote flathub-user from https://dl.flathub.org/repo/flathub.flatpakrepo
okt 15 00:12:15 gidro-fedora user-flatpak-setup[2333]: Note that --if-not-exists flag doesn't prevent the repo from modifying repo URL
okt 15 00:12:15 gidro-fedora user-flatpak-setup[2454]: error: Can't load uri https://dl.flathub.org/repo/flathub.flatpakrepo: While fetching https://dl.flathub.org/repo/flathub.flatpakrepo: [6] Couldn't resolve host name

Let's investigate on how to improve this situation.
Maybe we need to do some tweaking for service units.

If someone got into similar situation, please comment.

I remember that @Oakleafknight06 had the same issue.

@fiftydinar
Copy link
Collaborator Author

fiftydinar commented Oct 15, 2024

Interestingly, I caught today that user-flatpak-setup internet connection worked (but system-flatpak-setup didn't).

So I believe that we need to set system-flatpak-setup to start later.

user-flatpak-setup always starts after system-flatpak-setup, so we just need to adjust that to solve this issue.

@fiftydinar
Copy link
Collaborator Author

fiftydinar commented Oct 16, 2024

Reopening, because changing system-flatpak-setup service to graphical.target didn't fix the issue.

@fiftydinar
Copy link
Collaborator Author

fiftydinar commented Oct 23, 2024

The PR above that I made solved this issue for me.

Maybe I can set 5 network connection tries instead of 3, to be more safe

And, it would be good to add log after internet connection is reinstated

Edit: Did this above here:
95c17dc

@fiftydinar
Copy link
Collaborator Author

fiftydinar commented Oct 23, 2024

For me, it seems to connect from 1 to 3 connection attempts, with 2 attempts on average.

@Oakleafknight06 Mentioning you to tell you that this issue should be fixed.

Here's how logs look like for me now:

gidro@gidro-fedora:~$ journalctl --system -u system-flatpak-setup -b 0
okt 23 18:38:22 gidro-fedora systemd[1]: Starting system-flatpak-setup.service - Manage system flatpaks...
okt 23 18:38:22 gidro-fedora system-flatpak-setup[2198]: Fedora third-party repos are already disabled
okt 23 18:38:22 gidro-fedora system-flatpak-setup[2198]: System flatpak remote 'fedora' is already removed
okt 23 18:38:22 gidro-fedora system-flatpak-setup[2198]: System flatpak remote 'fedora-testing' is already removed
okt 23 18:38:22 gidro-fedora system-flatpak-setup[2198]: System flatpak apps from 'fedora' remote are already removed
okt 23 18:38:22 gidro-fedora system-flatpak-setup[2198]: System flatpak runtimes from 'fedora' remote are already removed
okt 23 18:38:22 gidro-fedora system-flatpak-setup[2198]: System flatpak apps from 'fedora-testing' remote are already removed
okt 23 18:38:22 gidro-fedora system-flatpak-setup[2198]: System flatpak runtimes from 'fedora-testing' remote are already removed
okt 23 18:38:22 gidro-fedora system-flatpak-setup[2198]: Adding system-wide remote flathub-system from https://dl.flathub.org/repo/flathub.flatpakrepo if it doesn't exist (requires internet)
okt 23 18:38:22 gidro-fedora system-flatpak-setup[2198]: Internet connection is not available. Waiting...
okt 23 18:38:25 gidro-fedora system-flatpak-setup[2198]: Internet connection is successful, applying the operation above
okt 23 18:38:25 gidro-fedora system-flatpak-setup[2198]: Custom flatpak system remote title is already set
okt 23 18:38:25 gidro-fedora systemd[1]: system-flatpak-setup.service: Deactivated successfully.
okt 23 18:38:25 gidro-fedora systemd[1]: Finished system-flatpak-setup.service - Manage system flatpaks.
gidro@gidro-fedora:~$ journalctl --user -u user-flatpak-setup -b 0
okt 23 18:38:22 gidro-fedora user-flatpak-setup[2303]: User flatpak remote 'fedora' is already removed
okt 23 18:38:22 gidro-fedora user-flatpak-setup[2303]: User flatpak remote 'fedora-testing' is already removed
okt 23 18:38:22 gidro-fedora systemd[2273]: Started user-flatpak-setup.service - Configure Flatpaks for current user.
okt 23 18:38:22 gidro-fedora user-flatpak-setup[2303]: User flatpak apps from 'fedora' remote are already removed
okt 23 18:38:23 gidro-fedora user-flatpak-setup[2303]: User flatpak runtimes from 'fedora' remote are already removed
okt 23 18:38:23 gidro-fedora user-flatpak-setup[2303]: User flatpak apps from 'fedora-testing' remote are already removed
okt 23 18:38:23 gidro-fedora user-flatpak-setup[2303]: User flatpak runtimes from 'fedora-testing' remote are already removed
okt 23 18:38:23 gidro-fedora user-flatpak-setup[2303]: Adding user-wide remote flathub-user from https://dl.flathub.org/repo/flathub.flatpakrepo if it doesn't exist (requires internet)
okt 23 18:38:23 gidro-fedora user-flatpak-setup[2303]: Internet connection is not available. Waiting...
okt 23 18:38:26 gidro-fedora user-flatpak-setup[2303]: Internet connection is successful, applying the operation above
okt 23 18:38:26 gidro-fedora user-flatpak-setup[2303]: Custom flatpak user remote title is already set

@fiftydinar
Copy link
Collaborator Author

Here's how it looks like when internet connection is not successful:

gidro@gidro-fedora:~/Downloads$ $HOME/Downloads/user-flatpak-setup
User flatpak remote 'fedora' is already removed
User flatpak remote 'fedora-testing' is already removed
User flatpak apps from 'fedora' remote are already removed
User flatpak runtimes from 'fedora' remote are already removed
User flatpak apps from 'fedora-testing' remote are already removed
User flatpak runtimes from 'fedora-testing' remote are already removed
Adding user-wide remote flathub-user from https://dl.flathub.org/repo/flathub.flatpakrepo if it doesn't exist (requires internet)
Internet connection is not available. Waiting...
Internet connection is not available. Waiting...
Internet connection is not available. Waiting...
Internet connection is not available. Waiting...
Internet connection is not available. Waiting...
ERROR: Internet connection is not available. Skipping the operation above.
Custom flatpak user remote title is already set

@Oakleafknight06
Copy link

For me, it seems to connect from 1 to 3 connection attempts, with 2 attempts on average.

@Oakleafknight06 Mentioning you to tell you that this issue should be fixed.

Here's how logs look like for me now:


gidro@gidro-fedora:~$ journalctl --system -u system-flatpak-setup -b 0

okt 23 18:38:22 gidro-fedora systemd[1]: Starting system-flatpak-setup.service - Manage system flatpaks...

okt 23 18:38:22 gidro-fedora system-flatpak-setup[2198]: Fedora third-party repos are already disabled

okt 23 18:38:22 gidro-fedora system-flatpak-setup[2198]: System flatpak remote 'fedora' is already removed

okt 23 18:38:22 gidro-fedora system-flatpak-setup[2198]: System flatpak remote 'fedora-testing' is already removed

okt 23 18:38:22 gidro-fedora system-flatpak-setup[2198]: System flatpak apps from 'fedora' remote are already removed

okt 23 18:38:22 gidro-fedora system-flatpak-setup[2198]: System flatpak runtimes from 'fedora' remote are already removed

okt 23 18:38:22 gidro-fedora system-flatpak-setup[2198]: System flatpak apps from 'fedora-testing' remote are already removed

okt 23 18:38:22 gidro-fedora system-flatpak-setup[2198]: System flatpak runtimes from 'fedora-testing' remote are already removed

okt 23 18:38:22 gidro-fedora system-flatpak-setup[2198]: Adding system-wide remote flathub-system from https://dl.flathub.org/repo/flathub.flatpakrepo if it doesn't exist (requires internet)

okt 23 18:38:22 gidro-fedora system-flatpak-setup[2198]: Internet connection is not available. Waiting...

okt 23 18:38:25 gidro-fedora system-flatpak-setup[2198]: Internet connection is successful, applying the operation above

okt 23 18:38:25 gidro-fedora system-flatpak-setup[2198]: Custom flatpak system remote title is already set

okt 23 18:38:25 gidro-fedora systemd[1]: system-flatpak-setup.service: Deactivated successfully.

okt 23 18:38:25 gidro-fedora systemd[1]: Finished system-flatpak-setup.service - Manage system flatpaks.


gidro@gidro-fedora:~$ journalctl --user -u user-flatpak-setup -b 0

okt 23 18:38:22 gidro-fedora user-flatpak-setup[2303]: User flatpak remote 'fedora' is already removed

okt 23 18:38:22 gidro-fedora user-flatpak-setup[2303]: User flatpak remote 'fedora-testing' is already removed

okt 23 18:38:22 gidro-fedora systemd[2273]: Started user-flatpak-setup.service - Configure Flatpaks for current user.

okt 23 18:38:22 gidro-fedora user-flatpak-setup[2303]: User flatpak apps from 'fedora' remote are already removed

okt 23 18:38:23 gidro-fedora user-flatpak-setup[2303]: User flatpak runtimes from 'fedora' remote are already removed

okt 23 18:38:23 gidro-fedora user-flatpak-setup[2303]: User flatpak apps from 'fedora-testing' remote are already removed

okt 23 18:38:23 gidro-fedora user-flatpak-setup[2303]: User flatpak runtimes from 'fedora-testing' remote are already removed

okt 23 18:38:23 gidro-fedora user-flatpak-setup[2303]: Adding user-wide remote flathub-user from https://dl.flathub.org/repo/flathub.flatpakrepo if it doesn't exist (requires internet)

okt 23 18:38:23 gidro-fedora user-flatpak-setup[2303]: Internet connection is not available. Waiting...

okt 23 18:38:26 gidro-fedora user-flatpak-setup[2303]: Internet connection is successful, applying the operation above

okt 23 18:38:26 gidro-fedora user-flatpak-setup[2303]: Custom flatpak user remote title is already set

Alright sounds good. Haven't been using the module and can't really use it right now but thanks for the fix :)
If ever I'm using it in the future it seems it'll work just fine

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 a pull request may close this issue.

2 participants