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

Failed to add files to IPFS #928

Closed
maooricio opened this issue Jan 7, 2019 · 5 comments · Fixed by #931
Closed

Failed to add files to IPFS #928

maooricio opened this issue Jan 7, 2019 · 5 comments · Fixed by #931
Assignees
Labels
kind/bug A bug in existing code (including security flaws)

Comments

@maooricio
Copy link

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

@olizilla
Copy link
Member

olizilla commented Jan 7, 2019

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
Copy link
Member

olizilla commented Jan 7, 2019

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

@maooricio
Copy link
Author

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

@lidel
Copy link
Member

lidel commented Jan 9, 2019

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 #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" 🙃

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

Hope this helps.

@lidel lidel added the kind/bug A bug in existing code (including security flaws) label Jan 9, 2019
@fsdiogo
Copy link
Contributor

fsdiogo commented Jan 9, 2019

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.

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)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants