letheanVPN / lthn-app-vpn

Client/Server dVPN
https://www.lt.hn
European Union Public License 1.2
36 stars 16 forks source link

Problem to access RPC wallet on upgraded docker dev version #59

Open ronnylov opened 5 years ago

ronnylov commented 5 years ago

Upgraded docker from docker hub devel version https://hub.docker.com/r/limosek/lethean-vpn

Noticed some ENV variables had changed defaults. So to use my configuration I created a docker container using following bash script: `#!/bin/bash

docker run -t -i \ -e DAEMON_HOST="fr01.lethernet.com" \ -e WALLET_FILE="vpn" \ -e WALLET_PASSWORD="abcd1234" \ -e WALLET_RPC_PASSWORD="SecretPass" \ -p 8080:8080 \ --mount type=bind,source=/home/lethe/etc,target=/opt/lthn/etc \ --mount type=bind,source=/home/lethe/log,target=/opt/lthn/var/log \ --mount type=bind,source=/dev/log,target=/dev/log \ -d --restart unless-stopped \ --name lethean-vpn limosek/lethean-vpn:devel`

Then I checked the log with docker logs lethean-vpn

Go following Starting zabbix agent Starting squid -f /opt/lthn/etc//squid.conf Starting Wallet RPC server with /opt/lthn/etc//vpn. Lethean 'Congo' (v3.0.0-release) Logging to /var/log/wallet.log 2019-02-04 22:35:56.841 7f69b095fec0 WARN wallet.vpn.rpc src/wallet/wallet_vpn_rpc_server.cpp:662 Loading wallet... 2019-02-04 22:35:56.841 7f69b095fec0 WARN wallet.wallet2 src/wallet/wallet2.cpp:2738 Original wallet file name: /opt/lthn/etc//vpn -- fixed: /opt/lthn/etc//vpn 2019-02-04 22:35:56.866 7f69b095fec0 WARN wallet.wallet2 src/wallet/wallet2.cpp:2755 Loaded wallet keys file, with public address: iz4HSpFcbqEM3Pwvukn5GF131VdxaxERKgHikiT5uQQLHW1VR7ud5MJTBokrQtt9hqeBscDs4KRQuNhzHEG7Rvq42qByKrB6F 2019-02-04 22:35:58.873 7f69b095fec0 WARN wallet.vpn.rpc src/wallet/wallet_vpn_rpc_server.cpp:189 RPC username/password is stored in file lethean-wallet-vpn-rpc.14660.login 2019-02-04 22:35:58.873 7f69b095fec0 INFO global contrib/epee/include/net/http_server_impl_base.h:70 Binding on 127.0.0.1:14660 2019-02-04 22:35:58.873 7f69b095fec0 WARN wallet.vpn.rpc src/wallet/wallet_vpn_rpc_server.cpp:707 Starting wallet rpc server Starting dispatcher INFO:audit:action=START,type=SERVICE,obj=lthnvpnd, WARNING:lthnvpnd:Unknown parameter enabled for service 1A INFO:audit:action=START,type=SERVICE,serviceid=1A,cmd='/usr/sbin/haproxy -Ds -p /opt/lthn//var/proxy_1A//pid -f /opt/lthn//var/proxy_1A//cfg', ERROR:lthnvpnd:Wallet RPC error 404! Will not receive payments! ERROR:lthnvpnd:Wallet RPC error 404! Will not receive payments! ERROR:lthnvpnd:No connection to wallet. Exiting

This message repeats over and over when it tries to start but it keeps failing. I see that it say "RPC username/password is stored in file lethean-wallet-vpn-rpc.14660.login" But I can't find this file in my mounted directories and cant get into the docker container to check it because it complains about that the docker container has not finnished starting.

Need help to figure out what is wrong.

ronnylov commented 5 years ago

Additional info. First time I created the container I did not add environmental variables. Thought the defaults were the same as before.

limosek commented 5 years ago

I think that problem is that these env variables cannot be changed after first easy-deploy. ENV variables helps to easy-deploy to be configured. But it generates etc files. You must edit etc files generated by easy-deploy if you want to change something. There are two ways how to continue here. Either to save ENV variables permanently during easy-deploy so it will be known for future runs or just throw an error if you are changing some env variable which cannot be change later.

ronnylov commented 5 years ago

I have checked dispatcher.ini and the rpc password is set to SecretPass there, the same as in the ENV passed. I have the same error.

When running docker, where does it store the wallet rpc password set in the wallet? I think I need to do something else than just matching environmental variable password with dispatcher.ini

ronnylov commented 5 years ago

I got a similar issue on a non-docker installation. It might be related to that I first created a new wallet with same name as an old wallet. Then copied the old wallet files to replace the wallet created by the script. This made something corrupt and I had to remove one of the wallet files (the one without extension) that keeps some kind of database for the wallet. Then do a full sync of the wallet again. I have not yet confirmed this was the issue on docker since I don't use docker right now but I highly suspect it.

I guess steps required for migrating from non-docker to docker version of exit node could be nice.