Cabal fails when building Cardano Node

Hi there,

I’m having the following problem after executing the command cabal build all:

cabal: Failed to build aeson-1.5.2.0 (which is required by test:cardano-node-test from cardano-node-1.19.0, exe:cardano-node from cardano-node-1.19.0 and others). The build process terminated with exit code -6

I’m following Cardano’s Stake Pool Course on setting up a Cardano Node.

Thank you very much,

Matías

hi Matias!

quick questions:
which OS you are using?
Did you update cabal?

cabal update
cabal --version

Hey. Sometimes ghc throws errors when resources are busy. Check your output if there are errors pre-dating the one mentioned above.

Sometimes it’s even non-deterministic - so try building again and watch if the error repeats.

You could also try a cabal clean before you do cabal build all

Hi Lauris and Stablepool!

I’m running on an AWS Instance, with Linux.

I have followed exactly Cardano’s Stake Pool Guide. That means I’ve already run cabal update and after that cabal --version. Anyway, I have run them again. This is what I get:

[ec2-user@ip-172-31-37-144 ~]$ cabal update Downloading the latest package list from hackage.haskell.org To revert to previous state run: cabal v2-update 'hackage.haskell.org,2020-09-21T21:43:55Z' [ec2-user@ip-172-31-37-144 ~]$ cabal --version cabal-install version 3.2.0.0 compiled using version 3.2.0.0 of the Cabal library

And after that I’ve done cabal clean and cabal build all as you guys suggested. Now this is what I’m getting:

Cloning into '/home/ec2-user/cardano-node/dist-newstyle/src/ouroboros_-e7dffa0d85e2839'... remote: Enumerating objects: 1249, done. remote: Counting objects: 100% (1249/1249), done. remote: Compressing objects: 100% (749/749), done. remote: Total 104885 (delta 914), reused 613 (delta 422), pack-reused 103636 Receiving objects: 100% (104885/104885), 110.35 MiB | 14.03 MiB/s, done. Resolving deltas: 100% (73114/73114), done. HEAD is now at f0eb6e439 Merge #2546 Warning: Requested index-state2020-07-15T00:00:00Z is newer than 'hackage.haskell.org'! Falling back to older state (2020-07-14T22:50:55Z). Resolving dependencies... cabal: Could not resolve dependencies: [__0] next goal: cardano-crypto-class (user goal) [__0] rejecting: cardano-crypto-class-2.0.0 (conflict: pkg-config package libsodium-any, not found in the pkg-config database) [__0] fail (backjumping, conflict set: cardano-crypto-class) After searching the rest of the dependency tree exhaustively, these were the goals I've had most trouble fulfilling: cardano-crypto-class

I’ve tried like 5 times already. I don’t think that’s the problem in this case…

Maybe this is the problem. Did you install libsodium prior to building?

Download and install GHC:

wget https://downloads.haskell.org/~ghc/8.6.5/ghc-8.6.5-x86_64-deb9-linux.tar.xz
tar -xf ghc-8.6.5-x86_64-deb9-linux.tar.xz
rm ghc-8.6.5-x86_64-deb9-linux.tar.xz
cd ghc-8.6.5
./configure sudo make install

Back in your home directory:

Install Libsodium

git clone https://github.com/input-output-hk/libsodium
cd libsodium
git checkout 66f017f1
./autogen.sh
./configure
make
sudo make install

Add the following to your .bashrc file and source it.

export LD_LIBRARY_PATH="/usr/local/lib:$LD_LIBRARY_PATH"
export PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:$PKG_CONFIG_PATH"

try

sudo apt-get update -y
sudo apt-get upgrade -y
sudo apt-get -y install python3 build-essential pkg-config libffi-dev libgmp-dev libssl-dev libtinfo-dev systemd libsystemd-dev libsodium-dev zlib1g-dev yarn make g++ jq libncursesw5 libtool autoconf
export LD_LIBRARY_PATH=“/usr/local/lib:$LD_LIBRARY_PATH”

git clone GitHub - input-output-hk/cardano-node: The core component that is used to participate in a Cardano decentralised blockchain.
cd cardano-node
git fetch --all --tags && git tag
git checkout tags/1.19.1
echo -e “package cardano-crypto-praos\n flags: -external-libsodium-vrf” > cabal.project.local
cabal update
cabal build all

Sorry guys but I’m getting the same. I don’t know what I’m doing wrong, but I’m back at the beginning. I also have both GHC and Libsodium correctly installed.

cabal: Failed to build aeson-1.5.2.0 (which is required by test:cardano-node-test from cardano-node-1.19.0, exe:cardano-node from cardano-node-1.19.0 and others). The build process terminated with exit code -6

I have tried all the commands you told me and set the environment variables you mentioned.

Any other thoughts?

Thank you!

Matías

I tried everything again and now I’m getting this error on a previous step, which was working before (installation of GHC). It’s after I run sudo make install:

/usr/local/lib/ghc-8.6.5/bin/ghc-pkg: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory make[1]: *** [install_packages] Error 127 make: *** [install] Error 2

I’m now following this guide: https://www.coincashew.com/coins/overview-ada/guide-how-to-build-a-haskell-stakepool-node

Thank you!

Matias

are you running installation as root or non-root (regular user with sudo rights)?
looks like something is messed up there… i would start from scratch

as there is a new version out… i would suggest to remove everything and start fresh
you can this updated guide: https://cardano-node-installation.stakepool247.eu/

let me know if it helps

Maybe you can check your LD_LIBRARY_PATH and PATH if anything was overwritten? Usually the libraries and binaries are referenced relative to these path’s.

Also I have better experience defining export NCPUS=1 before “cabal build all” as ghc might throw errors else.
But the problem you are describing is definetly linked to the libraries, so check your paths. Also try a

locate libtinfo.so.5

and see if the library can be found.

If locate doesnt work try:
find /lib/ -name libtinfo.so.5

On my server its located in: /lib/x86_64-linux-gnu/libtinfo.so.5

Lauris,

Yes, I’m running as “ec2” user in AWS. Thanks for the guide, I’m gonna try that one today. Is it really necessary to create a new user for the node? If yes, do you know how to do it in the AWS console? Because these commands are not working as expected in the guide:

sudo adduser cardano (this one doesn’t provide the ability to set a password for the account"

sudo usermod -aG sudo cardano (this one directly doesn’t work)

Thank you!

Matías

The values of LD_LIBRARY_PATH and PATH before trying to install GHC are:

[ec2-user@ip-172-31-32-198 ~]$ echo $LD_LIBRARY_PATH /usr/local/lib:

[ec2-user@ip-172-31-32-198 ~]$ echo $PATH /home/ec2-user/.local/bin:/usr/local/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/ec2-user/.local/bin:/home/ec2-user /bin

Is it OK?

Thanks,

Matías

None of those commands are working on my instance…

The first one gives this error:

[ec2-user@ip-172-31-32-198 ghc-8.6.5]$ locate libtinfo.so.5 locate: can not stat () /var/lib/mlocate/mlocate.db: No such file or directory

And the second one doesn’t give any information:

[ec2-user@ip-172-31-32-198 ~]$ find /lib/ -name libtinfo.so.5 [ec2-user@ip-172-31-32-198 ~]$

I have manually located libtinfo.so.6 in usr/lib64/

I’m not finding number 5 anywhere.

At the moment, I could fix the installation of GHC by following this link:

I’m gonna continue now with the rest. I’ll let you know, guys.

Thanks!