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

Pipe to self: "Error: Lock file is already being hold" #1835

Closed
@alanshaw

Description

@alanshaw

jsipfs cid base32 fails to start because repo is locked by jsipfs add -q

$ echo "hello world" | jsipfs add -q | DEBUG=* jsipfs cid base32
  cli daemon is off +0ms
  jsipfs EXPERIMENTAL pubsub is enabled +0ms
  jsipfs booting +2ms
  repo opening at: /Users/alan/.jsipfs +0ms
  repo init check +1ms
  repo:version comparing version: 7 and 7 +0ms
  repo init null { config: true, spec: true, version: undefined } +3ms
  repo:lock locking /Users/alan/.jsipfs/repo.lock +0ms
  repo:lock Error: Lock file is already being hold
  repo:lock     at options.fs.stat (/Users/alan/Code/protocol-labs/js-ipfs/node_modules/proper-lockfile/lib/lockfile.js:54:47)
  repo:lock     at /Users/alan/Code/protocol-labs/js-ipfs/node_modules/graceful-fs/polyfills.js:285:20
  repo:lock     at FSReqWrap.oncomplete (fs.js:155:5) +3ms
events.js:167
      throw er; // Unhandled 'error' event
      ^

Error: write EPIPE
    at WriteWrap.afterWrite [as oncomplete] (net.js:792:14)
Emitted 'error' event at:
    at onwriteError (_stream_writable.js:431:12)
    at onwrite (_stream_writable.js:456:5)
    at _destroy (internal/streams/destroy.js:40:7)
    at Socket.dummyDestroy [as _destroy] (internal/process/stdio.js:11:34)
    at Socket.destroy (internal/streams/destroy.js:32:8)
    at WriteWrap.afterWrite [as oncomplete] (net.js:794:10)

I think go-ipfs has the concept of command requirements, perhaps we need something similar i.e. jsipfs cid does not require a repo so shouldn't need to obtain a lock.

Metadata

Metadata

Assignees

Labels

P3Low: Not priority right nowexp/expertHaving worked on the specific codebase is importanthelp wantedSeeking public contribution on this issuekind/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