-
Notifications
You must be signed in to change notification settings - Fork 15
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
Bug | flatpak-managed-install.service
Fails to Start When Not Connected to the Internet
#45
Comments
That is expected behavior if you build a system with
There's a chance that upon reboot, you network connection went back up. The |
The same happens to me - (I don't know if it could be related, but after every reboot I get alert from nextcloud-client that says it couldn't connect. I would assume that it should start way after system got network connection, so maybe there's some common cause way services try to connect to early, but this whole reasoning is probably too far-fetched.) |
Hi, I'm experiencing the same issue. When wired to my router, the service behaves as expected; however, it will fail when relying on the WiFi connection (I'm using the I tried all sorts of combinations to make the service start correctly at boot time (by editing the
In all cases, In my case, something that would help me avoid having my system tainted (as shown with My configuration is as follows:
On a side note, I love this development; it makes using NixOS even more enjoyable. Thank you! 🙌 |
Systemd's documentation on network configuration: https://systemd.io/NETWORK_ONLINE/ |
I have been trying to replicate this issue, but so far no luck. Is there chance you could share you network config? In my experience these things tend to be a bit flaky. FWIW: my baseline env can be found under @mrnetlex you are right - if
Do you (still) experience a different behavior?
The systemd unit that nix-flatpak installs ( Could you maybe paste me the output
Ah! I wonder if setting Just realized that OP also reports a FWIW
Thanks for the kind words! Happy to hear you find this project useful. |
@gmodena I'm afraid there's not much information in the service logs, only the mention it can't fetch the remote object:
The endpoint is perfectly reachable otherwise:
|
By the way, this is my DNS resolver configuration in case you may be wondering if the issue could be related to it:
|
@cig0 ack - thanks for info. Just to be sure; are restarts after book ( A workaround I can think if of would be testing if domains can be resolved in the installer script, and retrying if not. But I am not super fond of introducing a busy wait at boot (or forcing a success for a failing service). |
@gmodena Manually restarting the service works as expected -- take a look at this beautiful output: Yeah, I'm not fond neither of introducing dirty workarounds or obfuscating a system's behavior if it's not absolutely necessary, which is not the case IMO. I will continue digging here. I want to understand why, if the service behaves correctly on your end, it is failing on my side, especially considering this is a fairly fresh NixOS installation—it isn't even two weeks old. I'll get back to you on Discourse once I have a first draft ready 👍 |
By the way, what kind of networking setup do you have, @gmodena? Are you also using |
I am also using NetworkManager ( |
This makes this issue even more interesting! Given Nix(OS) very nature, I wonder what settings are introducing noise for OP and me, making the service fail 🤔 |
@ReedClanton @gmodena @mrnetlex I'm happy to inform you that I've found the root cause of the issue, which can be solved with a tiny change: #67 |
This command waits 60 seconds for an internet connection. ''
${pkgs.networkmanager}/bin/nm-online --quiet --timeout 60
'' |
Thanks for the pointer @io12, that thread contained a lot of useful info. The command your shared would work for NetworkManager users, but I would not want to enforce a dep on NetworkManager on every system. FWIW NetworkManager ships with a service to address the problem discussed in this issue: https://man.archlinux.org/man/NetworkManager-wait-online.service.8.en (under the hood it runs: I was hoping that an explicit From systemd's doc |
Hey @cig0, I did not have a change to f/up on the PR before you closed it. Sorry about that. Don't know if you already came across this, but there's no need to modify upstream to alter a systemd unit. You should be able to add a
Hope this helps. |
This is pretty cool! Yesterday, I was thinking about a similar approach using an overlay (I started learning about them), but your solution is much simpler. K.I.S.S. FTW 🚀 |
I actually am in offline mode but have encountered this on activation. I had auto-update and onActivation enabled, but I also encountered this when rebuild with just the flake module imported. I would like if the apps list doesn't add any new programs that the service would exit 0 or something. (I don't use networkmanager, i use wpa_supplicant by way of networking.wireless) |
Hey @dezren39, setting
Ack. This sounds like unwanted / buggy behavior. I need to verify that I did not introduce a regression. Would you mind sharing the following information?
Thanks! |
FWIW, I just tried an offline build (I switched off networking) with nix-flatpak installed as a home-manager module, and The system built, and this is the status of the systemd unit post activation:
The timestamps are consistent with timer execution schedule. Did I understand it correctly that you had offline activations fail with In the meanwhile, I'll try to repro with nix-flatpak installed as a nixos module too. |
I think I have an update on this. I am also suffering from the service failing right after boot when I am not connected to the internet and While there is no way to prevent this if In case I am happy to provide a pull request with these changes if you want (I would like a bit of guidance on how to test my code in that case) and thanks a lot for this project! |
Hi @Nick1296 thank you so much for looking into this. That said, I’d like to make this module more reliable under network issues, and I think your suggestions would be helpful in achieving that.
Let me think about it. On the one hand, I don’t like having an implicit (if optional) dependency on a system-enabled NetworkManager. On the other hand, it might be the pragmatic way to go. Re
Yep. And
In general, I'm very much keen on adopting conventions from nixpkgs. Let me review, but in principle what you propose makes sense to me.
Yes please! A contribution with the changes you propose would be terrific. I don't have an automated way to test these types of changes; usually, I just run (manual) integration tests in a VM where I can shut down or throttle networking. Did you have a look at the flake in testing-base? If you happen to be on IRC (Libera) or Matrix, we can sync up there for quicker response times :) To keep testing simple, I’d suggest having dedicated, separate PRs for the |
Thanks! I will try to make a contribution when I get a chance to it! |
Description
When a host NixOS machine rebuilds a system that includes
nix-flatpak
while not connected to the internet,flatpak-manged-install.service
fails to start with the error message provided bellow.Addition Information
This error occurs on the latest version of
main
as well as on commit6079344
,6622918
, and presumably most/all others. This is worth pointing out because it means it wasn't caused/solved by #30.Once this issue is encountered, the user may reboot without issue. In other words, it doesn't cause any failures during boot.
I tested this very thing here and didn't see this issue. This could be caused by:
nix flake update
, for the first time since installing NixOS (~month). Something could have changed outside ofnix-flatpak
.Environment
This issue occurs on a laptop and desktop. The configuration uses flakes and installs a single flatpak via the
nix-flatpak
module and many flatpaks via the Home Manager module.The text was updated successfully, but these errors were encountered: