I have followed the riak installation instructions for Ubuntu and the readme for the riak erlang client. At the point in the client instructions where a ping is sent to test the connection, I get the error report below indicating a missing module. In the report, I've replace my server IP with IP_Of_Server.
How do I make sure the module is included in the compile of the client? Where should it be located?
riakc_pb_socket:ping(Pid).
=ERROR REPORT==== 28-Apr-2022::20:04:49.468604 ===
** Generic server <0.81.0> terminating
** Last message in was {req,rpbpingreq,60000}
** When Server state == {state,"IP_Of_Server",8087,false,false,#Port<0.7>,
false,gen_tcp,undefined,
{[],[]},
1,[],infinity,undefined,undefined,undefined,
undefined,[],100,false,
{false,0}}
** Reason for termination ==
** {'module could not be loaded',
[{riak_pb_codec,encode,[rpbpingreq],[]},
{riakc_pb_socket,encode_request_message,1,
[{file,"/home/pseudo/riak-erlang-client/src/riakc_pb_socket.erl"},
{line,3297}]},
{riakc_pb_socket,send_request,2,
[{file,"/home/pseudo/riak-erlang-client/src/riakc_pb_socket.erl"},
{line,3269}]},
{riakc_pb_socket,handle_call,3,
[{file,"/home/pseudo/riak-erlang-client/src/riakc_pb_socket.erl"},
{line,2089}]},
{gen_server,try_handle_call,4,[{file,"gen_server.erl"},{line,661}]},
{gen_server,handle_msg,6,[{file,"gen_server.erl"},{line,690}]},
{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,249}]}]}
** Client <0.78.0> stacktrace
** [{gen,do_call,4,[{file,"gen.erl"},{line,167}]},
{gen_server,call,3,[{file,"gen_server.erl"},{line,219}]},
{erl_eval,do_apply,6,[{file,"erl_eval.erl"},{line,684}]},
{shell,exprs,7,[{file,"shell.erl"},{line,686}]},
{shell,eval_exprs,7,[{file,"shell.erl"},{line,642}]},
{shell,eval_loop,3,[{file,"shell.erl"},{line,627}]}]
=CRASH REPORT==== 28-Apr-2022::20:04:49.469247 ===
crasher:
initial call: riakc_pb_socket:init/1
pid: <0.81.0>
registered_name: []
exception error: undefined function riak_pb_codec:encode/1
in function riakc_pb_socket:encode_request_message/1 (/home/pseudo/riak-erlang-client/src/riakc_pb_socket.erl, line 3297)
in call from riakc_pb_socket:send_request/2 (/home/pseudo/riak-erlang-client/src/riakc_pb_socket.erl, line 3269)
in call from riakc_pb_socket:handle_call/3 (/home/pseudo/riak-erlang-client/src/riakc_pb_socket.erl, line 2089)
in call from gen_server:try_handle_call/4 (gen_server.erl, line 661)
in call from gen_server:handle_msg/6 (gen_server.erl, line 690)
ancestors: [<0.78.0>]
message_queue_len: 0
messages: []
links: [<0.78.0>,#Port<0.7>]
dictionary: []
trap_exit: false
status: running
heap_size: 6772
stack_size: 27
reductions: 13740
neighbours:
neighbour:
pid: <0.78.0>
registered_name: []
initial_call: {erlang,apply,2}
current_function: {gen,do_call,4}
ancestors: []
message_queue_len: 0
links: [<0.77.0>,<0.81.0>]
trap_exit: false
status: waiting
heap_size: 610
stack_size: 34
reductions: 4167
current_stacktrace: [{gen,do_call,4,[{file,"gen.erl"},{line,167}]},
{gen_server,call,3,[{file,"gen_server.erl"},{line,219}]},
{erl_eval,do_apply,6,[{file,"erl_eval.erl"},{line,684}]},
{shell,exprs,7,[{file,"shell.erl"},{line,686}]},
{shell,eval_exprs,7,[{file,"shell.erl"},{line,642}]},
{shell,eval_loop,3,[{file,"shell.erl"},{line,627}]}]
** exception exit: undef
in function riak_pb_codec:encode/1
called as riak_pb_codec:encode(rpbpingreq)
in call from riakc_pb_socket:encode_request_message/1 (/home/pseudo/riak-erlang-client/src/riakc_pb_socket.erl, line 3297)
in call from riakc_pb_socket:send_request/2 (/home/pseudo/riak-erlang-client/src/riakc_pb_socket.erl, line 3269)
in call from riakc_pb_socket:handle_call/3 (/home/pseudo/riak-erlang-client/src/riakc_pb_socket.erl, line 2089)
in call from gen_server:try_handle_call/4 (gen_server.erl, line 661)
in call from gen_server:handle_msg/6 (gen_server.erl, line 690)
in call from proc_lib:init_p_do_apply/3 (proc_lib.erl, line 249)
Here is what I have found.
When starting the REPL, the line
erl -pa ./riak-erlang-client/_build/default/lib/riakc/ebin ./riak-erlang-client/_build/default/lib/riakc/deps/*/ebin
was missing a directory declaration. I changed it to be
erl -pa ./riak-erlang-client/_build/default/lib/riakc/ebin ./riak-erlang-client/_build/default/lib/riakc/deps/*/ebin ./riak-erlang-client/_build/default/lib/riak_pb/ebin/
I am trying to build a docker from a fork and I am getting the following error when performing docker build ./:
cc1: all warnings being treated as errors
make[1]: *** [objs/src/event/ngx_event_openssl.o] Error 1
objs/Makefile:748: recipe for target 'objs/src/event/ngx_event_openssl.o' failed
make[1]: Leaving directory '/tmp/nginx/nginx-1.8.0'
make: *** [install] Error 2
On install we run
apt-get -y install libpcre3-dev zlib1g-dev libssl-dev openssl build-essential wget
I can't find this error on google. The full error for reference as I can't find out the exact error reference I need to research:
src/event/ngx_event_openssl.c: In function 'ngx_ssl_init':
src/event/ngx_event_openssl.c:112:5: error: 'OPENSSL_config' is deprecated [-Werror=deprecated-declarations]
OPENSSL_config(NULL);
^~~~~~~~~~~~~~
In file included from /usr/include/openssl/ct.h:13:0,
from /usr/include/openssl/ssl.h:61,
from src/event/ngx_event_openssl.h:15,
from src/core/ngx_core.h:80,
from src/event/ngx_event_openssl.c:9:
/usr/include/openssl/conf.h:92:1: note: declared here
DEPRECATEDIN_1_1_0(void OPENSSL_config(const char *config_name))
^
src/event/ngx_event_openssl.c: In function 'ngx_ssl_rsa512_key_callback':
src/event/ngx_event_openssl.c:753:9: error: 'RSA_generate_key' is deprecated [-Werror=deprecated-declarations]
key = RSA_generate_key(512, RSA_F4, NULL, NULL);
^~~
In file included from /usr/include/openssl/rsa.h:13:0,
from /usr/include/openssl/x509.h:31,
from /usr/include/openssl/ssl.h:50,
from src/event/ngx_event_openssl.h:15,
from src/core/ngx_core.h:80,
from src/event/ngx_event_openssl.c:9:
/usr/include/openssl/rsa.h:193:1: note: declared here
DEPRECATEDIN_0_9_8(RSA *RSA_generate_key(int bits, unsigned long e, void
^
src/event/ngx_event_openssl.c: In function 'ngx_ssl_dhparam':
src/event/ngx_event_openssl.c:943:11: error: dereferencing pointer to incomplete type 'DH {aka struct dh_st}'
dh->p = BN_bin2bn(dh1024_p, sizeof(dh1024_p), NULL);
^~
src/event/ngx_event_openssl.c: In function 'ngx_ssl_handshake':
src/event/ngx_event_openssl.c:1164:31: error: dereferencing pointer to incomplete type 'SSL {aka struct ssl_st}'
if (c->ssl->connection->s3) {
^~
src/event/ngx_event_openssl.c: In function 'ngx_ssl_connection_error':
src/event/ngx_event_openssl.c:1913:21: error: 'SSL_R_NO_CIPHERS_PASSED' undeclared (first use in this function)
|| n == SSL_R_NO_CIPHERS_PASSED /* 182 */
^~~~~~~~~~~~~~~~~~~~~~~
src/event/ngx_event_openssl.c:1913:21: note: each undeclared identifier is reported only once for each function it appears in
src/event/ngx_event_openssl.c: In function 'ngx_ssl_session_cache':
src/event/ngx_event_openssl.c:2107:43: error: passing argument 2 of 'SSL_CTX_sess_set_get_cb' from incompatible pointer type [-Werror=incompatible-pointer-types]
SSL_CTX_sess_set_get_cb(ssl->ctx, ngx_ssl_get_cached_session);
^~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from src/event/ngx_event_openssl.h:15:0,
from src/core/ngx_core.h:80,
from src/event/ngx_event_openssl.c:9:
/usr/include/openssl/ssl.h:637:6: note: expected 'SSL_SESSION * (*)(struct ssl_st *, const unsigned char *, int, int *) {aka struct ssl_session_st * (*)(struct ssl_st *, const unsigned char *, int, int *)}' but argument is of type 'SSL_SESSION * (*)(SSL *, u_char *, int, int *) {aka struct ssl_session_st * (*)(struct ssl_st *, unsigned char *, int, int *)}'
void SSL_CTX_sess_set_get_cb(SSL_CTX *ctx,
^~~~~~~~~~~~~~~~~~~~~~~
src/event/ngx_event_openssl.c: In function 'ngx_ssl_session_id_context':
src/event/ngx_event_openssl.c:2129:27: error: storage size of 'md' isn't known
EVP_MD_CTX md;
^~
src/event/ngx_event_openssl.c:2195:5: error: implicit declaration of function 'EVP_MD_CTX_cleanup' [-Werror=implicit-function-declaration]
EVP_MD_CTX_cleanup(&md);
^~~~~~~~~~~~~~~~~~
src/event/ngx_event_openssl.c: In function 'ngx_ssl_session_ticket_key_callback':
src/event/ngx_event_openssl.c:2864:9: error: 'RAND_pseudo_bytes' is deprecated [-Werror=deprecated-declarations]
RAND_pseudo_bytes(iv, 16);
^~~~~~~~~~~~~~~~~
In file included from /usr/include/openssl/engine.h:19:0,
from src/event/ngx_event_openssl.h:22,
from src/core/ngx_core.h:80,
from src/event/ngx_event_openssl.c:9:
/usr/include/openssl/rand.h:47:1: note: declared here
DEPRECATEDIN_1_1_0(int RAND_pseudo_bytes(unsigned char *buf, int num))
^
cc1: all warnings being treated as errors
make[1]: *** [objs/src/event/ngx_event_openssl.o] Error 1
objs/Makefile:748: recipe for target 'objs/src/event/ngx_event_openssl.o' failed
make[1]: Leaving directory '/tmp/nginx/nginx-1.8.0'
make: *** [install] Error 2
This is the docker fork I am running https://github.com/meteorhacks/mup-frontend-server
You are getting various errors and warnings here, but they aren't really about Docker or OpenSSL. If we strip away the extraneous information, here are the problems you are encountering.
error: 'OPENSSL_config' is deprecated
error: 'RSA_generate_key' is deprecated
error: dereferencing pointer to incomplete type 'DH {aka struct dh_st}'
error: dereferencing pointer to incomplete type 'SSL {aka struct ssl_st}'
error: 'SSL_R_NO_CIPHERS_PASSED' undeclared (first use in this function)
error: passing argument 2 of 'SSL_CTX_sess_set_get_cb' from incompatible pointer type
error: storage size of 'md' isn't known
error: implicit declaration of function 'EVP_MD_CTX_cleanup'
error: 'RAND_pseudo_bytes' is deprecated
The core of the problem here is probably that you are using a legacy version of Nginx in this project. From the GitHub repository you pointed to, in install-nginx.sh:
NGINX_VERSION=1.8.0
The current mainline version of Nginx is 1.13.2. I haven't combed through the changelogs for Nginx, but based on the errors you are receiving, it seems likely that between the 1.8 releases and the current ones, OpenSSL has deprecated various functions that Nginx 1.8 relied on. Most likely this can be solved by moving to a recent release of Nginx.
As of this writing, 1.13.2 is the current mainline, and 1.12.0 is the current stable. One of those may work better. Whether you can simply drop this in, I can't say. You may have to change something in the build scripts or the nginx config for a more recent version to work properly.
you are getting this error because your nginx version don't support SSL 1.1.0. Either upgrade NGINX version or use SSL 1.0.2.