-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Panics on startup #10056
Comments
Confirming that this is happening on v 0.20.0 through 0.22.0 |
Can one of your please post |
There is no api file. Here's the raw config. I'll regenerate it after we fix this:
|
Thanks to @Jorropo, we uncovered the issue.
Fix is to make it listen on an API for now:
|
So we could start like that, however this sounds like a nixos issue too:
This looks wrong and make Kubo not usable to do anything, technically kubo is gonna continue make accessible whatever you had stored locally over the network as well as expose a gatewayh service, but I don't think this is what is intented. If I understand NixOS/nixpkgs@f2be3ae correctly it should default to some unix domain path which makes sense as it's more secure in depth compared to localhost, it does not work with extensions AFAIK tho. |
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.
Checklist
Installation method
built from source
Version
Config
Error: cannot connect to the api. Is the daemon running? To run as a standalone CLI command remove the api file in `$IPFS_PATH/api`
Description
The text was updated successfully, but these errors were encountered: