electroneum / electroneum

Electroneum: The Legacy L1 Repository
https://electroneum.com
Other
389 stars 196 forks source link

Ubuntu 16.094: Failed to deinitialize core & Failed to initialize p2p server #82

Closed gaia closed 6 years ago

gaia commented 6 years ago
./electroneumd --config-file /root/electroneum/electroneumd.conf --pidfile /mnt/electroneum/electroneumd.pid
2017-12-31 19:25:06.785     7f2195e5a740        INFO    global  src/daemon/main.cpp:279 Electroneum 'Helium Hydra' (v0.11.0.0-8ea5e81)
2017-12-31 19:25:06.785     7f2195e5a740        INFO    global  src/daemon/protocol.h:55        Initializing cryptonote protocol...
2017-12-31 19:25:06.785     7f2195e5a740        INFO    global  src/daemon/protocol.h:60        Cryptonote protocol initialized OK
2017-12-31 19:25:06.786     7f2195e5a740        INFO    global  src/daemon/p2p.h:63     Initializing p2p server...
2017-12-31 19:25:07.107     7f2195e5a740        INFO    global  src/daemon/core.h:89    Deinitializing core...
2017-12-31 19:25:07.109     7f2195e5a740        ERROR   daemon  src/daemon/core.h:94    Failed to deinitialize core...
2017-12-31 19:25:07.111     7f2195e5a740        INFO    global  src/daemon/protocol.h:77        Stopping cryptonote protocol...
2017-12-31 19:25:07.111     7f2195e5a740        INFO    global  src/daemon/protocol.h:81        Cryptonote protocol stopped successfully
2017-12-31 19:25:07.111     7f2195e5a740        ERROR   daemon  src/daemon/main.cpp:287 Exception in main! Failed to initialize p2p server.
cat /root/electroneum/electroneumd.conf
# Configuration for electroneumd
# Syntax: any command line option may be specified as 'clioptionname=value'.
# See 'electroneumd --help' for all available options.

data-dir=/mnt/electroneum
log-file=/root/electroneum/electroneum.log
log-level=0
ll /mnt/electroneum
total 8
drwxr-xr-x 2 electroneum electroneum 4096 Dec 31 11:18 ./
drwxr-xr-x 4 root        root        4096 Dec 31 10:20 ../
ll /root/electroneum/
total 145024
drwxr-xr-x  2 root root     4096 Dec 31 11:22 ./
drwxr-x--- 26 root root     4096 Dec 31 11:17 ../
-rwxrwxr-x  1 root root  8746912 Nov  2 23:18 electroneum-blockchain-export*
-rwxrwxr-x  1 root root 53710072 Nov  2 23:18 electroneum-blockchain-import*
-rwxr-xr-x  1 root root 57849312 Nov  2 23:19 electroneumd*
-rwxr-xr-x  1 root root      247 Dec 31 11:10 electroneumd.conf*
-rw-r--r--  1 root root    18256 Dec 31 11:25 electroneum.log
-rwxrwxr-x  1 root root 13932256 Nov  2 23:21 electroneum-wallet-cli*
-rwxrwxr-x  1 root root 14204392 Nov  2 23:21 electroneum-wallet-rpc*
id electroneum
uid=1004(electroneum) gid=1004(electroneum) groups=1004(electroneum)

user shell is /bin/false. homedir is /mnt/electroneum

electroneumRepo commented 6 years ago

Hi,

Can confirm that you are doing this with root access?

gaia commented 6 years ago

I am root, not even sudo.

jibosky commented 6 years ago

I am also facing this issue even when I run the daemon as root. I began to experience this issue after syncing with the blockchain did not complete properly due to poor network connectivity here.

Is there any fix for this please?

PraetorianTW commented 6 years ago

Having same issue here, running as root or as myself with sudo heightened run.

Freshly built Ubuntu Server w/ Freshly Compiled from Source directives in this project.

myuser@myServer:~/electroneum/src/daemon$ uname -a Linux myServer 4.4.0-87-generic #110-Ubuntu SMP Tue Jul 18 12:55:35 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux myuser@myServer:~/electroneum/src/daemon$ electroneumd --os-version OS: Linux #110-Ubuntu SMP Tue Jul 18 12:55:35 UTC 2017 4.4.0-87-generic

Admittedly my first attempt at mining, but looking at the output:

root@MyServer:~# electroneumd --start-mining $MyETNWallet --log-file $HOME/electroneum/logs/electroneum.mining.log 2018-01-07 06:54:38.824 7fe623874740 INFO global src/daemon/main.cpp:279 Electroneum 'Helium Hydra' (v0.11.0.0-2769728) 2018-01-07 06:54:38.825 7fe623874740 INFO global src/daemon/protocol.h:55 Initializing cryptonote protocol... 2018-01-07 06:54:38.825 7fe623874740 INFO global src/daemon/protocol.h:60 Cryptonote protocol initialized OK 2018-01-07 06:54:38.825 7fe623874740 INFO global src/daemon/p2p.h:63 Initializing p2p server... 2018-01-07 06:54:39.170 7fe623874740 INFO global src/daemon/core.h:89 Deinitializing core... 2018-01-07 06:54:39.172 7fe623874740 ERROR daemon src/daemon/core.h:94 Failed to deinitialize core... 2018-01-07 06:54:39.172 7fe623874740 INFO global src/daemon/protocol.h:77 Stopping cryptonote protocol... 2018-01-07 06:54:39.172 7fe623874740 INFO global src/daemon/protocol.h:81 Cryptonote protocol stopped successfully 2018-01-07 06:54:39.172 7fe623874740 ERROR daemon src/daemon/main.cpp:287 Exception in main! Failed to initialize p2p server.

I went into the files of issue: $HOME/electroneum/src/daemon/core.h (see Line 94) 82 cryptonote::core & get() 83 { 84 return m_core; 85 } 86 87 ~t_core() 88 { 89 MGINFO("Deinitializing core..."); 90 try { 91 m_core.deinit(); 92 m_core.set_cryptonote_protocol(nullptr); 93 } catch (...) { 94 MERROR("Failed to deinitialize core..."); 95 }

And from $HOME/electroneum/src/daemon/main.cpp (Line 287)

279 MGINFO("Electroneum '" << MONERO_RELEASE_NAME << "' (v" << MONERO_VERSION_FULL << ")"); 280 281 MINFO("Moving from main() into the daemonize now."); 282 283 return daemonizer::daemonize(argc, argv, daemonize::t_executor{}, vm); 284 } 285 catch (std::exception const & ex) 286 { 287 LOG_ERROR("Exception in main! " << ex.what()); 288 }

So quick questions: 1) Are my arguments enough to start the miner? If not, what's missing/required? 2) Do I need to be in a mining pool for this to work with P2P setup etc or are there other IPs/Ports I should use/consider? If I need to be in a pool, anyone know of one I can use that doesn't require me to use thier bundled version of ETN Miner? (had issues installing the ones from NanoPool and electromine.fr.

Thanks in advance.

AMatiasC commented 6 years ago

Hi gaia, Kill the PiD proceess /snap/electroneum/... and screen -S daemon and after ./electroneumd.

TimeTravelersHackedMe commented 6 years ago

Here's a Docker for replicating the issue:

FROM ubuntu:latest as builder

RUN apt-get update \
    && apt-get upgrade -y \
    && apt-get install -y --no-install-recommends \
        build-essential \
        ca-certificates \
        cmake \
        doxygen \
        git \
        graphviz \
        libboost-all-dev \
        libexpat1-dev \
        libgtest-dev \
        libldns-dev \
        liblzma-dev \
        libminiupnpc-dev \
        libssl-dev \
        libunbound-dev \
        libunwind8-dev \
        pkg-config \
    && git clone https://github.com/electroneum/electroneum.git /root/electroneum \
    && cd /root/electroneum \
    && make release-static

FROM ubuntu:latest

WORKDIR /opt/electroneum

RUN apt-get update \
    && apt-get upgrade -y \
    && apt-get install -y --no-install-recommends \
        ca-certificates \
        curl \
        gnupg \
        libboost-all-dev \
        software-properties-common \
    && curl -sL https://deb.nodesource.com/setup_9.x | bash \
    && apt-get install -y nodejs \
    && npm install -g pm2 \
    && apt-get autoclean \
    && apt-get autoremove -y \
    && rm -rf /var/lib/apt/lists/*

COPY --from=builder /root/electroneum/build/release/bin/* /opt/electroneum/

EXPOSE 26967 26968

CMD ["pm2-docker", "process.json"]
Icxgold commented 6 years ago

anyone solved this ? have same issue