Skip to content

Trying to start non-disposable node fails on second attempt #226

Closed
@negamaxi

Description

@negamaxi

Electron app. Trying to start ipfs daemon in a renderer process with this piece of code:

    const factory = IPFSFactory.create({ type: "go" })
    const startDaemon = (ipfsd) => {
      ipfsd.start(daemonFlags, (err, api) => {
        if (err) {
          reject(err)
        }
        resolve(api)
      })
    }
    factory.spawn({ disposable: false, repoPath: '/my/repo/path/' }, (err, ipfsd) => {
      if (err) {
        reject(err)
      }
      if (ipfsd.initialized) {
        startDaemon(ipfsd)
      } else {
        ipfsd.init((err) => {
          if (err) {
            resolve(err)
          }
          startDaemon(ipfsd)
        })
      }
    })

If repo doesn't exists it works as expected: new repo get initialized, daemon starts, I can see it in my processes list and in subprocess field of ipfsd. But the next time demon does not start, despite the fact that initialized and _started fields are all true. No errors, subprocess field is null. Am I missing something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High: Likely tackled by core team if no one steps upexp/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