rebar core error: make release for couchdb

January 15, 2024, 21:28

aronyii

Raspberry PI Model B armv6 Dietpi v.8.25.1 Erlang version R16B03-1 Rebar version rebar_2.6.4-3_armhf.deb Mainly was following this guide at the beginning, but after that didn't work, I tried to get rid of the errors through reinstalling erlang etc. [CouchDB on raspberry pi]( https://github.com/jguillod/couchdb-on-raspberry-pi >) Inbetween also installed erlang via apt-get install erlang Tried versions of couchdb: 2.0.0 2.1.1 2.2.0 3.2.3 3.3.3
Uncaught error in rebar_core: {'EXIT',
                               {undef,
                                [{crypto,start,[],[]},
                                 {rebar,run_aux,2,
                                  [{file,"src/rebar.erl"},{line,212}]},
                                 {rebar,main,1,
                                  [{file,"src/rebar.erl"},{line,58}]},
                                 {escript,run,2,
                                  [{file,"escript.erl"},{line,747}]},
                                 {escript,start,1,
                                  [{file,"escript.erl"},{line,277}]},
                                 {init,start_it,1,[]},
                                 {init,start_em,1,[]}]}}
make: * [Makefile:67: couch] Error 1 

oops.se

The error is in line 67 in the Makefile. And please post text as text and format it correctly.

oops.se

???

aronyii

Could you please give me some guidance, I tried to find a solution for that, but I wasn't successful. Those are lines 64-68
.PHONY: couch
# target: couch - Build CouchDB core
couch: config.erl
    @COUCHDB_VERSION=$(COUCHDB_VERSION) $(REBAR) compile
    @cp src/couch/priv/couchjs bin/

oops.se

What guide have you followed? Have you run make clean before trying to compile. As your trouble description is meagre of information there is just more questions!

oops.se

And a suggestion. 1. Read https://discord.com/channels/818384379197784084/1189386838788542464. 2. If you just ask "I have this error" I will normally don't engage myself in those questions. If you had asked "I did this and I got this error" there is a much higher chance that some starts to engage themself in the question.

aronyii

Read here that issue might raise because openssl isn't installed: [STACKOVERFLOW Uncaught error in rebar core](<https://stackoverflow.com/questions/25327575/building-riak-uncaught-error-in-rebar-core>) So made sure, openssl is installed: sudo dpkg - l | grep ssl
root@DietPi:~/apache-couchdb-2.1.1# sudo dpkg -l | grep ssl
ii  erlang-ssl                       1:22.2.7+dfsg-1+deb10u1                  armhf
    Erlang/OTP implementation of SSL
ii  libcurl4-openssl-dev:armhf       7.64.0-4+deb10u8                         armhf
    development files and documentation for libcurl (OpenSSL flavour)
ii  libio-socket-ssl-perl            2.060-3                                  all
    Perl module implementing object oriented interface to SSL sockets
ii  libnet-ssleay-perl               1.85-2+deb10u1                           armhf
    Perl module for Secure Sockets Layer (SSL)
ii  libssl-dev:armhf                 1.1.1n-0+deb10u6                         armhf
    Secure Sockets Layer toolkit - development files
ii  libssl1.1:armhf                  1.1.1n-0+deb10u6                         armhf
    Secure Sockets Layer toolkit - shared libraries
ii  libzstd1:armhf                   1.3.8+dfsg-3+rpi1+deb10u2                armhf
    fast lossless compression algorithm
ii  openssl                          1.1.1n-0+deb10u6                         armhf
    Secure Sockets Layer toolkit - cryptographic utility
ii  perl-openssl-defaults:armhf      3                                        armhf
    version compatibility baseline for Perl OpenSSL packages 
After that I tried to install rebar manually via sudo apt-get install rebar

aronyii

Even trying to execute below code, also fails
oot@DietPi:~/apache-couchdb-2.0.0# make clean
Uncaught error in rebar_core: {'EXIT',
                               {undef,
                                [{crypto,start,[],[]},
                                 {rebar,run_aux,2,
                                  [{file,"src/rebar.erl"},{line,212}]},
                                 {rebar,main,1,
                                  [{file,"src/rebar.erl"},{line,58}]},
                                 {escript,run,2,
                                  [{file,"escript.erl"},{line,747}]},
                                 {escript,start,1,
                                  [{file,"escript.erl"},{line,277}]},
                                 {init,start_it,1,[]},
                                 {init,start_em,1,[]}]}}
make: * [Makefile:285: clean] Error 1

oops.se

That Makefile has bugs, as a make clean should remove previous make residues... File a bug report

aronyii

But this even appears in the latest version 3.3.3..
root@DietPi:~/apache-couchdb-3.3.3# make clean
escript: exception error: undefined function rebar:main/1
  in function  escript:run/2 (escript.erl, line 747)
  in call from escript:start/1 (escript.erl, line 277)
  in call from init:start_it/1
  in call from init:start_em/1
make:  [Makefile:438: clean] Error 127 
438 is the line containing again REBAR.. So I think I has something to do with rebar?
.PHONY: clean
# target: clean - Remove build artifacts
clean:
    @$(REBAR) -r clean
    @rm -rf .rebar/
    @rm -f bin/couchjs
    @rm -f bin/weatherreport
    @rm -rf src//ebin
    @rm -rf src//.rebar
    @rm -rf src//priv/.so
    @rm -rf src/couch/priv/{couchspawnkillable,couchjs}
    @rm -rf share/server/main.js share/server/main-ast-bypass.js share/server/main-coffee.js
    @rm -rf tmp dev/data dev/lib dev/logs
    @rm -rf src/mango/.venv
    @rm -f src/couch/priv/couchspawnkillable
    @rm -f src/couch/priv/couch_js/config.h
    @rm -f dev/.beam dev/devnode.* dev/pbkdf2.pyc log/crash.log
    @rm -f dev/erlserver.pem dev/couch_ssl_dist.conf
So the same as while performing
@COUCHDB_VERSION=$(COUCHDB_VERSION) $(REBAR) compile

oops.se

As I say, bug report