Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make check failed in arm64 #4259

Open
pengyueqingthink opened this issue Nov 4, 2022 · 14 comments
Open

make check failed in arm64 #4259

pengyueqingthink opened this issue Nov 4, 2022 · 14 comments

Comments

@pengyueqingthink
Copy link

Description

make check failed with output

module 'chttpd_view_test'
  chttpd view tests
    chttpd_view_test:75: should_succeed_on_view_with_queries_keys...*failed*
in function chttpd_view_test:'-should_succeed_on_view_with_queries_keys/1-fun-2-'/1 (test/eunit/chttpd_view_test.erl, line 77)
in call from eunit_test:run_testfun/1 (eunit_test.erl, line 71)
in call from eunit_proc:run_test/1 (eunit_proc.erl, line 510)
in call from eunit_proc:with_timeout/3 (eunit_proc.erl, line 335)
in call from eunit_proc:handle_test/2 (eunit_proc.erl, line 493)
in call from eunit_proc:tests_inorder/3 (eunit_proc.erl, line 435)
in call from eunit_proc:with_timeout/3 (eunit_proc.erl, line 325)
in call from eunit_proc:run_group/2 (eunit_proc.erl, line 549)
**error:{badmatch,{error,req_timedout}}
  output:<<"">>

    chttpd_view_test:91: should_succeed_on_view_with_queries_limit_skip...*failed*
in function chttpd_view_test:'-should_succeed_on_view_with_queries_limit_skip/1-fun-4-'/1 (test/eunit/chttpd_view_test.erl, line 93)
in call from eunit_test:run_testfun/1 (eunit_test.erl, line 71)
in call from eunit_proc:run_test/1 (eunit_proc.erl, line 510)
in call from eunit_proc:with_timeout/3 (eunit_proc.erl, line 335)
in call from eunit_proc:handle_test/2 (eunit_proc.erl, line 493)
in call from eunit_proc:tests_inorder/3 (eunit_proc.erl, line 435)
in call from eunit_proc:with_timeout/3 (eunit_proc.erl, line 325)
in call from eunit_proc:run_group/2 (eunit_proc.erl, line 549)
**error:{badmatch,{error,req_timedout}}
  output:<<"">>

    chttpd_view_test:108: should_succeed_on_view_with_multiple_queries...*failed*
in function chttpd_view_test:'-should_succeed_on_view_with_multiple_queries/1-fun-5-'/1 (test/eunit/chttpd_view_test.erl, line 110)
in call from eunit_test:run_testfun/1 (eunit_test.erl, line 71)
in call from eunit_proc:run_test/1 (eunit_proc.erl, line 510)
in call from eunit_proc:with_timeout/3 (eunit_proc.erl, line 335)
in call from eunit_proc:handle_test/2 (eunit_proc.erl, line 493)
in call from eunit_proc:tests_inorder/3 (eunit_proc.erl, line 435)
in call from eunit_proc:with_timeout/3 (eunit_proc.erl, line 325)
in call from eunit_proc:run_group/2 (eunit_proc.erl, line 549)
**error:{badmatch,{error,req_timedout}}
  output:<<"">>

Steps to Reproduce

spack install --keep-stage [email protected];
spack load [email protected]
spack cd [email protected]
spack install [email protected]
spack install [email protected]
spack install py-pip
spack load [email protected] [email protected] py-pip
pip install black Elixir wheel
MOZJS_DIR=$(spack location -i [email protected])/include/js/
NODEJS_DIR=$(spack location -i [email protected])/include/
export CPATH=${MOZJS_DIR}:${NODEJS_DIR}
sed -i 's/exit(1 if sys.version_info >= (3,6) else 0)/exit(0 if sys.version_info >= (3,6) else 1)/g' Makefile ||true
make check -j128

Expected Behaviour

all test ok

Your Environment

  • CouchDB version used:3.1.0
  • Browser name and version:none
  • Operating system and version:centos8

Additional Context

make check output
all-output.log

@big-r81
Copy link
Contributor

big-r81 commented Dec 9, 2022

Does this happen with the latest version too?

@Tom-python0121
Copy link

@big-r81 When I compile the master version or 3.3.0-RC2, the following error is reported:

Steps to reproduce the issue

[root@bigdata ~]# spack install --keep-stage -v [email protected]
===> Compiling ssl_verify_fun
===> Compiling rebar
===> Building escript for rebar...
Cloning into '/home/stage/root/spack-stage-couchdb-3.3.0-RC2-pp6mytoamrlxeaykdrgpytuslzbxyo63/spack-src/src/erlfmt'...
===> Verifying dependencies...
===> Failed to update package getopt from repo hexpm
===> Package not found in any repo: getopt
==> Error: ProcessError: Command exited with status 1:
    '/home/stage/root/spack-stage-couchdb-3.3.0-RC2-pp6mytoamrlxeaykdrgpytuslzbxyo63/spack-src/configure' '--prefix=/home/spack/opt/spack/linux-centos8-aarch64/gcc-8.5.0/couchdb-3.3.0-RC2-pp6mytoamrlxeaykdrgpytuslzbxyo63' '--disable-docs'

3 warnings found in build log:
  >> 4     WARNING: Unknown option '--prefix=/home/spack/opt/spack/linux-centos8-aarch64/gcc-8.5.0/couchdb-3.3.0-RC2-pp6mytoamrlxeaykdrgpytuslzbxyo63', ignoring
     5     ==> configuring couchdb in rel/couchdb.config
     6     Cloning into '/home/stage/root/spack-stage-couchdb-3.3.0-RC2-pp6mytoamrlxeaykdrgpytuslzbxyo63/spack-src/src/rebar'...
     7     make: Entering directory '/home/stage/root/spack-stage-couchdb-3.3.0-RC2-pp6mytoamrlxeaykdrgpytuslzbxyo63/spack-src/src/rebar'
     8     ./bootstrap
     9     No beam files found.
     10    Recompile: src/rebar

     ...

     15    Recompile: src/rebar_base_compiler
     16    Recompile: src/rebar_cleaner
     17    Recompile: src/rebar_config
     18    Recompile: src/rebar_core
     19    Recompile: src/rebar_cover_utils
     20    Recompile: src/rebar_ct
  >> 21    src/rebar_ct.erl:291: Warning: crypto:rand_uniform/2 is deprecated and will be removed in a future release; use rand:uniform/1
     22    Recompile: src/rebar_deps
     23    Recompile: src/rebar_dia_compiler
     24    Recompile: src/rebar_dialyzer
     25    Recompile: src/rebar_edoc
     26    Recompile: src/rebar_erlc_compiler
     27    Recompile: src/rebar_erlydtl_compiler
     28    Recompile: src/rebar_escripter
     29    Recompile: src/rebar_eunit
  >> 30    src/rebar_eunit.erl:282: Warning: crypto:rand_uniform/2 is deprecated and will be removed in a future release; use rand:uniform/1
     31    Recompile: src/rebar_file_utils
     32    Recompile: src/rebar_getopt
     33    Recompile: src/rebar_lfe_compiler
     34    Recompile: src/rebar_log
     35    Recompile: src/rebar_metacmds
     36    Recompile: src/rebar_mustache

How can I solve this problem?

@big-r81
Copy link
Contributor

big-r81 commented Dec 27, 2022

===> Failed to update package getopt from repo hexpm
===> Package not found in any repo: getopt

Maybe a temporary connection problem to hex.pm or a problem at hex.pm?

@nickva
Copy link
Contributor

nickva commented Dec 27, 2022

Based on what @big-r81 pointed out, it seems like it needs access to the network to install a few packages. I wonder if you have access to the network in the environment @Tom-python0121?

Is it the ./configure or make release or make check step that fails?

We just fixed a similar issues and but there is probably a few more instances of it left #4319

@Tom-python0121
Copy link

@nickva I have a network agent, the error is as follows:

[root@bigdata spack-src]# ./configure
==> configuring couchdb in rel/couchdb.config
===> Verifying dependencies...
=NOTICE REPORT==== 28-Dec-2022::09:04:08.134848 ===
TLS client: In state certify at ssl_handshake.erl:1766 generated CLIENT ALERT: Fatal - Unknown CA

===> Failed to update package getopt from repo hexpm
===> Package not found in any repo: getopt

@nickva
Copy link
Contributor

nickva commented Dec 28, 2022

@Tom-python0121 thanks for double checking.

When I run ./configure from the tar.gz I get only:

$ ./configure 
==> configuring couchdb in rel/couchdb.config
You have configured Apache CouchDB, time to relax. Relax.

But in your case it seems it's attempting to install rebar or rebar3. So it could be one of these sections that's failing:

couchdb/configure

Lines 307 to 315 in f6ddbe2

if [ ! -x "${rootdir}/bin/rebar3" ]; then
if [ ! -d "${rootdir}/src/rebar3" ]; then
git clone --depth 1 --branch ${REBAR3_BRANCH} https://github.com/erlang/rebar3.git ${rootdir}/src/rebar3
fi
cd src/rebar3
./bootstrap
mv ${rootdir}/src/rebar3/rebar3 ${rootdir}/bin/rebar3
cd ../..
fi

Wonder what your ${rootdir} is in

couchdb/configure

Lines 336 to 338 in f6ddbe2

if [ -z "${REBAR3}" ]; then
install_local_rebar3
REBAR3=${rootdir}/bin/rebar3
and if bin/rebar3 found there. Would you be able to echo it in a debug line with a patch like this:

if [ -z "${REBAR3}" ]; then
    echo "rebar3 install **"
    echo "rootdir = ${rootdir}"
    install_local_rebar3
    REBAR3=${rootdir}/bin/rebar3
fi

@Tom-python0121
Copy link

Tom-python0121 commented Dec 28, 2022

@nickva
The command output is as follows:

[root@bigdata couchdb-3.3.0-RC2]# ./configure
……
==> rebar (compile)
==> rebar (escriptize)
Congratulations! You now have a self-contained script called "rebar" in
your current working directory. Place this script anywhere in your path
and you can use rebar to build OTP-compliant apps.
make: Leaving directory '/home/stage/root/spack-stage-couchdb-3.3.0-RC2-pp6mytoamrlxeaykdrgpytuslzbxyo63/couchdb-3.3.0-RC2/src/rebar'
make: Entering directory '/home/stage/root/spack-stage-couchdb-3.3.0-RC2-pp6mytoamrlxeaykdrgpytuslzbxyo63/couchdb-3.3.0-RC2/src/rebar'
make: Leaving directory '/home/stage/root/spack-stage-couchdb-3.3.0-RC2-pp6mytoamrlxeaykdrgpytuslzbxyo63/couchdb-3.3.0-RC2/src/rebar'
rebar3 install **
rootdir = /home/stage/root/spack-stage-couchdb-3.3.0-RC2-pp6mytoamrlxeaykdrgpytuslzbxyo63/couchdb-3.3.0-RC2
Cloning into '/home/stage/root/spack-stage-couchdb-3.3.0-RC2-pp6mytoamrlxeaykdrgpytuslzbxyo63/couchdb-3.3.0-RC2/src/rebar3'...
remote: Enumerating objects: 515, done.
remote: Counting objects: 100% (515/515), done.
remote: Compressing objects: 100% (445/445), done.
remote: Total 515 (delta 73), reused 300 (delta 38), pack-reused 0
Receiving objects: 100% (515/515), 862.33 KiB | 857.00 KiB/s, done.
Resolving deltas: 100% (73/73), done.
Evaluating config script "/home/stage/root/spack-stage-couchdb-3.3.0-RC2-pp6mytoamrlxeaykdrgpytuslzbxyo63/couchdb-3.3.0-RC2/src/rebar3/_build/default/lib/rebar/src/rebar.app.src.script"
===> Verifying dependencies...
===> Analyzing applications...
===> Compiling getopt
===> Compiling providers
===> Compiling cf
===> Compiling erlware_commons
===> Compiling bbmustache
===> Compiling relx
===> Compiling eunit_formatters
===> Compiling cth_readable
===> Compiling certifi
===> Compiling ssl_verify_fun
===> Compiling rebar
===> Verifying dependencies...
===> Cleaning out certifi...
===> Cleaning out cf...
===> Cleaning out erlware_commons...
===> Cleaning out getopt...
===> Cleaning out providers...
===> Cleaning out rebar...
===> Verifying dependencies...
===> Analyzing applications...
===> Compiling getopt
===> Compiling providers
===> Compiling cf
===> Compiling erlware_commons
===> Compiling bbmustache
===> Compiling relx
===> Compiling eunit_formatters
===> Compiling cth_readable
===> Compiling certifi
===> Compiling ssl_verify_fun
===> Compiling rebar
===> Building escript for rebar...
Cloning into '/home/stage/root/spack-stage-couchdb-3.3.0-RC2-pp6mytoamrlxeaykdrgpytuslzbxyo63/couchdb-3.3.0-RC2/src/erlfmt'...
remote: Enumerating objects: 91, done.
remote: Counting objects: 100% (91/91), done.
remote: Compressing objects: 100% (83/83), done.
remote: Total 91 (delta 6), reused 38 (delta 2), pack-reused 0
Unpacking objects: 100% (91/91), 171.48 KiB | 2.68 MiB/s, done.
===> Verifying dependencies...
=NOTICE REPORT==== 28-Dec-2022::14:29:46.421169 ===
TLS client: In state certify at ssl_handshake.erl:1766 generated CLIENT ALERT: Fatal - Unknown CA

