Skip to main content

Troubleshooting

Binaries Will Not Start

If a binary fails to run due to a missing dependency, ensure that environment variables are correctly set:

# Set up FBOSS environment variables
cd /opt/fboss
source ./bin/setup_fboss_env

# Verify that all runtime dependencies are satisified for the test binary
# including the libraries installed in /opt/fboss:
ldd /opt/fboss/bin/$BINARY_NAME

# Ensure you dont see any 'not found'. Example:
# $ ldd /opt/fboss/bin/sai_test-fake
# ...
# # Good
# libcurl.so.4 => /lib64/libcurl.so.4 (0x00007f3f26d39000)
# libyaml-0.so.2 => /opt/fboss/lib/libyaml-0.so.2 (0x00007f3f26d18000)
# ...
# # Bad
# libre2.so.9 => not found
# libsodium.so.23 => not found
# ...

# If there are any missing libraries, then those need to be installed on the
# switch using "sudo dnf install ..." if the switch has internet access.
# Alternatively, the missing libraries can be copied from the FBOSS build's
# scratch path `/opt/app/FBOSS_DIR/tmp_bld_dir/installed/<missing_lib*>/` to
# switch `/opt/fboss/lib/`.

setup.py Fails

We use setup.py to populate fruid.json and other config files, but it may not succeed for all platforms. In this case, you can source this script to set environment variables:

cd /opt/fboss
source ./bin/setup_fboss_env

Building FBOSS Docker Image Fails

Instead of building the Docker image yourself, you can obtain an image tarball from GitHub. The published image includes all relevant sources, including sources for dependencies, which means that building FBOSS binaries from this image eliminates the need for a network connection at the time of building. To obtain the image, follow this guide:

# Obtain an image tarball from the latest successful GitHub actions run
#
# CentOS
# https://github.com/facebook/fboss/actions/workflows/export-centos-docker-image.yml
#
# Debian
# https://github.com/facebook/fboss/actions/workflows/export-debian-docker-image.yml

# Decompress it using zstd
zstd -d fboss_debian_docker_image.tar.zst

# Load the image
sudo docker load < fboss_debian_docker_image.tar

Build Doesn't Pick Up Local Changes

If you want to make changes locally and then build, you will need another flag which tells getdeps.py to pick them up. You can use the flag --src-dir to tell it where changes are located:

# Navigate to the right directory
cd /var/FBOSS/fboss

# Build using a cmake target
time ./build/fbcode_builder/getdeps.py build --allow-system-packages \
--extra-cmake-defines='{"CMAKE_BUILD_TYPE": "MinSizeRel", "CMAKE_CXX_STANDARD": "20"}' \
--scratch-path /var/FBOSS/tmp_bld_dir --src-dir . fboss