ipfs / kubo

An IPFS implementation in Go
https://docs.ipfs.tech/how-to/command-line-quick-start/
Other
16.03k stars 3k forks source link

FUSE IPNS does not update/save new hash (0.4.0) #2168

Open Kubuxu opened 8 years ago

Kubuxu commented 8 years ago
[root@test1 ~]# ipfs swarm peers
/ip6/2a03:7380:298:14da:2c00::103/tcp/4001/ipfs/QmPxcxqujyHGMKYPmtbtvLKypkfyvYbjVdnzubPgZDxzGM
[root@test1 ~]# ipfs mount
IPFS mounted at: /ipfs
IPNS mounted at: /ipns
[root@test1 ~]# echo "test" > /ipns/local/test
[root@test1 ~]# ls /ipns/local
test
[root@test1 ~]# pkill ipfs

Received interrupt signal, shutting down...
19:07:09.845 ERROR      mount:  (c *closer) Close(),/ipfs mount.go:91
19:07:09.845 ERROR      mount:  (c *closer) Close(),/ipns mount.go:91
[1]+  Done                    ipfs daemon
[root@test1 ~]# ipfs daemon &
[1] 120
Initializing daemon...
Swarm listening on /ip4/127.0.0.1/tcp/4001
Swarm listening on /ip6/2001:470:c9dd:100:407d:65ff:feb9:f855/tcp/4001
Swarm listening on /ip6/::1/tcp/4001
API server listening on /ip4/127.0.0.1/tcp/5001
Gateway (readonly) server listening on /ip4/127.0.0.1/tcp/8080
Daemon is ready

[root@test1 ~]# ipfs mount
IPFS mounted at: /ipfs
IPNS mounted at: /ipns
[root@test1 ~]# ls /ipns/local
                                                  // Missing file
whyrusleeping commented 7 years ago

@Kubuxu is this still an issue?

Kubuxu commented 7 years ago

Just tired it again, it is still an issue.

I also got following log during ipfs daemon close:

13:49:20.932 ERROR        mfs: republishRoot error: context canceled system.go:255
ec1oud commented 1 year ago

Still an issue. Is there some reason not to fix it?

ec1oud commented 1 year ago
func (api *NameAPI) Publish(ctx context.Context, p path.Path, opts ...caopts.NamePublishOption) (coreiface.IpnsEntry, error) {
    ctx, span := tracing.Span(ctx, "CoreAPI.NameAPI", "Publish", trace.WithAttributes(attribute.String("path", p.String())))
    defer span.End()
    fmt.Println("--- name.publish got here?", p, opts)

    if err := api.checkPublishAllowed(); err != nil {
        fmt.Println("--- not allowed!")
        return nil, err
    }

It's (silently) not getting very far in this function for the same reason that the ipfs name publish command doesn't work while ipns is mounted (#1186 #964) So either we need to add a new option like AllowWhileMounted to github.com/ipfs/interface-go-ipfs-core/options, or add another argument to this Publish function to allow an override, or break it up into Publish and DoPublish or something like that.