===> Failed to update package getopt from repo hexpm
===> Package not found in any repo: getopt

But it's still wrong.

@nickva
Copy link
Contributor

nickva commented Dec 28, 2022

@Tom-python0121 exactly, it doesn't seem right that it's downloading and fetching rebar2 or rebar3.

Those scripts should be in the the .tgz already.

Just to double-check again wonder if we're looking at the same tgz file:

~/tmp $ cat apache-couchdb-3.3.0-RC2.tar.gz.sha256
e8c6bf3f99a8f0d2af5806652f57d53796367e2d4b24dedc86e268cf86f787a0  apache-couchdb-3.3.0-RC2.tar.gz

~/tmp $ sha256sum -c apache-couchdb-3.3.0-RC2.tar.gz.sha256 
apache-couchdb-3.3.0-RC2.tar.gz: OK

~/tmp $ tar xfz apache-couchdb-3.3.0-RC2.tar.gz 

~/tmp $ ls -l apache-couchdb-3.3.0/bin
total 1120
-rw-rw-r-- 1 nickv nickv     68 Dec 22 02:53 erlang-version.escript
-rwxrwxr-x 1 nickv nickv 134844 Dec 22 03:00 erlfmt
-rwxrwxr-x 1 nickv nickv 203550 Dec 22 03:00 rebar
-rwxrwxr-x 1 nickv nickv 800215 Dec 22 03:00 rebar3

Then wonder if the shell expression if [ ! -x "${rootdir}/bin/rebar" ]; then is not working properly, I tested both with /bin/bash and the default dash (bin/sh on Ubuntu).

@Tom-python0121
Copy link

Tom-python0121 commented Dec 28, 2022

@nickva I downloaded it from this URL, isn't it? Are there any other URLs?

wget https://github.com/apache/couchdb/archive/refs/tags/3.3.0-RC2.tar.gz
[root@bigdata spack-stage-couchdb-3.3.0-RC2-pp6mytoamrlxeaykdrgpytuslzbxyo63]# sha256sum 3.3.0-RC2.tar.gz
0b823f7027c2ec18677d8fe4cc02977893579491763897d5fcc2696983c15eb6  3.3.0-RC2.tar.gz

@nickva
Copy link
Contributor

nickva commented Dec 28, 2022

I downloaded it from this URL, isn't it? Are there any other URLs?

wget https://github.com/apache/couchdb/archive/refs/tags/3.3.0-RC2.tar.gz
[root@bigdata spack-stage-couchdb-3.3.0-RC2-pp6mytoamrlxeaykdrgpytuslzbxyo63]# sha256sum 3.3.0-RC2.tar.gz
0b823f7027c2ec18677d8fe4cc02977893579491763897d5fcc2696983c15eb6  3.3.0-RC2.tar.gz

There is our answer. That's not the correct URL. That's the git tag but that's not our release candidate tar.gz file. That one is located at: https://dist.apache.org/repos/dist/dev/couchdb/source/3.3.0/rc.2

You can track the ML release vote thread as well: https://lists.apache.org/thread/rgrh1bctsosoxqfzf0xn7oc7x0b20x3k

After the vote passes it will be tagged as 3.3.0 and but the release would then be available via a link at https://couchdb.apache.org/

You can still build it from the git source but it's a slightly different procedure. There is an extra configuration step, there is definitely a lot more dep fetching and network communication and such. The official tar.gz file already has that taken care of in the make dist step.

@Tom-python0121
Copy link

@nickva It works, but there's a problem reported so far. Have you encountered it in make check? How can I solve it?

[root@bigdata apache-couchdb-3.3.0]# make check
……
==> couch_prometheus (compile)
==> rel (compile)
==> apache-couchdb-3.3.0 (compile)
/bin/sh: mix: command not found
make[1]: *** [Makefile:247: elixir-init] Error 127
make[1]: Leaving directory '/home/stage/root/spack-stage-couchdb-3.3.0-RC2-pp6mytoamrlxeaykdrgpytuslzbxyo63/apache-couchdb-3.3.0'
make: *** [Makefile:155: check] Error 2

@big-r81
Copy link
Contributor

big-r81 commented Dec 28, 2022

For make check to work, you need to install elixir (<1.14) too.

@Tom-python0121
Copy link

@big-r81 @nickva The problem has been solved, but an error is reported in the make check test case, as shown in the following figure.

[root@bigdata apache-couchdb-3.3.0]# make check
……
module 'chttpd_view_test'
  chttpd view tests
    chttpd_view_test:82: should_succeed_on_view_with_queries_keys...*failed*
in function chttpd_view_test:'-should_succeed_on_view_with_queries_keys/1-fun-2-'/1 (test/eunit/chttpd_view_test.erl, line 84)
in call from eunit_test:run_testfun/1 (eunit_test.erl, line 71)
in call from eunit_proc:run_test/1 (eunit_proc.erl, line 522)
in call from eunit_proc:with_timeout/3 (eunit_proc.erl, line 347)
in call from eunit_proc:handle_test/2 (eunit_proc.erl, line 505)
in call from eunit_proc:tests_inorder/3 (eunit_proc.erl, line 447)
in call from eunit_proc:with_timeout/3 (eunit_proc.erl, line 337)
in call from eunit_proc:run_group/2 (eunit_proc.erl, line 561)
**error:{badmatch,{error,req_timedout}}
  output:<<"">>

    chttpd_view_test:106: should_succeed_on_view_with_queries_limit_skip...*failed*
in function chttpd_view_test:'-should_succeed_on_view_with_queries_limit_skip/1-fun-4-'/1 (test/eunit/chttpd_view_test.erl, line 108)
in call from eunit_test:run_testfun/1 (eunit_test.erl, line 71)
in call from eunit_proc:run_test/1 (eunit_proc.erl, line 522)
in call from eunit_proc:with_timeout/3 (eunit_proc.erl, line 347)
in call from eunit_proc:handle_test/2 (eunit_proc.erl, line 505)
in call from eunit_proc:tests_inorder/3 (eunit_proc.erl, line 447)
in call from eunit_proc:with_timeout/3 (eunit_proc.erl, line 337)
in call from eunit_proc:run_group/2 (eunit_proc.erl, line 561)
**error:{badmatch,{error,req_timedout}}
  output:<<"">>

    chttpd_view_test:130: should_succeed_on_view_with_multiple_queries...*failed*
in function chttpd_view_test:'-should_succeed_on_view_with_multiple_queries/1-fun-5-'/1 (test/eunit/chttpd_view_test.erl, line 132)
in call from eunit_test:run_testfun/1 (eunit_test.erl, line 71)
in call from eunit_proc:run_test/1 (eunit_proc.erl, line 522)
in call from eunit_proc:with_timeout/3 (eunit_proc.erl, line 347)
in call from eunit_proc:handle_test/2 (eunit_proc.erl, line 505)
in call from eunit_proc:tests_inorder/3 (eunit_proc.erl, line 447)
in call from eunit_proc:with_timeout/3 (eunit_proc.erl, line 337)
in call from eunit_proc:run_group/2 (eunit_proc.erl, line 561)
**error:{badmatch,{error,req_timedout}}
  output:<<"">>

    [done in 93.355 s]
