  A log Calabi--Yau pair consists of a proper variety $X$ and a divisor $D$ on
it such that $K_X+D$ is numerically trivial. A folklore conjecture predicts
that the dual complex of $D$ is homeomorphic to the quotient of a sphere by a
finite group. The main result of the paper shows that the fundamental group of
the dual complex of $D$ is a quotient of the fundamental group of the smooth
locus of $X$, hence its pro-finite completion is finite. This leads to a
positive answer in dimension $\leq 4$. We also study the dual complex of
degenerations of Calabi--Yau varieties. The key technical result we prove is
that, after a volume preserving birational equivalence, the transform of $D$
supports an ample divisor.
