Skip to content
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

command line "ipfs files ls" output is blank #8631

Closed
3 tasks done
gitgit3 opened this issue Jan 1, 2022 · 4 comments
Closed
3 tasks done

command line "ipfs files ls" output is blank #8631

gitgit3 opened this issue Jan 1, 2022 · 4 comments
Labels
kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization

Comments

@gitgit3
Copy link

gitgit3 commented Jan 1, 2022

Checklist

Installation method

ipfs-update or dist.ipfs.io

Version

go-ipfs version: 0.12.0-rc1
Repo version: 12
System version: arm/linux
Golang version: go1.16.12

Config

{
  "API": {
    "HTTPHeaders": {
      "Access-Control-Allow-Methods": [
        "PUT",
        "POST"
      ],
      "Access-Control-Allow-Origin": [
        "http://192.168.1.121:5001",
        "http://localhost:3000",
        "http://127.0.0.1:5001",
        "https://webui.ipfs.io"
      ]
    }
  },
  "Addresses": {
    "API": "/ip4/0.0.0.0/tcp/5001",
    "Announce": [],
    "AppendAnnounce": [],
    "Gateway": "/ip4/0.0.0.0/tcp/8080",
    "NoAnnounce": [],
    "Swarm": [
      "/ip4/0.0.0.0/tcp/4001",
      "/ip6/::/tcp/4001",
      "/ip4/0.0.0.0/udp/4001/quic",
      "/ip6/::/udp/4001/quic"
    ]
  },
  "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/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,
      "Interval": 10
    }
  },
  "Experimental": {
    "AcceleratedDHTClient": false,
    "FilestoreEnabled": false,
    "GraphsyncEnabled": false,
    "Libp2pStreamMounting": false,
    "P2pHttpProxy": false,
    "StrategicProviding": false,
    "UrlstoreEnabled": false
  },
  "Gateway": {
    "APICommands": [],
    "HTTPHeaders": {
      "Access-Control-Allow-Headers": [
        "X-Requested-With",
        "Range",
        "User-Agent"
      ],
      "Access-Control-Allow-Methods": [
        "GET"
      ],
      "Access-Control-Allow-Origin": [
        "*"
      ]
    },
    "NoDNSLink": false,
    "NoFetch": false,
    "PathPrefixes": [],
    "PublicGateways": null,
    "RootRedirect": "",
    "Writable": false
  },
  "Identity": {
    "PeerID": "12D3KooWSD7dez66BK8Cz9NzQFJyHViCeevR1RX5rT92Cj6TKeHf"
  },
  "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": {
    "Interval": "12h",
    "Strategy": "all"
  },
  "Routing": {
    "Type": "dht"
  },
  "Swarm": {
    "AddrFilters": null,
    "ConnMgr": {
      "GracePeriod": "20s",
      "HighWater": 900,
      "LowWater": 600,
      "Type": "basic"
    },
    "DisableBandwidthMetrics": false,
    "DisableNatPortMap": false,
    "RelayClient": {},
    "RelayService": {},
    "Transports": {
      "Multiplexers": {},
      "Network": {},
      "Security": {}
    }
  }
}

Description

I added a simple file (a text file containing 9 chars) using ipfs add at the command line (with or without the -w option, the result is the same):
ipfs add -w tmp.txt
output:
added QmVvgQpYGcvtsmr1fFDATLPdYqAQgUpaLUWVZduNGcwEgj tmp.txt
added QmZSGZL1hSPknXuyqdzCqHYyLCqfu8EhJUNEzSzEamSsaC

Now I type
ipfs files ls
and the output is blank. This is always the case. Also if I go to the webui, there are no files listed. However, I have added some larger files (videos of say 10MB) and the "Allblocks" indicator goes up which indicates that the content has been added.

I can retrieve the content like this:
ipfs cat QmVvgQpYGcvtsmr1fFDATLPdYqAQgUpaLUWVZduNGcwEgj
output:
some data

I have been using version 0.9 on another (almost identical) machine and the command "ipfs files ls" always returns a list of files which were added. (Both these machines are RaspberryPi if that is any help).

uname -a
Linux raspi2.sandybrook.pearcey.net 5.10.17-v7l+ #1414 SMP Fri Apr 30 13:20:47 BST 2021 armv7l GNU/Linux

I was following this tutorial:
https://flyingzumwalt.gitbooks.io/decentralized-web-primer/content/files-on-ipfs/lessons/wrap-directories-around-content.html
which worked on one machine but not the other.

@gitgit3 gitgit3 added kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization labels Jan 1, 2022
@welcome
Copy link

welcome bot commented Jan 1, 2022

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

@gitgit3
Copy link
Author

gitgit3 commented Jan 6, 2022

I've found the problem. It seems that the tutorial might be out of date - along with many other on the web.
It seems that the command "ipfs add ..." will only add the content of the file and nothing else. And you cannot list it with "ipfs files ls". This seems counter intuitive to me. I would expect the command to return the hash of all added content.
There is another way to add data which is using "ipfs files write", e.g.:
echo "hello world" | ipfs files write --create --parents /myfile

This will add the content along with a file label and "ipfs files ls" will output:
/myfile

See: ipfs files write -h
ipfs files write - Write to a mutable file in a given filesystem.

This is not the best system in my mind. But if it's going to stay that way, at least update the docs.

@Winterhuman
Copy link
Contributor

Yes, this is a known issue (#8504).

Until that issue and it's changes are closed, use ipfs files cp /ipfs/$(ipfs add -Q --pin=false filename.txt) /path/for/filename.txt.

@aschmahmann
Copy link
Contributor

@gitgit3 I don't think you were properly following that tutorial. As mentioned in the linked issue MFS (the thing used by ipfs files ls) is not the same as the set of all data in your repo. That tutorial doesn't contain ipfs files ls anywhere, but instead has ipfs ls -v QmPvaEQFVvuiaYzkSVUp23iHTQeEUpDaJnP8U7C3PqE57w which lists the files in a particular directory which is referenced by CID.

If you have more general support questions check out discuss.ipfs.io or one of the IPFS chat channels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization
Projects
None yet
Development

No branches or pull requests

3 participants