This error message is usually very confusing. The reason mostly is just that one of the arguments has the wrong type.