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.

Validate config and provide good error messages if something is wrong #1193

Closed
@thiagodelgado111

Description

  • Version: 0.27.7
  • Platform:
    ProductName: Mac OS X
    ProductVersion: 10.12.6
    BuildVersion: 16G1114

Type: Bug

Severity: Medium

Description:

If an invalid protocol is specified in Ipfs' config constructor argument, it will be persisted and then pre-start keeps failing due to the invalid protocol – even after changing the config.

Steps to reproduce the error:

› node src/index.js

Swarm listening on /ip4/127.0.0.1/tcp/4001/ipfs/YYYYYYYYYY
I am ready!
Waiting for peers...
peers:  [ '/ip4/127.0.0.1/tcp/9999/ws/ipfs/XXXXXXXXXX' ]

Protocol used on Addresses.Swarm config list /ip6/::/etcp/4001

› node src/index.js

/Users/thiagodelgado/code/ipfs-playground/node_modules/multiaddr/src/protocols-table.js:17
    throw new Error('no protocol with name: ' + proto)
    ^

Error: no protocol with name: etcp

After fixing the config object

› node src/index.js

/Users/thiagodelgado/code/ipfs-playground/node_modules/multiaddr/src/protocols-table.js:17
    throw new Error('no protocol with name: ' + proto)
    ^

Error: no protocol with name: etcp

Same error even though not using that protocol anymore. Editing .jsipfs/config file removing the bad line solved it.

› node src/index.js

Swarm listening on /ip4/127.0.0.1/tcp/4001/ipfs/YYYYYYYYYY
I am ready!
Waiting for peers...
peers:  [ '/ip4/127.0.0.1/tcp/9999/ws/ipfs/XXXXXXXXXX' ]

Metadata

Assignees

Labels

P2Medium: Good to have, but can wait until someone steps upexp/noviceSomeone with a little familiarity can pick uphelp wantedSeeking public contribution on this issue

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions