Skip to content
/ kubo Public
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

ipfs daemon --mount not working #10340

Open
3 tasks done
gdkrmr opened this issueFeb 14, 2024· 6 comments
Open
3 tasks done

ipfs daemon --mount not working #10340

gdkrmr opened this issueFeb 14, 2024· 6 comments
Labels
kind/bugA bug in existing code (including security flaws)P3Low: Not priority right now

Comments

@gdkrmr
Copy link

Checklist

Installation method

third-party binary

Version

Kubo version: 0.25.0
Repo version: 15
System version: amd64/linux
Golang version: go1.21.5

Config

{
  "API": {
    "HTTPHeaders": {}
  },
  "Addresses": {
    "API": "/ip4/127.0.0.1/tcp/5001",
    "Announce": [],
    "AppendAnnounce": [],
    "Gateway": "/ip4/127.0.0.1/tcp/8082",
    "NoAnnounce": [],
    "Swarm": [
      "/ip4/0.0.0.0/tcp/4001",
      "/ip6/::/tcp/4001",
      "/ip4/0.0.0.0/udp/4001/quic-v1",
      "/ip4/0.0.0.0/udp/4001/quic-v1/webtransport",
      "/ip6/::/udp/4001/quic-v1",
      "/ip6/::/udp/4001/quic-v1/webtransport"
    ]
  },
  "AutoNAT": {},
  "Bootstrap": [
    "/dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN",
    "/dnsaddr/bootstrap.libp2p.io/p2p/QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa",
    "/dnsaddr/bootstrap.libp2p.io/p2p/QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb",
    "/dnsaddr/bootstrap.libp2p.io/p2p/QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt",
    "/ip4/104.131.131.82/tcp/4001/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",
    "/ip4/104.131.131.82/udp/4001/quic-v1/p2p/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ"
  ],
  "DNS": {
    "Resolvers": {}
  },
  "Datastore": {
    "BloomFilterSize": 0,
    "GCPeriod": "1h",
    "HashOnRead": false,
    "Spec": {
      "mounts": [
        {
          "child": {
            "path": "blocks",
            "shardFunc": "/repo/flatfs/shard/v1/next-to-last/2",
            "sync": true,
            "type": "flatfs"
          },
          "mountpoint": "/blocks",
          "prefix": "flatfs.datastore",
          "type": "measure"
        },
        {
          "child": {
            "compression": "none",
            "path": "datastore",
            "type": "levelds"
          },
          "mountpoint": "/",
          "prefix": "leveldb.datastore",
          "type": "measure"
        }
      ],
      "type": "mount"
    },
    "StorageGCWatermark": 90,
    "StorageMax": "10GB"
  },
  "Discovery": {
    "MDNS": {
      "Enabled": true
    }
  },
  "Experimental": {
    "FilestoreEnabled": true,
    "GraphsyncEnabled": false,
    "Libp2pStreamMounting": false,
    "OptimisticProvide": false,
    "OptimisticProvideJobsPoolSize": 0,
    "P2pHttpProxy": false,
    "StrategicProviding": false,
    "UrlstoreEnabled": false
  },
  "Gateway": {
    "APICommands": [],
    "DeserializedResponses": null,
    "DisableHTMLErrors": null,
    "ExposeRoutingAPI": null,
    "HTTPHeaders": {},
    "NoDNSLink": false,
    "NoFetch": false,
    "PathPrefixes": [],
    "PublicGateways": null,
    "RootRedirect": ""
  },
  "Identity": {
    "PeerID": "12D3KooWGq9xUywoxFjVUrM4J2SvfEqZULS18oE3hnz3cnqYZ7kZ"
  },
  "Internal": {},
  "Ipns": {
    "RecordLifetime": "",
    "RepublishPeriod": "",
    "ResolveCacheSize": 128
  },
  "Migration": {
    "DownloadSources": [],
    "Keep": ""
  },
  "Mounts": {
    "FuseAllowOther": false,
    "IPFS": "/ipfs",
    "IPNS": "/ipns"
  },
  "Peering": {
    "Peers": null
  },
  "Pinning": {
    "RemoteServices": {}
  },
  "Plugins": {
    "Plugins": null
  },
  "Provider": {
    "Strategy": ""
  },
  "Pubsub": {
    "DisableSigning": false,
    "Router": ""
  },
  "Reprovider": {},
  "Routing": {
    "AcceleratedDHTClient": false,
    "Methods": null,
    "Routers": null
  },
  "Swarm": {
    "AddrFilters": null,
    "ConnMgr": {},
    "DisableBandwidthMetrics": false,
    "DisableNatPortMap": false,
    "RelayClient": {},
    "RelayService": {},
    "ResourceMgr": {},
    "Transports": {
      "Multiplexers": {},
      "Network": {},
      "Security": {}
    }
  }
}

Description

ipfs daemon --mount

does not work. I have seen similar issues reported here but I couldn't find this exact same issue.

kubo is installed through the Manjaro repositories. I have also tested this with the v0.26.0 binary downloaded from Github and a colleague confirmed the issue.

I have created /ipfs and /ipns and the folders belong to me

$ ll / | grep ip                                                                         
drwxr-xr-x   2 gkraemer gkraemer 4.0K Feb 12 22:17 ipfs
drwxr-xr-x   2 gkraemer gkraemer 4.0K Feb 12 22:17 ipns

