ot-node
ot-node copied to clipboard
ERROR: Module initialization failed. Error message: Module is required but got error during initialization
Issue description
Module initialization fails and node doesn't start when a sql repository password is not used during installation.
Expected behavior
Node starts after installation completes.
Actual behavior
Node does not start and remains in a reboot loop.
Steps to reproduce the problem
- Run the installer.sh on a fresh server
- Press Enter (no password) when prompted for sql repository password
- Node does not start and remains in a reboot loop
Specifications
- Node version: OriginTrail Node v6.0.0-beta.2.0
- Platform: Ubuntu 20.04
- Node wallet: 0x1ec3b45A5f744C338a8501c4C477b71594BF8e34
- Node libp2p identity: QmVQKLHVTwwrHXkkY7YykrZMoJSQT3Fn8X7betQu7VfrDr
Contact details
- Email: [email protected]
Error logs
ERROR: Module initialization failed. Error message: Module is required but got error during initialization - Access denied for user 'root'@'localhost' (using password: YES)

Disclaimer
Please be aware that the issue reported on a public repository allows everyone to see your node logs, node details, and contact details. If you have any sensitive information, feel free to share it by sending an email to [email protected].
Hey @Valcyclovir, what is the content of /root/current/.env ?
/root/current/.env contains this:
REPOSITORY_PASSWORD= NODE_ENV=testnet
Both completely removing
REPOSITORY_PASSWORD=
or adding ""
REPOSITORY_PASSWORD=""
Would generate the same error
@djordjekovac I think this is the issue. If password is empty in .env file, node will get default password from config, which is set to "password"
I confirm that removing "password" from ot-node/current/config/config.json "testnet" object allows the node to start.
Now that mainnet is launched, I suggest finding a better way to secure our assets by assigning a configuration file with the MySQL password, rather than using .env file, which is deemed as extremely unsafe.
We can create a file ~/ot-node/current/.mysql.cnf
with the following:
[client] password=<mysql_password_here>
apply permissions chmod 600 ~/ot-node/current/.mysql.cnf
then every time we need to interact with mysql, we use the option --defaults-file=~/ot-node/current/.mysql.cnf
Thoughts ?
As for the empty sql password problem, for security reasons, perhaps it is not safe to leave the option to not have a sql password on the installer. I could "force" the node runner to apply a sql password.