Lisk-sdk: Obtain error `AssertionError [ERR_ASSERTION]: missing path` while start node

Created on 14 Nov 2018  路  4Comments  路  Source: LiskHQ/lisk-sdk

Expected behavior

Run blockchain

Actual behavior

Obtain error:

[ERR] 2018-11-14 13:18:43 | AssertionError [ERR_ASSERTION]: missing path
    at Module.require (module.js:595:3)
    at require (internal/module.js:11:18)
    at new SCServer (/home/lisk/lisk/node_modules/socketcluster-server/scserver.js:103:18)
    at Object.module.exports.attach (/home/lisk/lisk/node_modules/socketcluster-server/index.js:65:29)
    at /home/lisk/lisk/node_modules/socketcluster/scworker.js:210:41
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:189:7)
    at Function.Module.runMain (module.js:696:11)
    at startup (bootstrap_node.js:204:16)
    at bootstrap_node.js:625:3

Steps to reproduce

$(CONFIG_FILE)

$ cat config.json
{
  "wsPort": 8001,
  "httpPort": 8000,
  "address": "0.0.0.0",
  "version": "1.2.1",
  "minVersion": ">=1.0.0",
  "fileLogLevel": "info",
  "logFileName": "logs/mainnet/lisk.log",
  "consoleLogLevel": "none",
  "trustProxy": false,
  "topAccounts": false,
  "cacheEnabled": false,
  "wsWorkers": 1,
  "db": {
    "host": "lisk-node-db",
    "port": 5432,
    "database": "$(DATABASE)",
    "user": "$(DB_USER)",
    "password": "$(DB_PASS)",
    "min": 10,
    "max": 95,
    "poolIdleTimeout": 30000,
    "reapIntervalMillis": 1000,
    "logEvents": [
      "error"
    ],
    "logFileName": "logs/mainnet/lisk_db.log"
  },
  "redis": {
    "host": "127.0.0.1",
    "port": 6380,
    "db": 0,
    "password": null
  },
  "api": {
    "enabled": true,
    "access": {
      "public": true,
      "whiteList": [
        "127.0.0.1"
      ]
    },
    "ssl": {
      "enabled": false,
      "options": {
        "port": 443,
        "address": "0.0.0.0",
        "key": "./ssl/lisk.key",
        "cert": "./ssl/lisk.crt"
      }
    },
    "options": {
      "limits": {
        "max": 0,
        "delayMs": 0,
        "delayAfter": 0,
        "windowMs": 60000
      },
      "cors": {
        "origin": "*",
        "methods": [
          "GET",
          "POST",
          "PUT"
        ]
      }
    }
  },
  "peers": {
    "enabled": true,
    "list": [
      {
        "ip": "mainnet-seed-01.lisk.io",
        "wsPort": 8001
      },
      {
        "ip": "mainnet-seed-02.lisk-nodes.net",
        "wsPort": 8001
      },
      {
        "ip": "mainnet-seed-03.lisk.io",
        "wsPort": 8001
      },
      {
        "ip": "mainnet-seed-04.lisk-nodes.net",
        "wsPort": 8001
      },
      {
        "ip": "mainnet-seed-05.lisk.io",
        "wsPort": 8001
      },
      {
        "ip": "mainnet-seed-06.lisk-nodes.net",
        "wsPort": 8001
      },
      {
        "ip": "mainnet-seed-07.lisk.io",
        "wsPort": 8001
      },
      {
        "ip": "mainnet-seed-08.lisk-nodes.net",
        "wsPort": 8001
      },
      {
        "ip": "mainnet-seed-09.lisk.io",
        "wsPort": 8001
      },
      {
        "ip": "mainnet-seed-10.lisk-nodes.net",
        "wsPort": 8001
      }
    ],
    "access": {
      "blackList": []
    },
    "options": {
      "timeout": 5000,
      "broadhashConsensusCalculationInterval": 5000
    }
  },
  "broadcasts": {
    "active": true,
    "broadcastInterval": 5000,
    "broadcastLimit": 25,
    "parallelLimit": 20,
    "releaseLimit": 25,
    "relayLimit": 3
  },
  "transactions": {
    "maxTransactionsPerQueue": 1000
  },
  "forging": {
    "force": false,
    "delegates": [],
    "access": {
      "whiteList": [
        "127.0.0.1"
      ]
    }
  },
  "syncing": {
    "active": true
  },
  "loading": {
    "loadPerIteration": 5000
  },
  "nethash": "ed14889723f24ecc54871d058d98ce91ff2f973192075c0155ba2b7b70ad2511"
}

