ipfs-webui icon indicating copy to clipboard operation
ipfs-webui copied to clipboard

Failed to add files to IPFS

Open maooricio opened this issue 7 years ago • 5 comments

I updated the ipfs-webui and follow the instructions in order to install and run the tool.

I had the old version of this module and I could worked with it fine. I decided to update it because I noticed that many things changed both here and in js-ipfs. All works fine but when I try to upload a file, The module shows me an error that I don't understand why because I studied and analyzed all the connections and I think all are set just fine. In fact, the console doesn't throw me any error when I make the upload. What I am missing?

Here is the error:

screenshot from 2019-01-07 11-20-15

And here is the console log

screenshot from 2019-01-07 11-20-44

maooricio avatar Jan 07 '19 16:01 maooricio

Yep, that should work. Can you give some more info?

  • what commit version is listed in the bottom of the nav bar?
  • what browser and version and OS are you using?
  • did you drag and drop or did you click the button and choose add files or add folder?
  • How many files / folders are you trying to add, and what is the total file size?

olizilla avatar Jan 07 '19 16:01 olizilla

i'm seeing an error on master with drag and drop of directories on Firefox, which I'm looking into now

olizilla avatar Jan 07 '19 16:01 olizilla

Hi @olizilla, look the answer to your questions:

  1. commit/261f4f4
  2. Google Chrome Version 68.0.3440.75 (Official Build) (64-bit). OS: Ubuntu 18.04.1 LTS
  3. I clicked the button and I chose add files
  4. One file with 200kb of total size

maooricio avatar Jan 07 '19 17:01 maooricio

Ok, I got the same result with "Add file" under both prebuilt QmenEBWcAk3tN94fSKpKFtUMwty1qNwSYw3DMDFV6cPBXA or dev version (npm start) tagged as v2.3.2:

2019-01-09--00-34-48

As you can see the file is added just fine – the error is bogus and looks.. oddly familiar :) I suspected we are mixing logic responsible for "Add file" with "Add folder". And indeed: we are off by one in a place where there is a check for existence of a wrapping directory (expected when uploading standalone files). The + 1 was changed to + 2 in recent PR https://github.com/ipfs-shipyard/ipfs-webui/pull/924.

@olizilla @fsdiogo check this:

Changing:

https://github.com/ipfs-shipyard/ipfs-webui/blob/22388be396cd84135b923d7c4aaaa4ba70d6cfa7/src/bundles/files.js#L244

back to:

https://github.com/ipfs-shipyard/ipfs-webui/blob/c491557d823f882a2ff10cacebb8976a51103449/src/bundles/files.js#L244

...fixes "Add file" but breaks "Add folder" :upside_down_face:

So the actual fix requires some refactoring and decoupling "Add file" from "Add folder".

Hope this helps.

lidel avatar Jan 09 '19 00:01 lidel

Sorry, I was so focused on fixing the Add folder that I didn't check if Add file was breaking after it 🤦‍♂️

I'll fix it ASAP.

fsdiogo avatar Jan 09 '19 10:01 fsdiogo