ipfs-webui
ipfs-webui copied to clipboard
Files: ipfs.files.stat RPC call missing error handling
Checklist
- [x] This is a bug report, not a question. Ask questions on discuss.ipfs.tech.
- [x] I have searched on the issue tracker for my bug.
- [x] I am running the latest kubo version or have an issue updating.
Installation method
ipfs-desktop
Version
Kubo version: 0.31.0
Repo version: 16
System version: amd64/windows
Golang version: go1.23.2
Config
{
"API": {
"HTTPHeaders": {
"Access-Control-Allow-Methods": [
"PUT",
"POST"
],
"Access-Control-Allow-Origin": [
"http://yoghourt-client.localhost",
"https://apps.crust.network",
"http://localhost:3000",
"http://127.0.0.1:5001",
"https://webui.ipfs.io"
]
}
},
"Addresses": {
"API": "/ip4/127.0.0.1/tcp/5001",
"Announce": [],
"AppendAnnounce": [],
"Gateway": "/ip4/127.0.0.1/tcp/8080",
"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",
"/ip4/218.3.81.9/tcp/50665/p2p/QmSQgwDz5RbaY8mMCNCfNmwJfTikLWKWRTwFh1cG5mNPfK"
],
"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": "50GB"
},
"Discovery": {
"MDNS": {
"Enabled": false
}
},
"Experimental": {
"FilestoreEnabled": false,
"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": "12D3KooWByJZpoKikf5iBccdcgiBm3dCwrxVqgqhJyEXcpQczvrM"
},
"Import": {
"CidVersion": 1,
"HashFunction": null,
"UnixFSChunker": null,
"UnixFSRawLeaves": null
},
"Internal": {},
"Ipns": {
"RecordLifetime": "",
"RepublishPeriod": "",
"ResolveCacheSize": 128
},
"Migration": {
"DownloadSources": [],
"Keep": ""
},
"Mounts": {
"FuseAllowOther": false,
"IPFS": "/ipfs",
"IPNS": "/ipns"
},
"Peering": {
"Peers": [
{
"Addrs": [
"/ip4/218.3.81.9/tcp/56620",
"/ip4/218.3.81.9/tcp/57747"
],
"ID": "QmSQgwDz5RbaY8mMCNCfNmwJfTikLWKWRTwFh1cG5mNPfK"
},
{
"Addrs": [
"/ip4/194.163.185.130/tcp/4001"
],
"ID": "12D3KooWEJGDnMetpYjteWgsSpeCTLWu77aC1xWb6uAcAYkEwTCZ"
},
{
"Addrs": [
"/ip4/3.7.250.188/tcp/4001",
"/ip4/13.235.60.237/tcp/4001"
],
"ID": "QmdAZQGPofcXyQEndX6ecUX35PvMbkNBWp3fHaAUmu8gDB"
},
{
"Addrs": [
"/ip4/120.226.39.215/tcp/4001"
],
"ID": "12D3KooWR9KqhHNLjzMhJAoKHvuJyE5txN48gadT8KYfXMRgUKef"
},
{
"Addrs": [
"/ip6/2a02:c207:2025:4934:cc95::11/tcp/4001"
],
"ID": "QmNg3hGN3EsmSxvtWwn4EAPZTtYsgMtkjfUtzqbwYPUiQA"
},
{
"Addrs": [
"/ip4/210.242.27.237/tcp/4001"
],
"ID": "12D3KooWKKa6v7YTTyTCn7nHfq7erKihRCX7JQc8JezSfVn6Egka"
},
{
"Addrs": [
"/ip4/120.226.39.175/tcp/4001"
],
"ID": "12D3KooWFdF9yiZHFtya2r6rNLhDT4rn2dsKK43dy2u7jEsbxTMc"
},
{
"Addrs": [
"/ip4/42.192.138.156/tcp/4001"
],
"ID": "12D3KooWPQZYa7B4CiaDrmVAnqWBH6mySG9p1yWAEc4dpXmCmdQR"
},
{
"Addrs": [
"/ip4/117.34.44.154/tcp/4001"
],
"ID": "12D3KooWD2njaJAHqx5eSzWi82aDmKvuU6tTB1o6CCTUdzyBMMHZ"
},
{
"Addrs": [
"/ip4/123.126.106.84/tcp/4001"
],
"ID": "12D3KooWBFccr338AUta4m4hSuyDYFSctcoqG6rwH26SoZ3hTMyb"
},
{
"Addrs": [
"/ip4/120.77.86.246/tcp/4003"
],
"ID": "12D3KooWPyzih1mhsCsAtEYSj1sSZj2ZgLoxGHrEihCzkdGyET4y"
},
{
"Addrs": [
"/ip4/133.125.40.131/tcp/4001"
],
"ID": "12D3KooWNKb7KyP4Y9p5qCqkpC5Qo65baCkfCdFrEgNzLsm6vfxF"
},
{
"Addrs": [
"/ip4/121.157.241.41/tcp/35371"
],
"ID": "QmdAwGXkbdGspCh3vFFXrzrancsJVqyo2ADRbtRn98roaK"
},
{
"Addrs": [
"/ip4/108.61.214.245/tcp/4001"
],
"ID": "12D3KooWRUMTw53pKr5nvcdq1oANoL9zs9AbcnjJXqPaZaNWc16d"
},
{
"Addrs": [
"/ip4/65.0.182.244/tcp/4001"
],
"ID": "12D3KooWCBViMDdXaNQj8aiW2MDNdokL2YZp8cm4Lhqea5ijuJ86"
},
{
"Addrs": [
"/ip4/192.3.194.123/udp/4001/quic-v1/p2p/12D3KooWQdvwupHorPNSYYLVRx6bgkVnoaSyh9TPfUVKy9CVdGiG/p2p-circuit"
],
"ID": "12D3KooWSX2u3CkGsZGv2z9GC2Qy7k81puTuCEwxk7YFWv72nB96"
},
{
"Addrs": [
"/ip4/139.144.178.166/udp/4001/quic-v1"
],
"ID": "12D3KooWG1rR2yND8c2BpzAzj5c3VeMUFDYFqaPRfXe87w53tDFB"
},
{
"Addrs": [
"/ip4/45.32.106.254/udp/4001/quic-v1"
],
"ID": "12D3KooWApupf1YgyWo79HiVYa6oQhVa2C2WSh4PCiEK5zHvpWpH"
},
{
"Addrs": [
"/ip4/207.244.239.44/udp/4001/quic-v1"
],
"ID": "12D3KooWM4AmaKS94S37pGcaKEzTgAGfkX52DD9uNfWV5xfdZHrB"
},
{
"Addrs": [
"/ip4/89.117.79.17/udp/4001/quic-v1"
],
"ID": "12D3KooWGBrvR2s4D6rPKrZDjV8ZWuugckivj3S85epDus8CrSBY"
},
{
"Addrs": [
"/ip4/149.102.149.149/udp/4001/quic-v1"
],
"ID": "12D3KooWGS6Q9JU6qsXHokCeLdtK6p7UHD6i1AvKU7oPVXPahF39"
},
{
"Addrs": [
"/ip4/127.0.0.1/tcp/4001/quic",
"/ip4/127.0.0.1/tcp/4002/quic-v1"
],
"ID": "12D3KooWNAiACKeJJuNcfQoyzn6Tp8Nj17hZgskr3RLkyk5bGuem"
},
{
"Addrs": [
"/ip4/39.165.237.30/udp/14001/quic",
"/ip4/39.165.237.30/tcp/14001"
],
"ID": "12D3KooWM8tFisVaU1jLcjkCmjhkeM2X5ruB9i3khXojdY3rdmhv"
},
{
"Addrs": [
"/ip4/45.77.251.250/tcp/4001",
"/ip6/2001:19f0:4400:7f6b:3eec:efff:fe30:4ed6/tcp/4001",
"/ip4/45.77.251.250/udp/4001/quic",
"/ip6/2001:19f0:4400:7f6b:3eec:efff:fe30:4ed6/udp/4001/quic",
"/ip6/64:ff9b::2d4d:fbfa/tcp/4001"
],
"ID": "12D3KooWAEw4RBa1oRyqMXUCzyAbwgvDduRFvi1KzaahSb5Pk61q"
},
{
"Addrs": [
"/ip4/172.22.0.2/udp/4001/quic",
"/ip4/172.22.0.2/tcp/4001",
"/ip4/120.253.220.162/tcp/14001",
"/ip4/120.253.220.162/udp/5523/quic",
"/ip4/120.253.220.162/tcp/20049",
"/ip4/120.253.220.162/udp/7438/quic"
],
"ID": "12D3KooWDbPeYWubpE2tyDs3Gp7UgNGmHRgMvyALRNCeL3s77fgv"
},
{
"Addrs": [
"/ip4/36.156.102.119/udp/4001/quic",
"/ip4/36.156.102.119/tcp/14001",
"/ip4/36.156.102.119/tcp/4001",
"/ip4/172.18.0.2/tcp/4001",
"/ip4/172.18.0.2/udp/4001/quic",
"/ip4/183.131.193.198/tcp/14001"
],
"ID": "12D3KooWMcAHcs97R49PLZjGUKDbP1fr9iijeepod8fkktHTLCgN"
},
{
"Addrs": [
"/ip4/194.59.220.245/tcp/4001",
"/ip4/194.59.220.245/udp/4001/quic",
"/ip6/2605:f700:43:6000::586/tcp/4001",
"/ip6/2605:f700:43:6000::586/udp/4001/quic",
"/ip4/194.59.220.248/tcp/4001",
"/ip4/194.59.220.248/udp/4001/quic"
],
"ID": "12D3KooWKv5DWMXUb79VfqXUhpvcmnpzvTMJzCNXoGnj7gRwcCni"
},
{
"Addrs": [
"/ip4/39.165.237.31/tcp/14001",
"/ip4/39.165.237.31/udp/14001/quic"
],
"ID": "12D3KooWLy8E6LdKv787Phn7ay6aCbrGWuTZVoFJVZd9eYa9X4Ed"
},
{
"Addrs": [
"/ip4/65.108.105.126/tcp/4001",
"/ip4/65.108.105.126/udp/4001/quic"
],
"ID": "12D3KooWAxiBec7xtxH4DoSfxMkNCqx6we7fNAE6efVc9jijUvmR"
},
{
"Addrs": [
"/ip4/104.251.122.239/udp/4001/quic",
"/ip4/104.251.122.239/tcp/4001"
],
"ID": "12D3KooWT1idFLb714FzYDHknoqKewSEhk2P4xzZZ457QN96Pcad"
},
{
"Addrs": [
"/ip4/195.201.198.23/tcp/4001",
"/ip4/195.201.198.23/udp/4001/quic"
],
"ID": "12D3KooWHBC219eBsHhXnbKHzh6sg2o2jZ9xMtdePbf411zR1w7J"
},
{
"Addrs": [
"/ip4/223.111.148.195/udp/4001/quic",
"/ip4/223.111.148.195/tcp/4001"
],
"ID": "12D3KooWSqf1QsBsgtwKgLZyEkouEwxcfoQSNyQt99539Tq4bY1t"
},
{
"Addrs": [
"/ip6/64:ff9b::df6f:94c4/tcp/4001",
"/ip4/223.111.148.196/tcp/4001",
"/ip4/223.111.148.196/udp/4001/quic"
],
"ID": "12D3KooWPDDjPuURTNYD2FcdQ5m6oPMevzx8PJLVHBpNZXvpyVcf"
},
{
"Addrs": [
"/ip4/154.8.164.243/tcp/4001",
"/ip4/154.8.164.243/udp/4001/quic"
],
"ID": "12D3KooWQedzx8VGDqaNp2yekWjiHSk3LyGYnTVwruvLP5MZ52Pr"
},
{
"Addrs": [
"/ip4/127.0.0.1/tcp/4001",
"/ip4/26.149.239.231/udp/4001/quic-v1",
"/ip4/88.198.18.156/udp/4001/quic/p2p/12D3KooWAUnz8bi9kbfQMm7dBwCie3NDoXWNqxEnXnRuYTnrkExa/p2p-circuit"
],
"ID": "12D3KooWDbcoJ4fxP1Npnea7ocMmJox9UBi6LBhTZSkcDsjUqqVN"
},
{
"Addrs": [
"/ip4/8.152.4.208/udp/4001/quic-v1"
],
"ID": "12D3KooWPD1eHprh9gocRWsKnaSzjCzRnuzExpH5b3zuDLgF2SAD"
},
{
"Addrs": [
"/ip4/34.92.232.13/tcp/4001"
],
"ID": "12D3KooWGQg5ehq5sjAJMNQhWEYKeHPL5Fg6UM1iEBNEJ7myHjtj"
},
{
"Addrs": [
"/ip4/95.179.149.47/udp/4001/quic-v1"
],
"ID": "12D3KooWA2d7YN6bpnHStaMiH1Mjut9cf6jXsGJvynfMNQfH9xke"
},
{
"Addrs": [
"/ip4/136.244.99.190/udp/4001/quic-v1"
],
"ID": "12D3KooWRrzdcAqucYFbvWL3LodyDBH5p43JScKqfrbxkPn3skQP"
},
{
"Addrs": [
"/ip4/38.46.222.18/tcp/4001"
],
"ID": "12D3KooWBhjChj4vbxPUgcL924Qv86hG7zwtmwD5tmcNvuk67gEb"
},
{
"Addrs": [
"/ip4/74.48.90.84/udp/4001/quic-v1"
],
"ID": "12D3KooWKvmNWtbs7Pzok25XTUC2zr4suz6nF5p9jZUYeTiup5Wb"
},
{
"Addrs": [
"/ip4/107.172.86.13/udp/4001/quic-v1"
],
"ID": "12D3KooWBXuYsNUdPphg9YumyFZBXbnEBtys6jvYBCzzd8zcu7cw"
},
{
"Addrs": [
"/ip4/163.172.27.85/udp/4001/quic-v1"
],
"ID": "12D3KooWEW9ss3oEW8Gmkgpeq1CX9CXHF71KDvRTUqvzCJL7uDfj"
},
{
"Addrs": [
"/ip4/20.160.101.62/udp/4001/quic-v1"
],
"ID": "12D3KooWAziziirFEEkrBMfgsJGpvf8ggYMm2MourMYRnRgZtc3f"
},
{
"Addrs": [
"/ip4/18.132.245.179/tcp/30402"
],
"ID": "12D3KooWNVTNbp7khaUgJZmanLhriV49d9uwWmqYCufLHuh6saY8"
},
{
"Addrs": [
"/ip4/104.167.230.165/udp/4001/quic-v1"
],
"ID": "12D3KooWKrL2is8r6uAHtkjpS8jjg3uRVw9t4U24LgTppKG36d6v"
},
{
"Addrs": [
"/ip4/35.245.215.155/udp/4001/quic-v1"
],
"ID": "12D3KooWG4f3aw33NVdZkQBhB4E613xA3paKvChNYJ2Z5enxxrFe"
},
{
"Addrs": [
"/ip4/32.219.195.43/tcp/24001"
],
"ID": "12D3KooWQh3ZXzp1q3BqKAqozukjA8aN7a4PpR3CEjFG62Qb6z4u"
},
{
"Addrs": [
"/ip4/162.43.9.30/udp/4001/quic-v1"
],
"ID": "12D3KooWL9DN8DxULnDs1hDonThrtMU5QmM5WVUBpVabH622J3eP"
},
{
"Addrs": [
"/dnsaddr/bootstrap.libp2p.io"
],
"ID": "QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN"
},
{
"Addrs": [
"/dnsaddr/bootstrap.libp2p.io"
],
"ID": "QmQCU2EcMqAqQPR2i9bChDtGNJchTbq5TbXJJ16u19uLTa"
},
{
"Addrs": [
"/dnsaddr/bootstrap.libp2p.io"
],
"ID": "QmbLHAnMoJPWSCR5Zhtx6BHJX9KiKNN6tpvbUcqanj75Nb"
},
{
"Addrs": [
"/dnsaddr/bootstrap.libp2p.io"
],
"ID": "QmcZf59bWwK5XFi76CZX8cbJ4BhTzzA3gU1ZjYZcYW3dwt"
},
{
"Addrs": [
"/ip4/104.131.131.82/tcp/4001",
"/ip4/104.131.131.82/udp/4001/quic-v1"
],
"ID": "QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ"
},
{
"Addrs": [
"/ip4/144.91.101.109/udp/4001/quic-v1"
],
"ID": "12D3KooWCYsGsPKHDYzn9hUPruV4JEkbpDHkH5oP3eexj6PnR5R6"
},
{
"Addrs": [
"/ip4/116.163.20.138/tcp/4001"
],
"ID": "12D3KooWQBHnsFP1ZVA99dNTPeZSntoidbPk9iXkMY3Z79LJd21H"
}
]
},
"Pinning": {
"RemoteServices": {
"Filebase": {
"API": {
"Endpoint": "https://api.filebase.io/v1/ipfs"
},
"Policies": {
"MFS": {
"Enable": true,
"PinName": "",
"RepinInterval": ""
}
}
}
}
},
"Plugins": {
"Plugins": null
},
"Provider": {
"Strategy": ""
},
"Pubsub": {
"DisableSigning": false,
"Router": ""
},
"Reprovider": {},
"Routing": {
"AcceleratedDHTClient": true,
"Methods": null,
"Routers": null
},
"Swarm": {
"AddrFilters": null,
"ConnMgr": {
"GracePeriod": "5m0s",
"HighWater": 5000,
"LowWater": 2000,
"Type": "basic"
},
"DisableBandwidthMetrics": false,
"DisableNatPortMap": false,
"RelayClient": {},
"RelayService": {},
"ResourceMgr": {},
"Transports": {
"Multiplexers": {},
"Network": {},
"Security": {}
}
},
"Version": {}
}
Description
As shown in the figure, when I import a file of 4EiB or larger into a folder that already contains a 4EiB file, the WebGUI file interface becomes unusable. Restarting the IPFS kubo resolves the issue.
cid:bafybeie6tqsijf7j6gpow5q3qdjmtqgscrmd2ijl4olpxanbbptmvh7sui
If someone maliciously shares such CIDs, it could cause others to be unable to use IPFS normally.
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.tech if you just need general support.
Thank you for reporting, I think we are missing error handling in ipfs.files.stat call.
Namely, if it returns Type: error we should display a toast notification with Message:
When importing files, IPFS kubo may not check the size of files and folders, but this issue has been categorized under IPFS WebUI.
Can you assign me this issue? I would love to resolve this!
How should I proceed?
@lidel Hey there, I would like to resolve this issue! Can you assign this issue to me?
Repro steps
-
Start Kubo
-
Execute
$ ipfs files cp /ipfs/bafybeie6tqsijf7j6gpow5q3qdjmtqgscrmd2ijl4olpxanbbptmvh7sui/ /_Tsize_test -
Open Files screen in ipfs-webui. The
/_Tsize_testshould show just fine. -
Now, push it over threshold. Execute
$ ipfs files cp /ipfs/bafybeie6tqsijf7j6gpow5q3qdjmtqgscrmd2ijl4olpxanbbptmvh7sui/ /_Tsize_test/a Error: cp: cannot flush the created file /_Tsize_test/a: value of Tsize is too large: 9650499539051867939 -
Now try to reload Files screen in ipfs-webui (or F5). A broken screen will be displayed until the next restart:
-
This makes MFS in Kubo b0rked, and if remote MFS pinning is configured it starts showing errors like:
2025-02-20T23:34:42.076Z ERROR remotepinning/mfs kubo/pinmfs.go:128 pinning reading MFS root (value of Tsize is too large: 9650499539051867939) -
After restart, MFS (Files) loads fine again. The
/_Tsize_testexists, but the/_Tsize_test/awill not exist.
If one of top directories is over limit, the ipfs files stat / will error, effectively bricking entire Files screen, so https://github.com/ipfs/ipfs-webui/pull/2327 is not enough. We need to fix this upstream, in Kubo or even Boxo.
We should avoid creating DAGs that are too big, and avoid getting MFS error mid-flush.
@hsanjuan do you have good intuition where should the Tsize check live to avoid cannot flush the created file error? iiuc we need to check and error sooner, before we update DAG in MFS