after launching ipfs daemon --mount, something gets mounted in these folders

$ ll / | grep ip                                                        
d--x--x--x   1 root root    0 Feb 14 21:13 ipfs
d--x--x--x   1 root root    0 Feb 14 21:13 ipns

trying to access anything from these folders tells me "No such file or directory".

I have tried setting user_allow_other and changing the permissions of the directories while unmounted and mounted but to no avail.

@gdkrmrgdkrmr added kind/bugA bug in existing code (including security flaws)need/triageNeeds initial labeling and prioritizationlabels Feb 14, 2024
@gdkrmrgdkrmr changed the title /ipfs not accessible ipfs daemon --mount not working Feb 14, 2024
@aschmahmann
Copy link
Contributor

How are you running kubo? Are you running ipfs daemon as root (shouldn't be needed), the folder permissions changing looks suspicious.

@aschmahmannaschmahmann added P3Low: Not priority right nowand removed need/triageNeeds initial labeling and prioritizationlabels Feb 20, 2024
@3ri4nG0ld
Copy link

This feature could be reimplemented using "ipfs filestore", I don't know if something similar is already thought of, or if you plan to keep the --mount, but both methods would seem useful to me.

@gdkrmr
Copy link
Author

How are you running kubo? Are you running ipfs daemon as root (shouldn't be needed), the folder permissions changing looks suspicious.

I don't run kubo as root.

@ProximaNova
Copy link

ProximaNova commented Aug 26, 2024

Basic checklist for FUSE-mounting IPFS:

  • "ipfs config --json Mounts.FuseAllowOther true" (= JSON '"Mounts":{"FuseAllowOther":true,')
  • "user_allow_other" in /etc/fuse.conf (not commented out with "#" at the start of the line)
  • /ipfs and /ipns mountpoints owned by a basic or non-root user - those folders should exists (run "sudo chown user /ipfs /ipns")
  • something published to IPNS - seems you gotta have an IPNS record for your peerID to mount IPFS (run "ipfs daemon &", "ipfs name publish baf...", "ipfs shutdown", then the mount command which is "ipfs daemon --mount &")
  • running a 64-bit computer (doesn't work in 32-bit ones)

I know you said that you already did some of these things, but you didn't comment on the other things. Oh wait, I see that you posted '"FuseAllowOther": false,' - and that's almost certainly your problem.

Author input needed to mark this issue as solved?

@gdkrmr
Copy link
Author

Thanks for looking at this. I followed the steps and get a different error now:

$ ipfs config --json Mounts.FuseAllowOther                                                                                                                                                   
true
$ ll / | grep ip  
drwxr-xr-x   2 gkraemer gkraemer 4.0K Feb 12  2024 ipfs
drwxr-xr-x   2 gkraemer gkraemer 4.0K Feb 12  2024 ipns
$ cat /etc/fuse.conf | grep user_allow_other                                                                                                                                                          
# user_allow_other - Using the allow_other mount option works fine as root, but
# in order to have it work as a regular user, you need to set user_allow_other
user_allow_other
$ echo test > test   
$ ipfs add test    
added QmeomffUNfmQy76CQGy9NdmqEnnHU9soCexBnGU3ezPHVH test
 5 B / 5 B [===============================================================================================================================================================================================] 100.00% 
$ ipfs name publish QmeomffUNfmQy76CQGy9NdmqEnnHU9soCexBnGU3ezPHVH                                                                                                                                    
Published to k51qzi5uqu5dis3bmsaehjsm3v6k1mc94yi0kk79uxxmqphsw5k6plo91jftd2: /ipfs/QmeomffUNfmQy76CQGy9NdmqEnnHU9soCexBnGU3ezPHVH
$ ipfs daemon --mount
Initializing daemon...
Kubo version: 0.29.0
Repo version: 15
System version: amd64/linux
Golang version: go1.22.4

[...]

RPC API server listening on /ip4/127.0.0.1/tcp/5002
WebUI: http://127.0.0.1:5002/webui
2024-09-05T10:46:46.946+0200	ERROR	node	node/mount_unix.go:96	error mounting: root can't be a file (unixfs type: File)

Error: root can't be a file (unixfs type: File)

@ProximaNova
Copy link

ProximaNova commented Sep 19, 2024

error mounting: root can't be a file (unixfs type: File)
Error: root can't be a file (unixfs type: File)

I didn't work because you tried to publish a file to IPNS. You can only publish a folder to IPNS (I didn't write that in my steps). Run something like this (folder contains darkhttpd web server source code): "ipfs name publish /ipfs/bafybeiawvadz46hpwl2hw2darjone46gvajm7td4dgowjpdvz5f5eee7qi".

Above in this thread, I said that mounting IPFS doesn't work in 32-bit computers. That's not entirely correct. It didn't work in a specific ~decade-ago version of a certain Linux distro. This month I saw that I could mount IPFS in a 32-bit computer which is basically running a liveboot of the latest Debian. (Now my problem is that I cannot run Tor and torsocks in said 32-bit computer, even after hours of trying to fix it.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bugA bug in existing code (including security flaws)P3Low: Not priority right now
Projects
None yet
Development

No branches or pull requests

4 participants