Nixpkgs: No ipfs repo found after nixos-rebuild

Created on 13 May 2017  路  11Comments  路  Source: NixOS/nixpkgs

Issue description

After updating to the latest unstable channel, the ipfs service does not find the repository in /var/lib/ipfs anymore.

Steps to reproduce

I'm not sure, maybe updating is enough...

Technical details

  • System: 17.09pre107265.0afb6d789c (Hummingbird)
  • Nix version: nix-env (Nix) 1.11.9
  • Nixpkgs version: "17.09pre107265.0afb6d789c"
  • Sandboxing enabled: build-use-sandbox = true

Most helpful comment

Yeah that's a known bug that's been there before (see my last comment on #25531), I'm just working on it :)

All 11 comments

You may want to cc the maintainer of the package/service.

Yep.

@mguentner @Infinisil ( @fpletz )

Please post the logs (journalctl -u ipfs -r) - it might be due to a repo version change of ipfs. That requires a manual migration.

Mai 13 15:43:49 terry systemd[1]: ipfs.service: Failed with result 'exit-code'.
Mai 13 15:43:49 terry systemd[1]: ipfs.service: Unit entered failed state.
Mai 13 15:43:49 terry systemd[1]: Failed to start IPFS Daemon.
Mai 13 15:43:49 terry systemd[1]: ipfs.service: Start request repeated too quickly.
Mai 13 15:43:49 terry systemd[1]: Stopped IPFS Daemon.
Mai 13 15:43:49 terry systemd[1]: ipfs.service: Service hold-off time over, scheduling restart.
Mai 13 15:43:48 terry systemd[1]: ipfs.service: Failed with result 'exit-code'.
Mai 13 15:43:48 terry systemd[1]: ipfs.service: Unit entered failed state.
Mai 13 15:43:48 terry systemd[1]: ipfs.service: Main process exited, code=exited, status=1/FAILURE
Mai 13 15:43:48 terry systemd[1]: Started IPFS Daemon.
Mai 13 15:43:48 terry systemd[1]: Stopped IPFS Daemon.
Mai 13 15:43:48 terry systemd[1]: ipfs.service: Service hold-off time over, scheduling restart.
Mai 13 15:43:47 terry systemd[1]: ipfs.service: Failed with result 'exit-code'.
Mai 13 15:43:47 terry systemd[1]: ipfs.service: Unit entered failed state.
Mai 13 15:43:47 terry systemd[1]: ipfs.service: Main process exited, code=exited, status=1/FAILURE
Mai 13 15:43:47 terry systemd[1]: Started IPFS Daemon.
Mai 13 15:43:47 terry systemd[1]: Stopped IPFS Daemon.
Mai 13 15:43:47 terry systemd[1]: ipfs.service: Service hold-off time over, scheduling restart.
Mai 13 15:43:45 terry systemd[1]: ipfs.service: Failed with result 'exit-code'.
Mai 13 15:43:45 terry systemd[1]: ipfs.service: Unit entered failed state.
Mai 13 15:43:45 terry systemd[1]: ipfs.service: Main process exited, code=exited, status=1/FAILURE
Mai 13 15:43:45 terry systemd[1]: Started IPFS Daemon.
Mai 13 15:43:45 terry systemd[1]: Stopped IPFS Daemon.
Mai 13 15:43:45 terry systemd[1]: ipfs.service: Service hold-off time over, scheduling restart.
Mai 13 15:43:44 terry systemd[1]: ipfs.service: Failed with result 'exit-code'.
Mai 13 15:43:44 terry systemd[1]: ipfs.service: Unit entered failed state.
Mai 13 15:43:44 terry systemd[1]: ipfs.service: Main process exited, code=exited, status=1/FAILURE
Mai 13 15:43:44 terry systemd[1]: Started IPFS Daemon.
Mai 13 15:43:44 terry systemd[1]: Stopped IPFS Daemon.
Mai 13 15:43:44 terry systemd[1]: ipfs.service: Service hold-off time over, scheduling restart.
Mai 13 15:43:43 terry systemd[1]: ipfs.service: Failed with result 'exit-code'.
Mai 13 15:43:43 terry systemd[1]: ipfs.service: Unit entered failed state.
Mai 13 15:43:43 terry systemd[1]: ipfs.service: Main process exited, code=exited, status=1/FAILURE
Mai 13 15:43:43 terry ipfs[24381]: please run: 'ipfs init'
Mai 13 15:43:43 terry ipfs[24381]: Error: no IPFS repo found in /var/lib/ipfs.
Mai 13 15:43:43 terry ipfs[24381]: Initializing daemon...
Mai 13 15:43:43 terry systemd[1]: Started IPFS Daemon.

Please try:

services.ipfs.dataDir = "/var/lib/ipfs/.ipfs/";

Since the ipfs service before ignored the dataDir option, it would always get set to ~/.ipfs which is the default, with the home directory for the ipfs user being /var/lib/ipfs by default, this resolves to /var/lib/ipfs/.ipfs.

We should probably note this somewhere that the data needs to be moved to the correct location when updating.

mv /var/lib/ipfs/.ipfs/* /var/lib/ipfs && rmdir /var/lib/ipfs/.ipfs

should do.

Edit: Or as @mguentner said, just set dataDir to the old directory.

We could simply make /var/lib/ipfs/.ipfs the default value - that reflects the old default behaviour

That too would be an option. Could we maybe even use something like `if system.stateVersion <= 17.03 then "/var/lib/ipfs/.ipfs" else "/var/lib/ipfs"? It seems like that option is there for exactly something like this.

After settings dataDir:

Mai 14 13:52:44 terry systemd[1]: Starting IPFS Initializer...
Mai 14 13:52:44 terry ipfs-init-start[3432]: initializing IPFS node at /var/lib/ipfs/.ipfs
Mai 14 13:52:44 terry ipfs-init-start[3432]: Error: ipfs configuration file already exists!
Mai 14 13:52:44 terry ipfs-init-start[3432]: Reinitializing would overwrite your keys.
Mai 14 13:52:44 terry systemd[1]: ipfs-init.service: Main process exited, code=exited, status=1/FAILURE
Mai 14 13:52:44 terry systemd[1]: Failed to start IPFS Initializer.
Mai 14 13:52:44 terry systemd[1]: ipfs-init.service: Unit entered failed state.
Mai 14 13:52:44 terry systemd[1]: ipfs-init.service: Failed with result 'exit-code'.

ipfs is started, though. Thanks so far. Feel free to close this!

Yeah that's a known bug that's been there before (see my last comment on #25531), I'm just working on it :)

Was this page helpful?
0 / 5 - 0 ratings

Related issues

teto picture teto  路  3Comments

chris-martin picture chris-martin  路  3Comments

ayyess picture ayyess  路  3Comments

ob7 picture ob7  路  3Comments

ghost picture ghost  路  3Comments