 <p>These could be the reason behind "Invalid record error" - </p> <pre><code>Reason - It usually happens when you use "create" and "build" together. create method persists the instance while the build method keeps it only in memory. </code></pre> <p>Firstly, I will suggest you to use build method and please check validations related to it. There is something wrong in your validations.</p>