Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli_wallet: 0 Exception: unspecified - "Timer Expired" #194

Closed
DemonRx opened this issue Jul 1, 2017 · 30 comments
Closed

cli_wallet: 0 Exception: unspecified - "Timer Expired" #194

DemonRx opened this issue Jul 1, 2017 · 30 comments

Comments

@DemonRx
Copy link

DemonRx commented Jul 1, 2017

After initiating the decentd (daemon) running on linux ubuntu 16.04 (64-bit), I started the cli_wallet, which produced the following output:

Logging RPC to file: /home/ader/.decent/logs/rpc/rpc.log Logging transfers to file: /home/ader/.decent/logs/transfer.log

Starting a new wallet with chain ID 0000000000000000000000000000000000000000000000000000000000000000 (empty one)
0 exception: unspecified
Timer Expired
{"message":"Timer Expired"}
asio websocket.cpp:656 operator()

{"uri":"ws://localhost:8090"}
th_a websocket.cpp:906 connect

Furthermore, the rpc folder and log file do not exist, and the transfer.log file is empty

@ejossev
Copy link
Contributor

ejossev commented Jul 1, 2017

Does it happen all the time even after decentd restart?

@DemonRx
Copy link
Author

DemonRx commented Jul 1, 2017

yes everytime

@ejossev
Copy link
Contributor

ejossev commented Jul 2, 2017

Can you telnet to localhost port 8090? To see it is daemon problem or wallet problem...

@DemonRx
Copy link
Author

DemonRx commented Jul 2, 2017

ader@HP-15-Notebook-PC:~/coins/DECENT/build/artifacts/prefix/bin$ netstat -an |grep 8090

tcp        0      0 127.0.0.1:8090          0.0.0.0:*               LISTEN     

ader@HP-15-Notebook-PC:~/coins/DECENT/build/artifacts/prefix/bin$ telnet localhost 8090

Trying ::1...
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection timed out

@DemonRx
Copy link
Author

DemonRx commented Jul 2, 2017

ader@HP-15-Notebook-PC:~/coins/DECENT/build/artifacts/prefix/bin$ nmap -p 8090 localhost

Starting Nmap 7.01 ( https://nmap.org ) at 2017-07-02 03:24 EDT
Nmap scan report for localhost (127.0.0.1)
Host is up (0.00034s latency).
Other addresses for localhost (not scanned): ::1
PORT     STATE    SERVICE
8090/tcp filtered unknown

Nmap done: 1 IP address (1 host up) scanned in 0.33 seconds

seems to be binding correctly to the port, not sure why it's timing out when connecting with telnet, as well as with the cli_wallet

@DemonRx
Copy link
Author

DemonRx commented Jul 2, 2017

I think this is the problem:

Proto Recv-Q Send-Q    Local Address           Foreign Address         State       PID/Program name
tcp        0      0   127.0.0.1:8090                 0.0.0.0:*        LISTEN          22482/decentd   

Local and Foreign Address should be the same on 127.0.0.1, or both separately, as it is with:

tcp        0      0 0.0.0.0:5297            0.0.0.0:*               LISTEN      22482/decentd   

I was able to successfully telnet to port 5297 of the daemon, just not 8090

@ejossev
Copy link
Contributor

ejossev commented Jul 2, 2017

5297 is the p2p port, not json-rpc one. Very strange, and I can't reproduce. Can you compile the binary (Linux?) with debug info and send it to me please?

@DemonRx
Copy link
Author

DemonRx commented Jul 2, 2017

Compiled it with this command:
cmake -G "Unix Makefiles" -D CMAKE_BUILD_TYPE=Debug ~/coins/DECENT

download decentd: https://mega.nz/#!19on3DYC!ygHICQZNV3vdwcJ-oSKXwU3KXlBNJDRPoCUXWLomTvw

What extra files/etc(please specify) do you need besides the binary?

@tigrangh
Copy link
Contributor

tigrangh commented Jul 2, 2017

are you able to test your 127.0.0.1 interface with two netcat instances?
have one netcat listening on 127.0.0.1:8888 and another netcat trying to connect that port.
I used to have a similar problem which is because of routing.

@DemonRx
Copy link
Author

DemonRx commented Jul 2, 2017

image
works 💯

@DemonRx
Copy link
Author

DemonRx commented Jul 3, 2017

@ejossev any luck finding the cause of the timeout ? I would like to be able to run the wallet and try the mining and seeding functionality soon.

@ejossev
Copy link
Contributor

ejossev commented Jul 3, 2017

Sorry, after a while I'm spending the day with my family... It's on my tomorrow's todo list.

@DemonRx
Copy link
Author

DemonRx commented Jul 4, 2017

Just for shits'n giggles I changed the rpc-endpoint in the config.ini to 0.0.0.0, however this was to of no avail 👎

@ejossev
Copy link
Contributor

ejossev commented Jul 6, 2017

Hmm, works on my virtual box with your binary. Sorry, there is no way how I can reproduce...

@DemonRx
Copy link
Author

DemonRx commented Jul 6, 2017

could send me copy of your binaries (both decentd and cli_wallet)

@ejossev
Copy link
Contributor

ejossev commented Jul 6, 2017

The decentd is from you... Instead of cli_wallet you can use e.g. wscat or even telnet to port 8090...

@ejossev
Copy link
Contributor

ejossev commented Jul 6, 2017

But you can check my binaries as well: https://uloz.to/!5SQSpGgEQDuO/decent-tbz

@DemonRx
Copy link
Author

DemonRx commented Jul 6, 2017

I just tested your binaries and they're working 👍 I have no idea why, I actually did a fresh install of Ubuntu today, and it's all good ! Maybe mine aren't compiling right ?

@DemonRx
Copy link
Author

DemonRx commented Jul 6, 2017

In regards to using the cli_wallet, a more detailed instructional guide would be nice, as I'm not sure what is the necessary information needed for example the parameter , or how to use commands such as get_miner, or any other for that matter. I'm not having much success atm with doing the import_key method, just getting parsing errors, so I'm not sure what is the right information I'm supposed to provide.

@tigrangh
Copy link
Contributor

tigrangh commented Jul 6, 2017

"gethelp" is useful.
for example, use
"gethelp import_key"

@DemonRx
Copy link
Author

DemonRx commented Jul 6, 2017

10 assert_exception: Assert Exception
rec && rec->name == account_name_or_id: 
    {}
    th_a  wallet.cpp:655 get_account

This is the result of doing import_key, is this correct output, doesn't seem so? as I'm not sure what the <accountname> for the method should be? Thank for you helping.

@DemonRx
Copy link
Author

DemonRx commented Jul 6, 2017

Success at last, figured out the <accountname> is my encrypted wallet address. Also I compiled decent on my system, and it's working as well. Total mystery whatever was causing the localhost connection problem. thank you for all the help @ejossev @tigrangh

@DemonRx DemonRx closed this as completed Jul 6, 2017
@DemonRx
Copy link
Author

DemonRx commented Jul 7, 2017

The Timeout Error has returned again, however I believe I may have found what might be causing this, which is Ubuntu's Firewall, I'm just not sure entirely why it is. As soon as I enabled the firewall, I couldn't connect the cli_wallet with the daemon again. even after disabling and resetting the firewall and iptables.

I ran sudo ufw reset & sudo iptables -F to clear / disable any filtering

@DemonRx DemonRx reopened this Jul 7, 2017
@DemonRx
Copy link
Author

DemonRx commented Jul 7, 2017

I had to actually reboot the OS after resetting / disabling the firewall/iptables, and the cli_wallet was able to connect again.

Gonna have to investigate into this, as to why and/how it's being denied with default firewall settings.

@DemonRx
Copy link
Author

DemonRx commented Jul 14, 2017

@ejossev it seems someone has come across a temporary solution for connecting to the daemon on the localhost port 8090, by using a loopback socket connection through decentgo.com

cli_wallet -s wss://socket.decentgo.com:8090

However I'm not so sure how secure it is to be connecting with the daemon in this manner as that may not be a secure pathway. Could you please elaborate on this.

@ejossev
Copy link
Contributor

ejossev commented Jul 14, 2017

Over this channel you only read from database (which has exactly the same data as anyone's local database running decentd) and send signed operations (which will appear in the blockchain sooner or later). Only sensitive part is "what queries do you run over the DB", not the content of the queries itself. E.g. anyone can see that the account kingX has 1.2345 DCTs, but the fact that you're pulling it every now and then indicates your interest in that account.

@DemonRx DemonRx changed the title cli_wallet: 0 Exception: unspecified cli_wallet: 0 Exception: unspecified - "Timer Expired" Jul 14, 2017
@DemonRx
Copy link
Author

DemonRx commented Jul 14, 2017

The resolution to this issue has been found thanks to slack user @roelandp:

zaphoyd/websocketpp@0bb33e4

I will make a PR for this, and you can decide if to merge or wait for them to release 0.8 WebsocketPP

@roelandp
Copy link
Contributor

roelandp commented Jul 14, 2017

@D3m0nKingx I am not only slack user @roelandp but also here on Github and also miner witness for Decent named @roelandp :)

FYI the -s above is not working, you need somehow to omit the space to connect to define a custom websocket server:

cli_wallet -swss://socket.decentgo.com:8090

It might also be of interest to read the discussion about this issue on the Websocket++ Github:
zaphoyd/websocketpp#623

Note this will only be caused on Linux Kernels > 4.4 so if you have the error first check that your kernel is > 4.4 with uname -r

@DemonRx
Copy link
Author

DemonRx commented Jul 14, 2017

Fix is working, compiled and tested on Ubuntu 16.04.2 LTS x64, I have issued a PR for the fix:
DECENTfoundation/websocketpp#1

Again thank you @roelandp ! Happy to finally have my firewall up and running 💯

@DemonRx
Copy link
Author

DemonRx commented Jul 25, 2017

Issue fixed in 4ebb31a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants