You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.
If lisk-migrator is started with --lisk-core-path </custom/path/to/lisk-main-2.1.7> it should read /custom/path/to/lisk-main-2.1.7/config.json which contains a section
"components": {
"storage": {
"user": "nonDefaultPgUser"
}
}
to connect to the pg database.
Actual behavior
It does not read the config.json from lisk-core-path but it uses/generates a default config. Because that default config uses the user 'lisk' to connect to the postgresql database, the connection will fail if a different user has been used to set up the database.
Steps to reproduce
Install Lisk somewhere non-default, like in /opt/lisk/
Setup the postgresql with a different user
create a custom config.json with the mentioned storage section and the non-default pg credentials/database
Verify that lisk-main-2.1.7 works smoothly with the custom db user, configured in config.json
run lisk-migrator --snapshot-height 16270292 --output ~/.lisk/lisk-core/config/mainnet/genesis_block.json --lisk-core-path /opt/lisk/lisk-main-2.1.7
See the following error:
Compiling Lisk Core configuration... done
Loading Lisk Core configuration... done
Verifying Lisk-Core version... 2.1.7 detected
Verifying connection to database "lisk_main"... !
error: role "lisk" does not exist
at Parser.parseErrorMessage (/lisk-migrator/node_modules/pg-protocol/dist/parser.js:278:15)
at Parser.handlePacket (/lisk-migrator/node_modules/pg-protocol/dist/parser.js:126:29)
at Parser.parse (/lisk-migrator/node_modules/pg-protocol/dist/parser.js:39:38)
at Socket. (/lisk-migrator/node_modules/pg-protocol/dist/index.js:10:42)
How to fix
I fixed it like this (not sure if that is the "best" solution):
Replace the following line 20 in lisk-migrator/dist/index.js
const config = await config_1.getConfig(liskCorePath);
with this:
const config = await config_1.getConfig(liskCorePath, path_1.join(liskCorePath, 'config.json'));
Which version(s) does this affect? (Environment, OS, etc...)
Migrator 1.0.1, probably also 1.0.0
The text was updated successfully, but these errors were encountered:
nazarhussain
changed the title
Migrator will fail with custom lisk-main directory, AND a custom 'storage' section (like pg user) in config.json
Migrator could not read the custom configuration file
Aug 17, 2021
Expected behavior
If lisk-migrator is started with --lisk-core-path </custom/path/to/lisk-main-2.1.7> it should read /custom/path/to/lisk-main-2.1.7/config.json which contains a section
"components": {
"storage": {
"user": "nonDefaultPgUser"
}
}
to connect to the pg database.
Actual behavior
It does not read the config.json from lisk-core-path but it uses/generates a default config. Because that default config uses the user 'lisk' to connect to the postgresql database, the connection will fail if a different user has been used to set up the database.
Steps to reproduce
Compiling Lisk Core configuration... done
Loading Lisk Core configuration... done
Verifying Lisk-Core version... 2.1.7 detected
Verifying connection to database "lisk_main"... !
error: role "lisk" does not exist
at Parser.parseErrorMessage (
/lisk-migrator/node_modules/pg-protocol/dist/parser.js:278:15)/lisk-migrator/node_modules/pg-protocol/dist/parser.js:126:29)at Parser.handlePacket (
at Parser.parse (
/lisk-migrator/node_modules/pg-protocol/dist/parser.js:39:38)/lisk-migrator/node_modules/pg-protocol/dist/index.js:10:42)at Socket. (
How to fix
I fixed it like this (not sure if that is the "best" solution):
Replace the following line 20 in lisk-migrator/dist/index.js
const config = await config_1.getConfig(liskCorePath);
with this:
const config = await config_1.getConfig(liskCorePath, path_1.join(liskCorePath, 'config.json'));
Which version(s) does this affect? (Environment, OS, etc...)
Migrator 1.0.1, probably also 1.0.0
The text was updated successfully, but these errors were encountered: