0

I am trying to run a hyperledger fabric network which uses couchdb as peer database. I have prepared the network and run in my local machine, it works.

But now I want to test my network in AWS ec2 instance.

When I try to run the peer with couchdb, couchdb container get exited with error code 137.

Docker version Docker version 19.03.8, build afacb8b7f0

Docker compose version docker-compose version 1.17.1, build unknown

My docker compose file for couchdb is

version: '2'
networks:
  test-net:
services:
  peer1org_couchdb:
    container_name: peer1org_couchdb
    image: hyperledger/fabric-couchdb:latest     <----- also tried with 0.4.18
    environment:
      - COUCHDB_USER=admin
      - COUCHDB_PASSWORD=1234
    ports:
      - 1502:5984
    networks:
      - test-net

Output log during running the yaml file with the command docker-compose -f docker-compose.yaml up peer1org_couchdb

Creating peer1org_couchdb ... 
Creating peer1org_couchdb ... done
Attaching to peer1org_couchdb
peer1org_couchdb      | [info] 2020-04-17T10:22:59.190969Z nonode@nohost <0.9.0> -------- Application couch_log started on node nonode@nohost
peer1org_couchdb      | [info] 2020-04-17T10:22:59.227891Z nonode@nohost <0.9.0> -------- Application folsom started on node nonode@nohost
peer1org_couchdb      | [info] 2020-04-17T10:23:00.036441Z nonode@nohost <0.9.0> -------- Application couch_stats started on node nonode@nohost
peer1org_couchdb      | [info] 2020-04-17T10:23:00.036577Z nonode@nohost <0.9.0> -------- Application khash started on node nonode@nohost
peer1org_couchdb      | [info] 2020-04-17T10:23:00.636872Z nonode@nohost <0.9.0> -------- Application couch_event started on node nonode@nohost
peer1org_couchdb      | [info] 2020-04-17T10:23:00.637081Z nonode@nohost <0.9.0> -------- Application hyper started on node nonode@nohost
peer1org_couchdb      | [info] 2020-04-17T10:23:01.089753Z nonode@nohost <0.9.0> -------- Application ibrowse started on node nonode@nohost
peer1org_couchdb      | [info] 2020-04-17T10:23:01.439671Z nonode@nohost <0.9.0> -------- Application ioq started on node nonode@nohost
peer1org_couchdb      | [info] 2020-04-17T10:23:01.439942Z nonode@nohost <0.9.0> -------- Application mochiweb started on node nonode@nohost
peer1org_couchdb      | [info] 2020-04-17T10:23:01.856778Z nonode@nohost <0.202.0> -------- Apache CouchDB 2.3.1 is starting.
peer1org_couchdb      | 
peer1org_couchdb      | [info] 2020-04-17T10:23:01.856901Z nonode@nohost <0.203.0> -------- Starting couch_sup
peer1org_couchdb      | [notice] 2020-04-17T10:23:02.055980Z nonode@nohost <0.86.0> -------- config: [features] pluggable-storage-engines set to true for reason nil
peer1org_couchdb      | [notice] 2020-04-17T10:23:02.239826Z nonode@nohost <0.86.0> -------- config: [admins] admin set to -pbkdf2-427945f79512e34d95218cc52e78566b9f4d8e48,aed422e86df0741649f31a8ea008c8c5,1000 for reason nil
peer1org_couchdb      | [notice] 2020-04-17T10:23:02.913517Z nonode@nohost <0.86.0> -------- config: [couchdb] uuid set to 6ced2fbea41a5cee13aa97dca6230b80 for reason nil
peer1org_couchdb      | [info] 2020-04-17T10:23:03.923379Z nonode@nohost <0.208.0> -------- open_result error {not_found,no_db_file} for _users
peer1org_couchdb      | [info] 2020-04-17T10:23:05.113342Z nonode@nohost <0.202.0> -------- Apache CouchDB has started. Time to relax.
peer1org_couchdb      | 
peer1org_couchdb      | [info] 2020-04-17T10:23:05.113411Z nonode@nohost <0.202.0> -------- Apache CouchDB has started on http://any:5986/
peer1org_couchdb      | [info] 2020-04-17T10:23:05.167998Z nonode@nohost <0.9.0> -------- Application couch started on node nonode@nohost
peer1org_couchdb      | [info] 2020-04-17T10:23:05.168038Z nonode@nohost <0.9.0> -------- Application ets_lru started on node nonode@nohost
peer1org_couchdb      | [notice] 2020-04-17T10:23:06.093559Z nonode@nohost <0.290.0> -------- rexi_server : started servers
peer1org_couchdb      | [notice] 2020-04-17T10:23:06.166401Z nonode@nohost <0.295.0> -------- rexi_buffer : started servers
peer1org_couchdb      | [info] 2020-04-17T10:23:06.166662Z nonode@nohost <0.9.0> -------- Application rexi started on node nonode@nohost
peer1org_couchdb      | [info] 2020-04-17T10:23:06.458809Z nonode@nohost <0.208.0> -------- open_result error {not_found,no_db_file} for _nodes
peer1org_couchdb      | [warning] 2020-04-17T10:23:06.458855Z nonode@nohost <0.303.0> -------- creating missing database: _nodes
peer1org_couchdb      | [info] 2020-04-17T10:23:06.860150Z nonode@nohost <0.208.0> -------- open_result error {not_found,no_db_file} for _dbs
peer1org_couchdb      | [warning] 2020-04-17T10:23:06.860194Z nonode@nohost <0.318.0> -------- creating missing database: _dbs
peer1org_couchdb      | [warning] 2020-04-17T10:23:06.860238Z nonode@nohost <0.317.0> -------- creating missing database: _dbs
peer1org_couchdb      | [info] 2020-04-17T10:23:06.969823Z nonode@nohost <0.9.0> -------- Application mem3 started on node nonode@nohost
peer1org_couchdb      | [info] 2020-04-17T10:23:06.969978Z nonode@nohost <0.9.0> -------- Application fabric started on node nonode@nohost
peer1org_couchdb      | [info] 2020-04-17T10:23:07.477864Z nonode@nohost <0.9.0> -------- Application chttpd started on node nonode@nohost
peer1org_couchdb      | [notice] 2020-04-17T10:23:08.761738Z nonode@nohost <0.372.0> -------- chttpd_auth_cache changes listener died database_does_not_exist at mem3_shards:load_shards_from_db/6(line:395) <= mem3_shards:load_shards_from_disk/1(line:370) <= mem3_shards:load_shards_from_disk/2(line:399) <= mem3_shards:for_docid/3(line:86) <= fabric_doc_open:go/3(line:39) <= chttpd_auth_cache:ensure_auth_ddoc_exists/2(line:195) <= chttpd_auth_cache:listen_for_changes/1(line:142)
peer1org_couchdb      | [error] 2020-04-17T10:23:08.767611Z nonode@nohost emulator -------- Error in process <0.373.0> with exit value:
peer1org_couchdb      | {database_does_not_exist,[{mem3_shards,load_shards_from_db,"_users",[{file,"src/mem3_shards.erl"},{line,395}]},{mem3_shards,load_shards_from_disk,1,[{file,"src/mem3_shards.erl"},{line,370}]},{mem3_shards,load_shards_from_disk,2,[{file,"src/mem3_shards.erl"},{line,399}]},{mem3_shards,for_docid,3,[{file,"src/mem3_shards.erl"},{line,86}]},{fabric_doc_open,go,3,[{file,"src/fabric_doc_open.erl"},{line,39}]},{chttpd_auth_cache,ensure_auth_ddoc_exists,2,[{file,"src/chttpd_auth_cache.erl"},{line,195}]},{chttpd_auth_cache,listen_for_changes,1,[{file,"src/chttpd_auth_cache.erl"},{line,142}]}]}
peer1org_couchdb      | 
peer1org_couchdb      | [info] 2020-04-17T10:23:09.149961Z nonode@nohost <0.9.0> -------- Application couch_index started on node nonode@nohost
peer1org_couchdb      | [info] 2020-04-17T10:23:09.149989Z nonode@nohost <0.9.0> -------- Application couch_mrview started on node nonode@nohost
peer1org_couchdb      | [info] 2020-04-17T10:23:09.150041Z nonode@nohost <0.9.0> -------- Application couch_plugins started on node nonode@nohost
peer1org_couchdb      | [notice] 2020-04-17T10:23:09.824221Z nonode@nohost <0.86.0> -------- config: [features] scheduler set to true for reason nil
peer1org_couchdb      | [info] 2020-04-17T10:23:10.153499Z nonode@nohost <0.208.0> -------- open_result error {not_found,no_db_file} for _replicator
peer1org_couchdb      | [notice] 2020-04-17T10:23:10.204544Z nonode@nohost <0.406.0> -------- creating replicator ddoc <<"_replicator">>
peer1org_couchdb      | [info] 2020-04-17T10:23:10.568612Z nonode@nohost <0.9.0> -------- Application couch_replicator started on node nonode@nohost
peer1org_couchdb      | [info] 2020-04-17T10:23:10.713222Z nonode@nohost <0.9.0> -------- Application couch_peruser started on node nonode@nohost
peer1org_couchdb      | [info] 2020-04-17T10:23:11.018006Z nonode@nohost <0.9.0> -------- Application ddoc_cache started on node nonode@nohost
peer1org_couchdb      | [info] 2020-04-17T10:23:12.965526Z nonode@nohost <0.9.0> -------- Application global_changes started on node nonode@nohost
peer1org_couchdb      | [info] 2020-04-17T10:23:12.965695Z nonode@nohost <0.9.0> -------- Application jiffy started on node nonode@nohost
peer1org_couchdb      | [info] 2020-04-17T10:23:13.695403Z nonode@nohost <0.9.0> -------- Application mango started on node nonode@nohost
peer1org_couchdb      | [notice] 2020-04-17T10:23:13.763130Z nonode@nohost <0.372.0> -------- chttpd_auth_cache changes listener died database_does_not_exist at mem3_shards:load_shards_from_db/6(line:395) <= mem3_shards:load_shards_from_disk/1(line:370) <= mem3_shards:load_shards_from_disk/2(line:399) <= mem3_shards:for_docid/3(line:86) <= fabric_doc_open:go/3(line:39) <= chttpd_auth_cache:ensure_auth_ddoc_exists/2(line:195) <= chttpd_auth_cache:listen_for_changes/1(line:142)
peer1org_couchdb      | [error] 2020-04-17T10:23:13.787365Z nonode@nohost emulator -------- Error in process <0.539.0> with exit value:
peer1org_couchdb      | {database_does_not_exist,[{mem3_shards,load_shards_from_db,"_users",[{file,"src/mem3_shards.erl"},{line,395}]},{mem3_shards,load_shards_from_disk,1,[{file,"src/mem3_shards.erl"},{line,370}]},{mem3_shards,load_shards_from_disk,2,[{file,"src/mem3_shards.erl"},{line,399}]},{mem3_shards,for_docid,3,[{file,"src/mem3_shards.erl"},{line,86}]},{fabric_doc_open,go,3,[{file,"src/fabric_doc_open.erl"},{line,39}]},{chttpd_auth_cache,ensure_auth_ddoc_exists,2,[{file,"src/chttpd_auth_cache.erl"},{line,195}]},{chttpd_auth_cache,listen_for_changes,1,[{file,"src/chttpd_auth_cache.erl"},{line,142}]}]}
peer1org_couchdb      | 
peer1org_couchdb      | [info] 2020-04-17T10:23:14.080708Z nonode@nohost <0.9.0> -------- Application setup started on node nonode@nohost
peer1org_couchdb      | [info] 2020-04-17T10:23:14.080874Z nonode@nohost <0.9.0> -------- Application snappy started on node nonode@nohost
peer1org_couchdb      | [notice] 2020-04-17T10:23:14.407911Z nonode@nohost <0.426.0> -------- couch_replicator_clustering : cluster stable
peer1org_couchdb      | [notice] 2020-04-17T10:23:14.535225Z nonode@nohost <0.443.0> -------- Started replicator db changes listener <0.545.0>
peer1org_couchdb exited with code 137

Docker inspect shows the following result

"State": {
            "Status": "exited",
            "Running": false,
            "Paused": false,
            "Restarting": false,
            "OOMKilled": false,
            "Dead": false,
            "Pid": 0,
            "ExitCode": 137,
            "Error": "",
            "StartedAt": "2020-04-17T10:22:51.714367761Z",
            "FinishedAt": "2020-04-17T10:23:16.225929262Z"
        },
mkrieger1
  • 19,194
  • 5
  • 54
  • 65
iOS-Developer84
  • 654
  • 8
  • 19
  • Did you notice `{database_does_not_exist,` from the logs ? Could you try this https://stackoverflow.com/a/41967810/2087704 ? – invad0r Apr 17 '20 at 12:24
  • @invad0r thankd for your comment. So far I understand, couchdb container will run first and after successfully run the container peer container will run and create the database to couchdb. It will then store the system chaincode related information to the couchdb. Could you please explain little more when I will execute the command suggested by your link. – iOS-Developer84 Apr 17 '20 at 13:16

0 Answers0