ipfs-cluster / ipfs-cluster

Pinset orchestration for IPFS
https://ipfscluster.io
Other
1.46k stars 285 forks source link

ipfs-cluster-follow will crash if ipfs node goes offline #2068

Open RubenKelevra opened 1 week ago

RubenKelevra commented 1 week ago

Additional information:

Describe the bug:

I've started the cluster follower and connected it to ipfs desktop. Then I changed the config and asked ipfs desktop to restart the ipfs node.

This resulted in a crash of the ipfs cluster follower:

Starting the IPFS Cluster follower peer for "ipfs-websites".
CTRL-C to stop it.
Checking if IPFS is online (will wait for 2 minutes)...
waiting for IPFS to become available on /ip4/127.0.0.1/tcp/5001...
2024-07-08T11:02:11.083+0200    INFO    config  config/config.go:362    loading configuration from http://127.0.0.1:8080/ipns/ipfs-websites.collab.ipfscluster.io
unsuccessful request (500): failed to resolve /ipns/ipfs-websites.collab.ipfscluster.io: promise channel was closed

reading the configurations in /home/ruben/.ipfs-cluster-follow/ipfs-websites
main.runCmd
        github.com/ipfs-cluster/ipfs-cluster@v1.1.1/cmd/ipfs-cluster-follow/commands.go:290
github.com/urfave/cli/v2.(*Command).Run
        github.com/urfave/cli/v2@v2.27.2/command.go:276
github.com/urfave/cli/v2.(*Command).Run
        github.com/urfave/cli/v2@v2.27.2/command.go:269
github.com/urfave/cli/v2.(*App).RunAsSubcommand
        github.com/urfave/cli/v2@v2.27.2/app.go:347
main.main.func1
        github.com/ipfs-cluster/ipfs-cluster@v1.1.1/cmd/ipfs-cluster-follow/main.go:275
github.com/urfave/cli/v2.(*Command).Run
        github.com/urfave/cli/v2@v2.27.2/command.go:276
github.com/urfave/cli/v2.(*App).RunContext
        github.com/urfave/cli/v2@v2.27.2/app.go:333
github.com/urfave/cli/v2.(*App).Run
        github.com/urfave/cli/v2@v2.27.2/app.go:307
main.main
        github.com/ipfs-cluster/ipfs-cluster@v1.1.1/cmd/ipfs-cluster-follow/main.go:278
runtime.main
        runtime/proc.go:271
runtime.goexit
        runtime/asm_amd64.s:1695
RubenKelevra commented 1 week ago

The ipfs cluster follower will also run out of patience eventually to receive the ipns and then crash, too:

Would be nice if it would just retry if that takes very long.

Starting the IPFS Cluster follower peer for "ipfs-websites".
CTRL-C to stop it.
Checking if IPFS is online (will wait for 2 minutes)...
waiting for IPFS to become available on /ip4/127.0.0.1/tcp/5001...
2024-07-08T11:16:31.767+0200    INFO    config  config/config.go:362    loading configuration from http://127.0.0.1:8080/ipns/ipfs-websites.collab.ipfscluster.io
unsuccessful request (504): failed to resolve /ipns/ipfs-websites.collab.ipfscluster.io: context deadline exceeded

reading the configurations in /home/ruben/.ipfs-cluster-follow/ipfs-websites
main.runCmd
        github.com/ipfs-cluster/ipfs-cluster@v1.1.1/cmd/ipfs-cluster-follow/commands.go:290
github.com/urfave/cli/v2.(*Command).Run
        github.com/urfave/cli/v2@v2.27.2/command.go:276
github.com/urfave/cli/v2.(*Command).Run
        github.com/urfave/cli/v2@v2.27.2/command.go:269
github.com/urfave/cli/v2.(*App).RunAsSubcommand
        github.com/urfave/cli/v2@v2.27.2/app.go:347
main.main.func1
        github.com/ipfs-cluster/ipfs-cluster@v1.1.1/cmd/ipfs-cluster-follow/main.go:275
github.com/urfave/cli/v2.(*Command).Run
        github.com/urfave/cli/v2@v2.27.2/command.go:276
github.com/urfave/cli/v2.(*App).RunContext
        github.com/urfave/cli/v2@v2.27.2/app.go:333
github.com/urfave/cli/v2.(*App).Run
        github.com/urfave/cli/v2@v2.27.2/app.go:307
main.main
        github.com/ipfs-cluster/ipfs-cluster@v1.1.1/cmd/ipfs-cluster-follow/main.go:278
runtime.main
        runtime/proc.go:271
runtime.goexit
        runtime/asm_amd64.s:1695
hsanjuan commented 6 days ago

I cannot reproduce this. I don't think this is a crash, I think this is a non-0 exit. It is not a panic, yet it is printing the stack trace. I'm not sure why it is printing the stack, but as far as errors go, this seems like a clean exit.

RubenKelevra commented 6 days ago

@hsanjuan that's weird. I'm the maintainer of the AUR package, and it's a binary one. Meaning, I don't compile ipfs-cluster-follow, but just download and repackage the archive.

Here's the building instruction for the package:

https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=ipfs-cluster-bin

Is the program maybe reacting to some enviromental variable or something like that? I'm running it in the fish-shell on CachyOS.