Search code examples
hyperledgerhyperledger-composer

composer-rest-server Unhandled 'error' event


When I try composer-rest-server -c acme-admin@test-bna I get this output:

Discovering the Returning Transactions..
Discovered types from business network definition
Generating schemas for all types in business network definition ...
Generated schemas for all types in business network definition
Adding schemas for all types to Loopback ...
Added schemas for all types to Loopback
events.js:183
      throw er; // Unhandled 'error' event
      ^

Error: listen EADDRINUSE :::3000
    at Server.setupListenHandle [as _listen2] (net.js:1360:14)
    at listenInCluster (net.js:1401:12)
    at Server.listen (net.js:1485:7)
    at module.exports.promise.then.then (/usr/local/lib/node_modules/composer-rest-server/cli.js:143:19)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)

I am actually doing a udemy course about how to setup a hyperledger multi org network.


Solution

  • The error is showing that the port 3000 is busy.

    EADDRINUSE means some process is already running on that port.

    You can find the process by using the following command:

    sudo ss -lptn 'sport = :3000'
    

    It will return you process id, then you can kill it by:

    sudo kill -9 process_id