Possibly save 1 hour of your time: I got this error when I am extracting data from a file and pushing those data to database.
This issue stems from the data missing values. Hence, it was trying to insert NULL values into a non-null column.
This is easily fixed by changing the database table column to allow NULL values. If you don’t expect null values, then you will have to filter those data out before inserting into the database.