……
module 'chttpd_security_tests'
  chttpd security tests
    chttpd_security_tests:154: should_allow_admin_db_compaction...[0.003 s] ok
    chttpd_security_tests:179: should_allow_valid_password_to_create_user...ok
    chttpd_security_tests:193: should_disallow_invalid_password_to_create_user...ok
    chttpd_security_tests:204: should_disallow_anonymous_db_compaction...ok
    chttpd_security_tests:215: should_disallow_db_member_db_compaction...ok
    undefined
    *** context setup failed ***
**in function chttpd_security_tests:create_user/4 (test/eunit/chttpd_security_tests.erl, line 94)
in call from chttpd_security_tests:setup/0 (test/eunit/chttpd_security_tests.erl, line 49)
**error:{badmatch,{ok,500,
              [{"Cache-Control","must-revalidate"},
               {"Content-Length","51"},
               {"Content-Type","application/json"},
               {"Date","Thu, 29 Dec 2022 01:32:53 GMT"},
               {"Server","CouchDB/3.3.0 (Erlang OTP/23)"},
               {"X-Couch-Request-ID","6f293153b6"},
               {"X-CouchDB-Body-Time","0"}],
              <<"{\"error\":\"error\",\"reason\":\"internal_server_error\"}\n">>}}
……
module 'chttpd_csp_tests'
CSP Tests
undefined
*** context setup failed ***
**in function chttpd_csp_tests:req/5 (test/eunit/chttpd_csp_tests.erl, line 272)
in call from chttpd_csp_tests:create_doc/3 (test/eunit/chttpd_csp_tests.erl, line 258)
in call from chttpd_csp_tests:setup/0 (test/eunit/chttpd_csp_tests.erl, line 195)
**error:{badmatch,{error,req_timedout}}


undefined
*** context setup failed ***
**in function chttpd_csp_tests:req/5 (test/eunit/chttpd_csp_tests.erl, line 272)
in call from chttpd_csp_tests:create_doc/3 (test/eunit/chttpd_csp_tests.erl, line 258)
in call from chttpd_csp_tests:setup/0 (test/eunit/chttpd_csp_tests.erl, line 195)
**error:{badmatch,{error,req_timedout}}


undefined
*** context setup failed ***
**in function chttpd_csp_tests:req/5 (test/eunit/chttpd_csp_tests.erl, line 272)
in call from chttpd_csp_tests:create_doc/3 (test/eunit/chttpd_csp_tests.erl, line 258)
in call from chttpd_csp_tests:setup/0 (test/eunit/chttpd_csp_tests.erl, line 195)
**error:{badmatch,{error,req_timedout}}


undefined
*** context setup failed ***
**in function chttpd_csp_tests:req/5 (test/eunit/chttpd_csp_tests.erl, line 272)
in call from chttpd_csp_tests:create_doc/3 (test/eunit/chttpd_csp_tests.erl, line 258)
in call from chttpd_csp_tests:setup/0 (test/eunit/chttpd_csp_tests.erl, line 195)
**error:{badmatch,{error,req_timedout}}


undefined
*** context setup failed ***
**in function chttpd_csp_tests:req/5 (test/eunit/chttpd_csp_tests.erl, line 272)
in call from chttpd_csp_tests:create_doc/3 (test/eunit/chttpd_csp_tests.erl, line 258)
in call from chttpd_csp_tests:setup/0 (test/eunit/chttpd_csp_tests.erl, line 195)
**error:{badmatch,{error,req_timedout}}

@nickva
Copy link
Contributor

nickva commented Jan 18, 2023

@Tom-python0121 sorry for the delayed response. It looks like there is some exception throw. The eunit (the test framework used to run the tests) dumps extra logs in src/$app/.eunit/couch.log. In this case it looks like it might be src/chttpd/.eunit/couch.log. See if there are any errors or exception there? Since it involves view tests I suspect the spidermonkey (couch js runtime) might not linked or built properly.

To run just one test module could try:

 $ make && make eunit apps=chttpd suites=chttpd_view_test
 $ cat src/chttpd/.eunit/couch.log

req_timedout might also have sometime to do with network or socket setup not working properly and either the server unable to bind to a socket to listen or the test client from reaching the server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants