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

Node failed to start! Error: Not able to start from state: running #1880

Closed
bgits opened this issue Feb 14, 2019 · 4 comments
Closed

Node failed to start! Error: Not able to start from state: running #1880

bgits opened this issue Feb 14, 2019 · 4 comments

Comments

@bgits
Copy link

bgits commented Feb 14, 2019

const ipfs = new IPFS()

ipfs.on('ready', () => {
  console.log('Node is ready to use!')

  ipfs.start(error => {
    if (error) {
      return console.error('Node failed to start!', error)
    }
    console.log('Node started!')
  })

  ipfs.swarm.peers(function (err, peerInfos) {
    if (err) {
      throw err
    }
    console.log(peerInfos)
  })

  ipfs.swarm.addrs(function (err, addrs) {
    if (err) {
      throw err
    }
    console.log({addrs})
  })

  const validCID = 'QmY8hBsESwuTRSWUh7iMYVKhyVTpt8kacQSFPWRuf8r1iT'

  ipfs.get(validCID, function (err, files) {
    files.forEach((file) => {
      console.log(file.path)
      console.log(file.content.toString('utf8'))
    })
  })

  ipfs.version((err, version) => { console.log({version})})
})

Type: BUG

Severity: High

Description:

ipfs.start throws the error and does not log out:"Node Started'

error: ipfs.js:14 Node failed to start! Error: Not able to start from state: running

Uncaught Error: Not able to start from state: running

It returns no peers but does return 8 addrs. It is not able to get the CID.

Steps to reproduce the error:

I would have that code run on page load in the browser.

@obelisk-dev
Copy link

obelisk-dev commented Feb 14, 2019

I could be wrong but I think you don't need ipfs.start(). I believe when you create the ipfs instance it defaults to start.

@bgits
Copy link
Author

bgits commented Feb 15, 2019

I could be wrong but I think you don't need ipfs.start(). I believe when you create the ipfs instance it defaults to start.

Perhaps but the problem is still there in being unable to retrieve content.

@obelisk-dev
Copy link

Yes. I believe it is caused by the same issue I submitted here #1874

@alanshaw
Copy link
Member

@bgits yes @ethericsol is correct, you do not need to call start unless you explicitly don't start the node by passing start: false to the constructor.

Not being able to fetch content is a dupe of #1874

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants