-
-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
kubo: default installation gives null
API
field instead of some unix domain socket
#248447
Comments
This comment was marked as outdated.
This comment was marked as outdated.
Weird that it works on my machine and in the NixOS tests. One of the NixOS tests only has |
Thx I wasn't aware we even had this feature (or that you could use systemd to configure application sockets in the first place). We have a simple incorrect However this is fed by |
I was able to reproduce the problem. Maybe I just need to order the |
This happened to me too on first installation, the reason was that systemd couldn’t bind port 8080 because it is already in use by another service, then started Kubo anyways. So my theory is that Kubo checks if there was a socket made available by systemd and if there was none falls back to trying to read the listen address from the config (which is then null) and then panics in the observed way. For anyone else affected by this, run |
I created #272041, which should fix this. |
This fixes a panic of the kubo daemon which could occur under certain conditions when the daemon was starting. It was caused by the `ipfs.service` unit not depending on the `ipfs-api.socket` and `ipfs-gateway.socket` units with `Wants=`. This allows the `ipfs.service` to be started manually or by `nixos-rebuild` without the sockets being set up before that. When that happens, the daemon won't know about these sockets and will only use what is set in `services.kubo.settings.Addresses.Gateway` and `services.kubo.settings.Addresses.API`. By default the `API` is an empty list in NixOS though. The daemon doesn't like this at all and panics on startup, see ipfs/kubo#10056. With this commit, starting `ipfs.service` will first set up the two sockets before starting the actual service. Adding the `Sockets=` option implicitly adds a `Wants=` for the sockets and this is exactly what we need. See https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html#Implicit%20Dependencies . This can be checked with `systemctl show ipfs.service`. This should probably be upstreamed to the unit file in the Kubo repo. The problem can be reproduced in the following way: - Add `services.kubo.enable = true` to `/etc/nixos/configuration.nix` - `sudo nixos-rebuild switch` (this may already fail, not sure why it's not deterministic for me) - `sudo systemctl stop ipfs-api.socket` - `sudo systemctl stop ipfs-gateway.socket` - `sudo systemctl stop ipfs.service` - `sudo systemctl start ipfs.service` Fixes NixOS#248447.
This fixes a panic of the kubo daemon which could occur under certain conditions when the daemon was starting. It was caused by the `ipfs.service` unit not depending on the `ipfs-api.socket` and `ipfs-gateway.socket` units with `Wants=`. This allows the `ipfs.service` to be started manually or by `nixos-rebuild` without the sockets being set up before that. When that happens, the daemon won't know about these sockets and will only use what is set in `services.kubo.settings.Addresses.Gateway` and `services.kubo.settings.Addresses.API`. By default the `API` is an empty list in NixOS though. The daemon doesn't like this at all and panics on startup, see ipfs/kubo#10056. With this commit, starting `ipfs.service` will first set up the two sockets before starting the actual service. Adding the `Sockets=` option implicitly adds a `Wants=` for the sockets and this is exactly what we need. See https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html#Implicit%20Dependencies . This can be checked with `systemctl show ipfs.service`. This should probably be upstreamed to the unit file in the Kubo repo. The problem can be reproduced in the following way: - Add `services.kubo.enable = true` to `/etc/nixos/configuration.nix` - `sudo nixos-rebuild switch` (this may already fail, not sure why it's not deterministic for me) - `sudo systemctl stop ipfs-api.socket` - `sudo systemctl stop ipfs-gateway.socket` - `sudo systemctl stop ipfs.service` - `sudo systemctl start ipfs.service` Fixes #248447. (cherry picked from commit d4fcb44)
This fixes a panic of the kubo daemon which could occur under certain conditions when the daemon was starting. It was caused by the `ipfs.service` unit not depending on the `ipfs-api.socket` and `ipfs-gateway.socket` units with `Wants=`. This allows the `ipfs.service` to be started manually or by `nixos-rebuild` without the sockets being set up before that. When that happens, the daemon won't know about these sockets and will only use what is set in `services.kubo.settings.Addresses.Gateway` and `services.kubo.settings.Addresses.API`. By default the `API` is an empty list in NixOS though. The daemon doesn't like this at all and panics on startup, see ipfs/kubo#10056. With this commit, starting `ipfs.service` will first set up the two sockets before starting the actual service. Adding the `Sockets=` option implicitly adds a `Wants=` for the sockets and this is exactly what we need. See https://www.freedesktop.org/software/systemd/man/latest/systemd.service.html#Implicit%20Dependencies . This can be checked with `systemctl show ipfs.service`. This should probably be upstreamed to the unit file in the Kubo repo. The problem can be reproduced in the following way: - Add `services.kubo.enable = true` to `/etc/nixos/configuration.nix` - `sudo nixos-rebuild switch` (this may already fail, not sure why it's not deterministic for me) - `sudo systemctl stop ipfs-api.socket` - `sudo systemctl stop ipfs-gateway.socket` - `sudo systemctl stop ipfs.service` - `sudo systemctl start ipfs.service` Fixes NixOS#248447.
Describe the bug
We got theses reports of Kubo panicing on startup due to probably an empty
API
field ipfs/kubo#10056. This is a bug in our software however I belive this is also a bug in:nixpkgs/nixos/modules/services/network-filesystems/kubo.nix
Line 186 in cf73a86
Because a Kubo daemon without an API listener is borderline useless, your choice to change to a unix socket (f2be3ae) makes sense however I think some default got lost and now it is set to
Null
.Given I am not a Nix user myself I got help from @justinabrahms to fill in the template, thx ❤️.
Steps To Reproduce
Steps to reproduce the behavior:
services.kubo.enable = true
to/etc/nixos/configuration.nix
sudo nixos-rebuild switch
systemctl status ipfs
notice it's failing with a panic.Expected behavior
After installation Kubo daemon should start and the RPC should be usable by a permissioned user.
Notify maintainers
@Luflosi
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.The text was updated successfully, but these errors were encountered: