ctubio / Krypto-trading-bot

Self-hosted crypto trading bot (automated high frequency market making) written in C++
https://127.0.0.1:3000
Other
3.37k stars 823 forks source link

Bitfinex CURL wGet failed Problem with the SSL CA (path? access rights?) #209

Closed lihaibh closed 7 years ago

lihaibh commented 7 years ago

Im running K.sh manually to get information about anything happend when booting the server and i receive an error.

# ./K.sh
K x86_64 version 0day.
05:49:27.360501 CF settings loaded from JSON file K OK.
05:49:27.364855 UI ready over HTTPS on external port 3000.
CURL wGet failed Problem with the SSL CA cert (path? access rights?) at https://api.bitfinex.com/v1/pubticker/btcusd
05:49:33.902946 Errrror: Unable to match TradedPair to bitfinex symbol "btcusd".

Download the json data manually from this site through wget or curl -O works fine. I also run sudo yum update to update all os dependencies and also ca certs. Any idea how to fix it?

Environment additional data:

# uname -a
Linux localhost.localdomain 3.10.0-327.22.2.el7.x86_64 #1 SMP Thu Jun 23 17:05:11 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
# cat /etc/*release
CentOS Linux release 7.2.1511 (Core)
NAME="CentOS Linux"
VERSION="7 (Core)"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="7"
PRETTY_NAME="CentOS Linux 7 (Core)"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:7"
HOME_URL="https://www.centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

CentOS Linux release 7.2.1511 (Core)
CentOS Linux release 7.2.1511 (Core)
# gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-11)
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# node -v
v8.4.0
ctubio commented 7 years ago

maybe bitfinex was down?

does it work by now after 9 hours?

lihaibh commented 7 years ago

Still has the error, the weird thing though is when i run the command:

curl -O https://api.bitfinex.com/v1/pubticker/btcusd

it downloads the file with its content

ctubio commented 7 years ago

ok, im not sure how to reproduce this, but will try to run a fresh CentOS soOn to see if happens too

ctubio commented 7 years ago

just a note; K uses its own curl, the system curl is another executable so is normal (but sad) if both works different

can you see if is fixed by running make dist && make? this will take long time (but will be faster than me running a CentOS) because will recompile all the K sources and K dependencies like curl and else (at K/build* folder); maybe curl is missing one of its own paths? in that case i will try to recompile K with curl with somewhat portable paths; otherwise if the error still persist i will need to investigate moar

lihaibh commented 7 years ago

I recloned the repo run the command: make dist && make it shows me different output every time.

[root@localhost Krypto-trading-bot]# make dist && make
mkdir -p build-x86_64-redhat-linux
CROSS=x86_64-redhat-linux make z png16 openssl curl json sqlite uws quickfix
make[1]: Entering directory `/root/tmp/Krypto-trading-bot'
test -d build-x86_64-redhat-linux/zlib-1.2.11 || (                                \
curl -L https://zlib.net/zlib-1.2.11.tar.gz | tar xz -C build-x86_64-redhat-linux \
&& cd build-x86_64-redhat-linux/zlib-1.2.11 && CC=x86_64-redhat-linux-gcc-6 ./configure               \
--prefix=/root/tmp/Krypto-trading-bot/build-x86_64-redhat-linux/local && make && make install                      )
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  593k  100  593k    0     0   137k      0  0:00:04  0:00:04 --:--:--  139k
Compiler error reporting is too harsh for ./configure (perhaps remove -Werror).
** ./configure aborting.
make[1]: *** [z] Error 1
make[1]: Leaving directory `/root/tmp/Krypto-trading-bot'
make: *** [dist] Error 2
[root@localhost Krypto-trading-bot]# make dist && make
mkdir -p build-x86_64-redhat-linux
CROSS=x86_64-redhat-linux make z png16 openssl curl json sqlite uws quickfix
make[1]: Entering directory `/root/tmp/Krypto-trading-bot'
test -d build-x86_64-redhat-linux/zlib-1.2.11 || (                                \
curl -L https://zlib.net/zlib-1.2.11.tar.gz | tar xz -C build-x86_64-redhat-linux \
&& cd build-x86_64-redhat-linux/zlib-1.2.11 && CC=x86_64-redhat-linux-gcc-6 ./configure               \
--prefix=/root/tmp/Krypto-trading-bot/build-x86_64-redhat-linux/local && make && make install                      )
test -d build-x86_64-redhat-linux/libpng-1.6.31 || (                                                   \
curl -L https://github.com/glennrp/libpng/archive/v1.6.31.tar.gz | tar xz -C build-x86_64-redhat-linux \
&& cd build-x86_64-redhat-linux/libpng-1.6.31 && ./autogen.sh && CC=x86_64-redhat-linux-gcc-6 ./configure                  \
--prefix=/root/tmp/Krypto-trading-bot/build-x86_64-redhat-linux/local && make && make install                                             )
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100   123    0   123    0     0     25      0 --:--:--  0:00:04 --:--:--    25
  0     0    0 1112k    0     0  41004      0 --:--:--  0:00:27 --:--:-- 48430
libtoolize: putting auxiliary files in `.'.
libtoolize: copying file `./ltmain.sh'
libtoolize: putting macros in AC_CONFIG_MACRO_DIR, `scripts'.
libtoolize: copying file `scripts/libtool.m4'
libtoolize: copying file `scripts/ltoptions.m4'
libtoolize: copying file `scripts/ltsugar.m4'
libtoolize: copying file `scripts/ltversion.m4'
libtoolize: copying file `scripts/lt~obsolete.m4'
configure.ac:63: installing './config.guess'
configure.ac:63: installing './config.sub'
configure.ac:37: installing './install-sh'
configure.ac:37: installing './missing'
Makefile.am: installing './depcomp'
parallel-tests: installing './test-driver'
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /usr/bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for gcc... x86_64-redhat-linux-gcc-6
checking whether the C compiler works... no
configure: error: in `/root/tmp/Krypto-trading-bot/build-x86_64-redhat-linux/libpng-1.6.31':
configure: error: C compiler cannot create executables
See `config.log' for more details
make[1]: *** [png16] Error 77
make[1]: Leaving directory `/root/tmp/Krypto-trading-bot'
make: *** [dist] Error 2
[root@localhost Krypto-trading-bot]# make dist && make
mkdir -p build-x86_64-redhat-linux
CROSS=x86_64-redhat-linux make z png16 openssl curl json sqlite uws quickfix
make[1]: Entering directory `/root/tmp/Krypto-trading-bot'
test -d build-x86_64-redhat-linux/zlib-1.2.11 || (                                \
curl -L https://zlib.net/zlib-1.2.11.tar.gz | tar xz -C build-x86_64-redhat-linux \
&& cd build-x86_64-redhat-linux/zlib-1.2.11 && CC=x86_64-redhat-linux-gcc-6 ./configure               \
--prefix=/root/tmp/Krypto-trading-bot/build-x86_64-redhat-linux/local && make && make install                      )
test -d build-x86_64-redhat-linux/libpng-1.6.31 || (                                                   \
curl -L https://github.com/glennrp/libpng/archive/v1.6.31.tar.gz | tar xz -C build-x86_64-redhat-linux \
&& cd build-x86_64-redhat-linux/libpng-1.6.31 && ./autogen.sh && CC=x86_64-redhat-linux-gcc-6 ./configure                  \
--prefix=/root/tmp/Krypto-trading-bot/build-x86_64-redhat-linux/local && make && make install                                             )
test -d build-x86_64-redhat-linux/openssl-1.1.0f || (                                              \
curl -L https://www.openssl.org/source/openssl-1.1.0f.tar.gz | tar xz -C build-x86_64-redhat-linux \
&& cd build-x86_64-redhat-linux/openssl-1.1.0f && CC=x86_64-redhat-linux-gcc-6 ./config                                \
-fPIC --prefix=/root/tmp/Krypto-trading-bot/build-x86_64-redhat-linux/local --openssldir=/root/tmp/Krypto-trading-bot/build-x86_64-redhat-linux/local && make && make install     )
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 5154k  100 5154k    0     0   765k      0  0:00:06  0:00:06 --:--:-- 1089k
Operating system: x86_64-whatever-linux2
Configuring for linux-x86_64
Configuring OpenSSL version 1.1.0f (0x1010006fL)
    no-asan         [default]  OPENSSL_NO_ASAN
    no-crypto-mdebug [default]  OPENSSL_NO_CRYPTO_MDEBUG
    no-crypto-mdebug-backtrace [default]  OPENSSL_NO_CRYPTO_MDEBUG_BACKTRACE
    no-ec_nistp_64_gcc_128 [default]  OPENSSL_NO_EC_NISTP_64_GCC_128
    no-egd          [default]  OPENSSL_NO_EGD
    no-fuzz-afl     [default]  OPENSSL_NO_FUZZ_AFL
    no-fuzz-libfuzzer [default]  OPENSSL_NO_FUZZ_LIBFUZZER
    no-heartbeats   [default]  OPENSSL_NO_HEARTBEATS
    no-md2          [default]  OPENSSL_NO_MD2 (skip dir)
    no-msan         [default]  OPENSSL_NO_MSAN
    no-rc5          [default]  OPENSSL_NO_RC5 (skip dir)
    no-sctp         [default]  OPENSSL_NO_SCTP
    no-ssl-trace    [default]  OPENSSL_NO_SSL_TRACE
    no-ssl3         [default]  OPENSSL_NO_SSL3
    no-ssl3-method  [default]  OPENSSL_NO_SSL3_METHOD
    no-ubsan        [default]  OPENSSL_NO_UBSAN
    no-unit-test    [default]  OPENSSL_NO_UNIT_TEST
    no-weak-ssl-ciphers [default]  OPENSSL_NO_WEAK_SSL_CIPHERS
    no-zlib         [default]
    no-zlib-dynamic [default]
Configuring for linux-x86_64
CC            =x86_64-redhat-linux-gcc-6
CFLAG         =-Wall -O3 -pthread -m64 -DL_ENDIAN  -fPIC
SHARED_CFLAG  =-fPIC -DOPENSSL_USE_NODELETE
DEFINES       =DSO_DLFCN HAVE_DLFCN_H NDEBUG OPENSSL_THREADS OPENSSL_NO_STATIC_ENGINE OPENSSL_PIC OPENSSL_IA32_SSE2 OPENSSL_BN_ASM_MONT OPENSSL_BN_ASM_MONT5 OPENSSL_BN_ASM_GF2m SHA1_ASM SHA256_ASM SHA512_ASM RC4_ASM MD5_ASM AES_ASM VPAES_ASM BSAES_ASM GHASH_ASM ECP_NISTZ256_ASM PADLOCK_ASM POLY1305_ASM
LFLAG         =
PLIB_LFLAG    =
EX_LIBS       =-ldl
APPS_OBJ      =
CPUID_OBJ     =x86_64cpuid.o
UPLINK_OBJ    =
BN_ASM        =asm/x86_64-gcc.o x86_64-mont.o x86_64-mont5.o x86_64-gf2m.o rsaz_exp.o rsaz-x86_64.o rsaz-avx2.o
EC_ASM        =ecp_nistz256.o ecp_nistz256-x86_64.o
DES_ENC       =des_enc.o fcrypt_b.o
AES_ENC       =aes-x86_64.o vpaes-x86_64.o bsaes-x86_64.o aesni-x86_64.o aesni-sha1-x86_64.o aesni-sha256-x86_64.o aesni-mb-x86_64.o
BF_ENC        =bf_enc.o
CAST_ENC      =c_enc.o
RC4_ENC       =rc4-x86_64.o rc4-md5-x86_64.o
RC5_ENC       =rc5_enc.o
MD5_OBJ_ASM   =md5-x86_64.o
SHA1_OBJ_ASM  =sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o sha1-mb-x86_64.o sha256-mb-x86_64.o
RMD160_OBJ_ASM=
CMLL_ENC      =cmll-x86_64.o cmll_misc.o
MODES_OBJ     =ghash-x86_64.o aesni-gcm-x86_64.o
PADLOCK_OBJ   =e_padlock-x86_64.o
CHACHA_ENC    =chacha-x86_64.o
POLY1305_OBJ  =poly1305-x86_64.o
BLAKE2_OBJ    =
PROCESSOR     =
RANLIB        =ranlib
ARFLAGS       =
PERL          =/usr/bin/perl

SIXTY_FOUR_BIT_LONG mode

Configured for linux-x86_64.
make[2]: Entering directory `/root/tmp/Krypto-trading-bot/build-x86_64-redhat-linux/openssl-1.1.0f'
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" \
    "-oMakefile" crypto/include/internal/bn_conf.h.in > crypto/include/internal/bn_conf.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" \
    "-oMakefile" crypto/include/internal/dso_conf.h.in > crypto/include/internal/dso_conf.h
/usr/bin/perl "-I." -Mconfigdata "util/dofile.pl" \
    "-oMakefile" include/openssl/opensslconf.h.in > include/openssl/opensslconf.h
make depend && make _all
make[3]: Entering directory `/root/tmp/Krypto-trading-bot/build-x86_64-redhat-linux/openssl-1.1.0f'
make[3]: Leaving directory `/root/tmp/Krypto-trading-bot/build-x86_64-redhat-linux/openssl-1.1.0f'
make[3]: Entering directory `/root/tmp/Krypto-trading-bot/build-x86_64-redhat-linux/openssl-1.1.0f'
CC="x86_64-redhat-linux-gcc-6" /usr/bin/perl crypto/aes/asm/aes-x86_64.pl elf crypto/aes/aes-x86_64.s
x86_64-redhat-linux-gcc-6  -I. -Icrypto/include -Iinclude -DDSO_DLFCN -DHAVE_DLFCN_H -DNDEBUG -DOPENSSL_THREADS -DOPENSSL_NO_STATIC_ENGINE -DOPENSSL_PIC -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DRC4_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DPADLOCK_ASM -DPOLY1305_ASM -DOPENSSLDIR="\"/root/tmp/Krypto-trading-bot/build-x86_64-redhat-linux/local\"" -DENGINESDIR="\"/root/tmp/Krypto-trading-bot/build-x86_64-redhat-linux/local/lib/engines-1.1\"" -Wall -O3 -pthread -m64 -DL_ENDIAN  -fPIC -fPIC -DOPENSSL_USE_NODELETE -c -o crypto/aes/aes-x86_64.o crypto/aes/aes-x86_64.s
/bin/sh: x86_64-redhat-linux-gcc-6: command not found
make[3]: *** [crypto/aes/aes-x86_64.o] Error 127
make[3]: Leaving directory `/root/tmp/Krypto-trading-bot/build-x86_64-redhat-linux/openssl-1.1.0f'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/root/tmp/Krypto-trading-bot/build-x86_64-redhat-linux/openssl-1.1.0f'
make[1]: *** [openssl] Error 2
make[1]: Leaving directory `/root/tmp/Krypto-trading-bot'
make: *** [dist] Error 2
ctubio commented 7 years ago

thats because x86_64-redhat-linux-gcc-6: command not found

i will try redhat someday