Unable to start blockscout and compile ex_keccak using .system file

Hello Community,

I am running my own private blockchain and is using blockscout as my block explorer. I have been able to run it successfully on my remote terminal, however, when i try to get it to run on daemon using a blockscout.system file, it tries to re-compile and always fails with the following message.

== Compilation error in file lib/ex_keccak.ex ==
** (ErlangError) Erlang error: :enoent
(elixir 1.13.0) lib/system.ex:1044: System.cmd("cargo", ["metadata", "--format-version=1"], [cd: "native/exkeccak"])
(rustler 0.23.0) lib/rustler/compiler/config.ex:81: Rustler.Compiler.Config.external_resources/2
(rustler 0.23.0) lib/rustler/compiler/config.ex:69: Rustler.Compiler.Config.build/1
(rustler 0.23.0) lib/rustler/compiler.ex:9: Rustler.Compiler.compile_crate/2
  lib/ex_keccak.ex:6: (module)

I am using Ubuntu 20.04.3 LTS
I have the following packages installed.
Nodejs v14.19.0
rustc 1.58.1
Erlang/OTP 24
Elixir 1.13.0 (compiled with Erlang/OTP 24)
and the others required as per the documentation.

The following is my environment file and my blockscout.service file.
/etc/environment

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin"

SECRET_KEY_BASE=37bl1WflO9Og1GgwHjnKolGGUXMg13dfNtRrcbfy2dzg6ighTOqv8vk1XWN/703O
DATABASE_URL=postgresql://dbusername:dbusername@localhost:5432/blockscout
ETHEREUM_JSONRPC_HTTP_URL=http://xx.xx.xx.xx:8545

LANG=en_US.UFT-8
LANGUAGE=en_US
LC_ALL=en_US.UTF-8
LC_CTYPE=en_US.UTF-8

/etc/systemd/system/blockscout.service

[Unit]
Description=blockscout explorer
After=network.target
[Service]
Type=simple
StandardOutput=journal
StandardError=journal
SyslogIdentifier=blockscoutexplorer
User=root
WorkingDirectory=/root/blockscout
ExecStart=/usr/bin/mix phx.server
Environment="MIX_ENV=prod"
EnvironmentFile=/etc/environment
KillMode=process
TimeoutStopSec=30
Restart=on-failure
RestartSec=5
RemainAfterExit=no
[Install]
WantedBy=multi-user.target

I hope the information I have provided is sufficient, could someone please help me?

You need preinstalling Cargo as well General Requirements / BlockScout Prerequisites - BlockScout

Hey victor, thanks for your reply. I believe installing rustc automatically installs Cargo? In any case I have also checked, I do have Cargo installed, cargo 1.58.0. I am still facing the exact same issue.

  • I have the same problem