1

Even though I'm a noob, I decided to launch a new AWS Ubuntu instance for my IPFS node and encountering errors.

I followed this tutorial - https://medium.com/textileio/tutorial-setting-up-an-ipfs-peer-part-i-de48239d82e0 and I have the ipfs.service below

[Unit]
Description=ipfs daemon
[Service]
ExecStart=/usr/local/bin/ipfs daemon --enable-gc
Restart=on-failure
RestartSec=5
User=ubuntu
Group=ubuntu
Environment="IPFS_PATH=/data/ipfs"
[Install]
WantedBy=multi-user.target

But I keep getting this...

ubuntu@ip-172-31-35-57:~$ sudo systemctl status ipfs
● ipfs.service - ipfs daemon
     Loaded: loaded (/etc/systemd/system/ipfs.service; enabled; vendor preset: enabled)
     Active: activating (auto-restart) (Result: exit-code) since Mon 2023-08-14 01:25:54 UTC; 3s ago
    Process: 78949 ExecStart=/usr/local/bin/ipfs daemon --enable-gc (code=exited, status=1/FAILURE)
   Main PID: 78949 (code=exited, status=1/FAILURE)
        CPU: 67ms

When I run the command /usr/local/bin/ipfs daemon --enable-gc independently, it seems to work fine. But I’m not sure why the service refused to work.

The syslog says this...

Aug 14 13:49:10 ip-172-31-35-57 systemd[1]: Started ipfs daemon.
Aug 14 13:49:10 ip-172-31-35-57 ipfs[218510]: Initializing daemon...
Aug 14 13:49:10 ip-172-31-35-57 ipfs[218510]: Kubo version: 0.22.0
Aug 14 13:49:10 ip-172-31-35-57 ipfs[218510]: Repo version: 14
Aug 14 13:49:10 ip-172-31-35-57 ipfs[218510]: System version: amd64/linux
Aug 14 13:49:10 ip-172-31-35-57 ipfs[218510]: Golang version: go1.19.12
Aug 14 13:49:10 ip-172-31-35-57 ipfs[218510]: Error: no IPFS repo found in /data/ipfs.
Aug 14 13:49:10 ip-172-31-35-57 ipfs[218510]: please run: 'ipfs init'
Aug 14 13:49:10 ip-172-31-35-57 systemd[1]: ipfs.service: Main process exited, code=exited, status=1/FAILURE
Aug 14 13:49:10 ip-172-31-35-57 systemd[1]: ipfs.service: Failed with result 'exit-code'.

But when I ran ipfs init, I get this.

ubuntu@ip-172-31-35-57:~$ ipfs init
generating ED25519 keypair...done
peer identity: 12D3KooWQt2nmHF...
initializing IPFS node at /home/ubuntu/.ipfs
Error: ipfs configuration file already exists!
Reinitializing would overwrite your keys
bafew80778
  • 31
  • 2

1 Answers1

1

It seems there is a discrepancy between where ifps is initialized, and where the systemd unit the configuration to exist.

To make the configuration line up, do one of two things:

  1. Run ipfs init inside /data/ipfs
    (to make the data dir /data/ipfs).
  2. Set Environment="IPFS_PATH=/home/ubuntu" in the ipfs.service file
    (to make the data dir /home/ubuntu)
Artur Meinild
  • 26,018