cryptonotefoundation / cryptonote

CryptoNote protocol implementation. This is the reference repository for starting a new CryptoNote currency. See /src/cryptonote_config.h
https://cryptonote.org/
991 stars 6.1k forks source link

WARNING [xxxxx INC] Exception in connectionHandler: TcpConnection::read #174

Open ghost opened 6 years ago

ghost commented 6 years ago

Hi, I setup two ubuntu server running each a node (under virtualbox) with the following configuration: Node1 , ip 192.168.1.27 Node2 ip 192.168.1.28 I can ping them each other and also i can ping a third ubuntu server wher to run the rpc and the wallet. i launch the nodes with ./cryptofrd --config-file=cryptofrd.conf Where cryptofrd.conf contains: seed-node=192.168.1.27:8080 seed-node=192.168.1.28:8080

The p2p port 7008 but they do not synchonize and i get the following error:


deedjee@deedjee-node2:~/cryptofr$ ./cryptofrd --config-file=cryptofrd.conf 01:11:43.055804 INFO cryptofr v1.1.1.1() 01:11:43.056092 INFO Module folder: ./cryptofrd 01:11:43.056454 INFO Initializing p2p server... 01:11:43.056567 INFO Binding on 0.0.0.0:17008 01:11:43.056635 INFO Net service binded on 0.0.0.0:17008 01:11:43.056688 INFO Attempting to add IGD port mapping. 01:11:44.097038 ERROR UPNP_AddPortMapping failed. 01:11:44.097098 INFO P2p server initialized OK 01:11:44.097124 INFO Initializing core... 01:11:44.097179 INFO Loading blockchain... 01:11:44.097237 INFO - loading block index... 01:11:44.097261 INFO - loading transaction map... 01:11:44.097281 INFO - loading spent keys... 01:11:44.097298 INFO - loading outputs... 01:11:44.097317 INFO - loading multi-signature outputs... 01:11:44.097335 INFO Serialization time: 0ms 01:11:44.097355 INFO Loading blockchain indices for BlockchainExplorer... 01:11:44.097388 INFO - loading paymentID index... 01:11:44.097409 INFO - loading timestamp index... 01:11:44.097434 INFO - loading generated transactions index... 01:11:44.097463 INFO Blockchain initialized. last block: 0, d2043.h19.m11.s44 time ago, current difficulty: 1 01:11:44.097501 INFO Core initialized OK 01:11:44.097562 INFO Starting core rpc server on address 127.0.0.1:18464 01:11:44.097607 INFO Core rpc server started ok 01:11:44.097631 INFO Starting p2p net loop... 01:11:44.097650 INFO Starting node_server 01:11:44.097902 INFO 01:11:44.097902 INFO ** 01:11:44.097902 INFO You are now synchronized with the network. You may now start simplewallet. 01:11:44.097902 INFO 01:11:44.097902 INFO Please note, that the blockchain will be saved only after you quit the daemon with "exit" command or if you use "save" command. 01:11:44.097902 INFO Otherwise, you will possibly need to synchronize the blockchain again. 01:11:44.097902 INFO 01:11:44.097902 INFO Use "help" command to see the list of available commands. 01:11:44.097902 INFO ** 01:11:44.098806 WARNING [192.168.1.48:59224 INC] Exception in connectionHandler: TcpConnection::read 01:11:44.099246 WARNING [192.168.1.27:52239 INC] Exception in connectionHandler: TcpConnection::read

i tried to delete the .[mycoin] folder and restart but doesn't work. on the third server i simply launch ./cryptofrd without arguments. It seems to run but do nothing. But when i stop one or both of the nodes it display an error: ERROR failed to connect to any of seed peers , continuing without seeds. I i restart the node it stop display the message

Is the errors because of "ERROR UPNP_AddPortMapping failed" ? if so what can cause this component to fail.

Edit: current opened ports when listening tcp 0 0 0 0.0.0:18464 0.0.0.0: LISTEN 2167/cryptofrd
tcp 0 0 0.0.0.0:17008 0.0.0.0:
LISTEN 2167/cryptofrd

rainmanp7 commented 6 years ago

That problem is very specific :-) TcpConnection::read 01:11:44.099246 WARNING [192.168.1.27:52239 INC] Exception in connectionHandler: TcpConnection::read

That error I have seen come from the linux platform folder. directly written inside the code. That's the error written out if there is a communication protocol problem. Please check ports open and remember that there are 2 types 1: is P2P and Rpc 2: you have port mapping Are you able to share communication through the designated ports? Recheck your P2P and Cryptonote Config and let us know if they are the Same.

What ports do you have set inside the crptonoteconfig file and in the p2p ??

My question is this.. See those errors? Now then it shows 192.168.1.48:59224 INC]. See that port number and ip address.. And you see this one? 192.168.1.27:52239 <--- that port and ip address . Your adding seed nodes into the system manually? Then again right below that is another with a completely separate port identity But you saying in the configuration ,the way you explained it as something else. . Are you sure you didn't leave the windows daemons running as you fixed the linux versions ,and then they connected back up after compiling the new daemon??

I might be confused but your settings and what's connecting to that system are completely different?

When exiting the daemons please use the command exit to close all and every connection. You could have sone older daemons connecting up. Because you just hot the X mark and didn't actually go and shut it down in linux.. Windows and Linux too diff types of animals.

Goldeneum commented 6 years ago
SoraKohaku commented 6 years ago

that not issue. try run daemon with -ip-local thing. i put on my doc. not chain problem

On Feb 7, 2018 7:27 PM, "Goldeneum" notifications@github.com wrote:

  • to @rainmanp7 https://github.com/rainmanp7 response... try delete cached folder with the name .cryptofrd (in your home dir). then compile the code again. (this error my happen if you change the params after compiling the code).

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/cryptonotefoundation/cryptonote/issues/174#issuecomment-363724966, or mute the thread https://github.com/notifications/unsubscribe-auth/AK51tb5ijrkosgqxTKx0B2Qaj-SRe0gOks5tSXqbgaJpZM4R78Di .

spotme-main commented 6 years ago

post your config.. probably a wrong configuration / wrong port issue

your p2p port should be appended to the end of your seed node url. According to your post above.. you are telling cryptonote to connect find the seed nodes on port 8080 (which I wouldnt use port 8080 because web servers tend to.. but thats just me)

Firewall isnt an issue since you are on a internal network

But your log output says you are listening for p2p connections on port 17008.. which tells me you are sending your nodes to connect to each other on port 8080.. but no one is listening.. because they are listening at 17008

SoraKohaku commented 6 years ago

open all port on config. then try run~

On Feb 10, 2018 2:22 PM, "Benjamin Franklin" notifications@github.com wrote:

post your config.. probably a wrong configuration / wrong port issue

your p2p port should be appended to the end of your seed node url. According to your post above.. you are telling cryptonote to connect find the seed nodes on port 8080 (which I wouldnt use port 8080 because web servers tend to.. but thats just me)

Firewall isnt an issue since you are on a internal network

But your log output says you are listening for p2p connections on port 17008.. which tells me you are sending your nodes to connect to each other on port 8080.. but no one is listening.. because they are listening at 17008

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cryptonotefoundation/cryptonote/issues/174#issuecomment-364627444, or mute the thread https://github.com/notifications/unsubscribe-auth/AK51tbZHIfPR1X-7mSVYCdTkuDfOq4Rwks5tTSelgaJpZM4R78Di .

ghost commented 6 years ago

@spotme-main Hi, yes i did change the port in the seed-node config file with the p2p port and it works , but previously i had to reconfigure all my 3 linux servers with ubuntu trusty and boost libs 1.55. I had less compilation errors. anyway , thanks all for your help. So now the two nodes are synchronized on node1 and node2 servers. Daemon launched on main server and i was able to mine with the smallwallet inside miner. However i got an error with the miner app: "ERROR [Miner] Error occured during mining: Enable multithreading to use std::thread: Operation not permitted" This is treated in the issue #152 but i can't see any clear explanation of how it is solved. Also i wanted to pre-mine a good amount of coin, around 10 million among the 100 i setup (its for educational purpose) but it mines very slowly , something like 0.0000384 each block and i was wondering how i could modify the parameters in the below section of CryptoNoteConfig.h file to speed up the process? After what i could go back to the standard rate if it's possible to do it by recompiling without loosing all.

//TODO Define preferred block's target time const uint64_t DIFFICULTY_TARGET = 120; // seconds const uint64_t EXPECTED_NUMBER_OF_BLOCKS_PER_DAY = 24 60 60 / DIFFICULTY_TARGET; //TODO There are options to tune CryptoNote's difficulty retargeting function. //TODO We recommend not to change it. const size_t DIFFICULTY_WINDOW = EXPECTED_NUMBER_OF_BLOCKS_PER_DAY; // blocks const size_t DIFFICULTY_CUT = 60; // timestamps to cut after sorting const size_t DIFFICULTY_LAG = 15; static_assert(2 DIFFICULTY_CUT <= DIFFICULTY_WINDOW - 2, "Bad DIFFICULTY_WINDOW or DIFFICULTY_CUT"); const size_t MAX_BLOCK_SIZE_INITIAL = 20 1024; const uint64_t MAX_BLOCK_SIZE_GROWTH_SPEED_NUMERATOR = 100 1024; const uint64_t MAX_BLOCK_SIZE_GROWTH_SPEED_DENOMINATOR = 365 24 60 60 / DIFFICULTY_TARGET;

SoraKohaku commented 6 years ago

My repo fixed all

On Feb 10, 2018 5:30 PM, "Deedjee" notifications@github.com wrote:

@spotme-main https://github.com/spotme-main Hi, yes i did change the port in the seed-node config file with the p2p port and it works , but previously i had to reconfigure all my 3 linux servers with ubuntu trusty and boost libs 1.55. I had less compilation errors. anyway , thanks all for your help. So now the two nodes are synchronized on node1 and node2 servers. Daemon launched on main server and i was able to mine with the smallwallet inside miner. However i got an error with the miner app: "ERROR [Miner] Error occured during mining: Enable multithreading to use std::thread: Operation not permitted" This is treated in the issue #152 https://github.com/cryptonotefoundation/cryptonote/issues/152 but i can't see any clear explanation of how it is solved. Also i wanted to pre-mine a good amount of coin, around 10 million among the 100 i setup (its for educational purpose) but it mines very slowly , something like 0.0000384 each block and i was wondering how i could modify the parameters in the below section of CryptoNoteConfig.h file to speed up the process? After what i could go back to the standard rate if it's possible to do it by recompiling without loosing all.

//TODO Define preferred block's target time const uint64_t DIFFICULTY_TARGET = 120; // seconds const uint64_t EXPECTED_NUMBER_OF_BLOCKS_PER_DAY = 24 60 60 / DIFFICULTY_TARGET; //TODO There are options to tune CryptoNote's difficulty retargeting function. //TODO We recommend not to change it. const size_t DIFFICULTY_WINDOW = EXPECTED_NUMBER_OF_BLOCKS_PER_DAY; // blocks const size_t DIFFICULTY_CUT = 60; // timestamps to cut after sorting const size_t DIFFICULTY_LAG = 15; static_assert(2 DIFFICULTY_CUT <= DIFFICULTY_WINDOW - 2, "Bad DIFFICULTY_WINDOW or DIFFICULTY_CUT"); const size_t MAX_BLOCK_SIZE_INITIAL = 20 1024; const uint64_t MAX_BLOCK_SIZE_GROWTH_SPEED_NUMERATOR = 100 1024; const uint64_t MAX_BLOCK_SIZE_GROWTH_SPEED_DENOMINATOR = 365 24 60 60 / DIFFICULTY_TARGET;

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/cryptonotefoundation/cryptonote/issues/174#issuecomment-364635851, or mute the thread https://github.com/notifications/unsubscribe-auth/AK51tTeAs6gdyk_E8MFUrRvrwVVptlRrks5tTVOngaJpZM4R78Di .

ghost commented 6 years ago

@FndNur1Labs "My repo fixed all" ok so you confirme that ,by recompiling the code, i will have no more this error?

SoraKohaku commented 6 years ago

yes i did remove unnecesary files~

ghost commented 6 years ago

Hi, Have done a new git clone. compiled and same error when trying to use miner.

Also on a side note: Is it possible to import a private key into simplewallet ? or in the GUI version (which is more friendly) If a new wallet created from simplewallet how to have it setup in the GUI version?

ghost commented 6 years ago

possibly a cmake misconfiguration. here under the output of make: by the way "If a new wallet created from simplewallet how to have it setup in the GUI version?" found it by replacing the GUI wallet default name by the one created from simplewallet.

make output cd build/release && cmake -D CMAKE_BUILD_TYPE=Release ../.. -- The C compiler identification is GNU 4.8.4 -- The CXX compiler identification is GNU 4.8.4 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Boost version: 1.55.0 -- Found the following Boost libraries: -- system -- filesystem -- thread -- date_time -- chrono -- regex -- serialization -- program_options -- Found Git: /usr/bin/git -- Found PythonInterp: /usr/bin/python (found version "2.7.6") -- Looking for include file pthread.h -- Looking for include file pthread.h - not found -- Could NOT find Threads (missing: Threads_FOUND) -- Configuring done -- Generating done

rainmanp7 commented 6 years ago

Do you see the part where the pthreads are? That is a problem of Boost thread configuration on system. That's not fixed by some repo :-) it could be ,but normally fro. Fixing symlinks or the System boost threads... Consider google and boost and configure threads The newer boost versions just need to be installed properly. It's! A mapping and linking error hopefully.

There are 3-4 possible solutions for this pthreads problem/question. Posting a new thread will be much better. *Notice how I referred to this as if this was a Forum? Also list your (cmake) and ( boost ) and ( gcc ) and ( linux ) or ( windows ) versions. Please?

Your welcome to try my cmakelists.txt from repo and see if that works. *Reffering to my phfirecoin repo. It may help you.

Thank you.

ghost commented 6 years ago

Hi @rainmanp7 Thanks for the reply. I'm a bit stubborn :) and i finally found the solution on google here under. this is a bug in the cmake installation, not boost: https://stackoverflow.com/questions/24813827/cmake-failing-to-detect-pthreads-due-to-warnings/25130590#25130590 The solution is to correct the below entry: "find the file Modules/CheckIncludeFiles.cmake in your CMake installation (possibly in /usr/share/cmake or similar), find the line: "${CMAKE_CONFIGURABLE_FILE_CONTENT}\n\nint main(){return 0;}\n") and change int main() to int main(void)." And that's it. recompile and cmake found the pthread library. no more error. However it seems that we have also to add the two additional declaration under set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") in CMakeLists.txt => set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread") => set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread") Didn't still check if it's really necessary by doing some more compilation and removing one or both of this lines. Anyway i will have a look to your repo. Thanks.

rainmanp7 commented 6 years ago

I do have that set inside the cmakelists.tx file I'm using :-)

if(NOT APPLE) ${CMAKE_CXX_FLAGS} -pthread set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -pthread") endif()

SoraKohaku commented 6 years ago

GUI compability used royalties. i did soon. but later i costume for you guys :)

On Feb 11, 2018 10:46 AM, "PHFirecoin" notifications@github.com wrote:

I do have that set inside the cmake file I'm using :-)

if(NOT APPLE) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -pthread") endif()

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/cryptonotefoundation/cryptonote/issues/174#issuecomment-364711899, or mute the thread https://github.com/notifications/unsubscribe-auth/AK51te-oa-CVL3696cyd0e-fKPNFbClhks5tTkZugaJpZM4R78Di .