Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

jsipfs recursive add with duplicate empty files fails #3255

Closed
@koivunej

Description

  • Version:
$ jsipfs version --all
js-ipfs version: 0.49.0-e7396bc883ad5a6620e2f7bc32e7baf4e636e230
interface-ipfs-core version: ^0.139.0
ipfs-http-client version: ^46.0.0
Repo version: 8
System version: x64/linux
Node.js version: v13.14.0
Commit: e7396bc883ad5a6620e2f7bc32e7baf4e636e230
  • Platform:
$ uname -a
Linux joonas-t495 5.3.0-64-generic #58-Ubuntu SMP Fri Jul 10 19:33:51 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
  • Subsystem:

Not sure.

Severity:

Medium, maybe high. Degraded to low when I realized that the files need to be empty.

Description:

$ jsipfs add -r minimal/
Invalid version, must be a number equal to 1 or 0

Steps to reproduce the error:

$ mkdir -p minimal/sub
$ touch minimal/empty minimal/sub/empty
$ jsipfs add -r minimal
Invalid version, must be a number equal to 1 or 0
$ jsipfs add -r --block-write-concurrency=1 --file-import-concurrency=1 minimal; echo $?
Invalid version, must be a number equal to 1 or 0
1

Error does not happen with:

$ mkdir -p minimal/sub
$ echo foobar > minimal/foobar
$ echo foobar > minimal/sub/foobar
$ jsipfs add -r minimal; echo $?
added QmRgutAxd8t7oGkSm4wmeuByG6M51wcTso6cubDdQtuEfL minimal/foobar
added QmRgutAxd8t7oGkSm4wmeuByG6M51wcTso6cubDdQtuEfL minimal/sub/foobar
added QmYmmkD3dGZjuozuqSzDYjU4ZyhAgc4T4P4SUgY6qjzBi8 minimal/sub
added Qmf8HQdjEJjvq7L8Rk5Nv26xsWrraZum5cRY5bmgsMqewe minimal
0

Hit while testing the pinning out and developing it on the rust-ipfs side. Not sure if this is just a cli bug, but it's easy to reproduce.

Might be related, if you drop the -r from jsipfs add and retry:

$ jsipfs add minimal ; echo $?
The user aborted a request.
1

Metadata

Assignees

No one assigned

    Labels

    kind/bugA bug in existing code (including security flaws)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions