Getting "Error: Failed to prepare transaction: could not find database" while trying to install icaclient package

I executed sudo pacman -Syy and then repeated the above command. This time the install has gone ahead without issues.