Same problem here in jessie. Downloaded 4.0.4-1 and 4.0.5-1 from debian snapshot but gave the same error. The attached patch from Denis Sirotkin did work on 4.0.3-1 and 4.0.5-1. Also need luks encryption to work which was fixed in 4.0.4-1 so gonna stay with these snapshot versions.
Bob