Just to let other people know, that face the same issue:
It happens when calling fdroid update and there are no sources downloaded for the app in the build directory.
A workaround for us is to call fdroid scanner to download the sources.
We use this script at the beginning of our build process:
grep CurrentVersionCode metadata/*.yml | sed -r 's#^metadata/(.*)\.yml:CurrentVersionCode: (.*)$#\1:\2#' | while read appid
do
fdroid scanner "$appid"
done