$ docker run --name lisk-node-db \
        --net lisk \
        -e "POSTGRES_DB=$(DATABASE)"  \
        -e "POSTGRES_USER=$(DB_USER)"  \
        -e "POSTGRES_PASSWORD=$(DB_PASS)"  \
        -v $(PWD)/data:/var/lib/postgresql/data \
        postgres:10-alpine

$ docker run --net lisk \
        --expose 8000 \
        -v $(PWD)/logs:/home/lisk/lisk/logs \
        -v $(CONFIG_FILE):/home/lisk/lisk/config/default/config.json \
        -p 8001:8001 \
        lisk/core:1.2.1

Which version(s) does this affect? (Environment, OS, etc...)

1.2.1

bug

Most helpful comment

Hello @Magestro,

your docker setup seems very different from what we suggest in the documentation so it is hard to troubleshoot. I have a guess though:
-v $(CONFIG_FILE):/home/lisk/lisk/config/default/config.json
this will overwrite the default configuration which one should never do (one should never touch the files in the config/ directory, see the README); instead you should make the changes your need in /home/lisk/lisk/config.json. Or better yet use the configuration variables (example).

If this issue persists please provide the output of docker logs for both containers (and a bit more than just the above stacktrace)

All 4 comments

Hello @Magestro,

your docker setup seems very different from what we suggest in the documentation so it is hard to troubleshoot. I have a guess though:
-v $(CONFIG_FILE):/home/lisk/lisk/config/default/config.json
this will overwrite the default configuration which one should never do (one should never touch the files in the config/ directory, see the README); instead you should make the changes your need in /home/lisk/lisk/config.json. Or better yet use the configuration variables (example).

If this issue persists please provide the output of docker logs for both containers (and a bit more than just the above stacktrace)

Hello @fchavant,
thx for the quick reaction!

i try to run node with default config like here:

$ docker run \
        --net lisk \
        --rm \
        --env LISK_DB_HOST="lisk-node-db" \
        --env LISK_DB_USER="lisk" \
        --env LISK_DB_PASSWORD="password" \
        --env LISK_DB_NAME="lisk" \
        --env LISK_API_PUBLIC=true \
        -v ${PWD}/logs:/home/lisk/lisk/logs \
        -p 8001:8001 \
        -p 8000:8000 \
        lisk/core:1.2.0

here im not rewrite config file and pass db credentials throw env variables

But in this case i got this and node still not running:

docker logs lisk-node

$ docker logs lisk-node
[
    {
        "code": "UNUSED_DEFINITION",
        "message": "Definition is not used: #/definitions/CommonBlock",
        "path": [
            "definitions",
            "CommonBlock"
        ]
    },
    {
        "code": "UNUSED_DEFINITION",
        "message": "Definition is not used: #/definitions/PeersList",
        "path": [
            "definitions",
            "PeersList"
        ]
    },
    {
        "code": "UNUSED_DEFINITION",
        "message": "Definition is not used: #/definitions/WSPeerHeaders",
        "path": [
            "definitions",
            "WSPeerHeaders"
        ]
    },
    {
        "code": "UNUSED_DEFINITION",
        "message": "Definition is not used: #/definitions/WSPeerUpdateRequest",
        "path": [
            "definitions",
            "WSPeerUpdateRequest"
        ]
    },
    {
        "code": "UNUSED_DEFINITION",
        "message": "Definition is not used: #/definitions/WSSignaturesList",
        "path": [
            "definitions",
            "WSSignaturesList"
        ]
    },
    {
        "code": "UNUSED_DEFINITION",
        "message": "Definition is not used: #/definitions/WSBlocksList",
        "path": [
            "definitions",
            "WSBlocksList"
        ]
    },
    {
        "code": "UNUSED_DEFINITION",
        "message": "Definition is not used: #/definitions/WSBlocksCommonRequest",
        "path": [
            "definitions",
            "WSBlocksCommonRequest"
        ]
    },
    {
        "code": "UNUSED_DEFINITION",
        "message": "Definition is not used: #/definitions/WSTransactionsRequest",
        "path": [
            "definitions",
            "WSTransactionsRequest"
        ]
    },
    {
        "code": "UNUSED_DEFINITION",
        "message": "Definition is not used: #/definitions/WSAccessObject",
        "path": [
            "definitions",
            "WSAccessObject"
        ]
    },
    {
        "code": "UNUSED_DEFINITION",
        "message": "Definition is not used: #/definitions/WSTransactionsResponse",
        "path": [
            "definitions",
            "WSTransactionsResponse"
        ]
    },
    {
        "code": "UNUSED_DEFINITION",
        "message": "Definition is not used: #/definitions/WSSignaturesResponse",
        "path": [
            "definitions",
            "WSSignaturesResponse"
        ]
    },
    {
        "code": "UNUSED_DEFINITION",
        "message": "Definition is not used: #/definitions/WSBlocksBroadcast",
        "path": [
            "definitions",
            "WSBlocksBroadcast"
        ]
    }
]

docker logs lisk-node-db

$ docker logs lisk-node-db
2018-11-15 12:08:16.272 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
2018-11-15 12:08:16.272 UTC [1] LOG:  listening on IPv6 address "::", port 5432
2018-11-15 12:08:16.322 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
2018-11-15 12:08:16.398 UTC [20] LOG:  database system was shut down at 2018-11-15 12:07:27 UTC
2018-11-15 12:08:16.448 UTC [1] LOG:  database system is ready to accept connections

I cannot reproduce your issue, here is what I tried (starting from a clean docker 18.03.1-ce installation):

docker network create lisk
docker run --name lisk-node-db --net lisk -e POSTGRES_DB=lisk_db -e POSTGRES_USER=lisk_user -e POSTGRES_PASSWORD=lisk_password postgres:10-alpine
docker run --net lisk -e LISK_DB_HOST=lisk-node-db -e LISK_DB_USER=lisk_user -e LISK_DB_PASSWORD=lisk_password -e LISK_DB_NAME=lisk_db -e LISK_CONSOLE_LOG_LEVEL=info -p 8000:8000 -p 8001:8001 lisk/core:1.2.0

The above works fine. Still I would strongly suggest you follow our documentation and use docker-compose.

@fchavant i tried this:

0 | 2018-11-15 06:56:43 PM @ 16 [/tmp/steem/db]
$ docker run -d --name lisk-node-db --net lisk -e POSTGRES_DB=lisk_db -e POSTGRES_USER=lisk_user -e POSTGRES_PASSWORD=lisk_password postgres:10-alpine
70b4d374f809ad5d4d332d7eced40362f62a81b42ef10f7ba869d7b990a6d925
0 | 2018-11-15 06:56:51 PM @ 16 [/tmp/steem/db]
$ cd ../
0 | 2018-11-15 06:56:53 PM @ 16 [/tmp/steem]
$ mkdir node
0 | 2018-11-15 06:56:58 PM @ 16 [/tmp/steem]
$ cd node/ 
0 | 2018-11-15 06:57:03 PM @ 16 [/tmp/steem/node]
$ docker run --net lisk -e LISK_DB_HOST=lisk-node-db -e LISK_DB_USER=lisk_user -e LISK_DB_PASSWORD=lisk_password -e LISK_DB_NAME=lisk_db -e LISK_CONSOLE_LOG_LEVEL=info -p 8000:8000 -p 8001:8001 lisk/core:1.2.0
[inf] 2018-11-15 15:57:13 | Starting lisk with "mainnet" genesis block.
[inf] 2018-11-15 15:57:17 | Socket Cluster ready for incoming connections
[inf] 2018-11-15 15:57:17 | Releasing enqueued broadcasts
[inf] 2018-11-15 15:57:17 | Queue empty
WARNING: NODE_ENV value of 'production' did not match any deployment config file names.
WARNING: See https://github.com/lorenwest/node-config/wiki/Strict-Mode
[{"code":"UNUSED_DEFINITION","message":"Definition is not used: #/definitions/CommonBlock","path":["definitions","CommonBlock"]},{"code":"UNUSED_DEFINITION","message":"Definition is not used: #/definitions/PeersList","path":["definitions","PeersList"]},{"code":"UNUSED_DEFINITION","message":"Definition is not used: #/definitions/WSPeerHeaders","path":["definitions","WSPeerHeaders"]},{"code":"UNUSED_DEFINITION","message":"Definition is not used: #/definitions/WSPeerUpdateRequest","path":["definitions","WSPeerUpdateRequest"]},{"code":"UNUSED_DEFINITION","message":"Definition is not used: #/definitions/WSSignaturesList","path":["definitions","WSSignaturesList"]},{"code":"UNUSED_DEFINITION","message":"Definition is not used: #/definitions/WSBlocksList","path":["definitions","WSBlocksList"]},{"code":"UNUSED_DEFINITION","message":"Definition is not used: #/definitions/WSBlocksCommonRequest","path":["definitions","WSBlocksCommonRequest"]},{"code":"UNUSED_DEFINITION","message":"Definition is not used: #/definitions/WSTransactionsRequest","path":["definitions","WSTransactionsRequest"]},{"code":"UNUSED_DEFINITION","message":"Definition is not used: #/definitions/WSAccessObject","path":["definitions","WSAccessObject"]},{"code":"UNUSED_DEFINITION","message":"Definition is not used: #/definitions/WSTransactionsResponse","path":["definitions","WSTransactionsResponse"]},{"code":"UNUSED_DEFINITION","message":"Definition is not used: #/definitions/WSSignaturesResponse","path":["definitions","WSSignaturesResponse"]},{"code":"UNUSED_DEFINITION","message":"Definition is not used: #/definitions/WSBlocksBroadcast","path":["definitions","WSBlocksBroadcast"]}] 2
[inf] 2018-11-15 15:57:19 | Lisk started: 0.0.0.0:8000
[inf] 2018-11-15 15:57:19 | Modules ready and launched
[inf] 2018-11-15 15:57:19 | Blocks 1
[inf] 2018-11-15 15:57:19 | Genesis block loading - 0.01223 %: applied 1 of 8176 transactions
[inf] 2018-11-15 15:57:22 | Releasing enqueued broadcasts
[inf] 2018-11-15 15:57:22 | Queue empty
[inf] 2018-11-15 15:57:24 | Genesis block loading - 1.235 %: applied 101 of 8176 transactions
[inf] 2018-11-15 15:57:27 | Releasing enqueued broadcasts
[inf] 2018-11-15 15:57:27 | Queue empty
[inf] 2018-11-15 15:57:32 | Releasing enqueued broadcasts
[inf] 2018-11-15 15:57:32 | Queue empty
[inf] 2018-11-15 15:57:34 | Genesis block loading - 2.458 %: applied 201 of 8176 transactions
[inf] 2018-11-15 15:57:38 | Releasing enqueued broadcasts
[inf] 2018-11-15 15:57:38 | Queue empty
[inf] 2018-11-15 15:57:39 | Genesis block loading - 3.682 %: applied 301 of 8176 transactions
[inf] 2018-11-15 15:57:43 | Releasing enqueued broadcasts
[inf] 2018-11-15 15:57:43 | Queue empty
[inf] 2018-11-15 15:57:43 | Genesis block loading - 4.905 %: applied 401 of 8176 transactions

and accure the same message, but node start syncing.
so it's seems like my fail. Excuse for troubling, i go to debug my code.

you can close issue and thanks for answers!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MaciejBaj picture MaciejBaj  路  3Comments

karek314 picture karek314  路  3Comments

Tschakki picture Tschakki  路  4Comments

willclarktech picture willclarktech  路  4Comments

slaweet picture slaweet  路  3Comments