com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`confluence`.<result 2 when explaining filename '#sql-c6e3_183421'>, CONSTRAINT `fk_user_dir_id` FOREIGN KEY (`directory_id`) REFERENCES `cwd_directory` (`id`))

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Samebug tips

,

Check whether privilege has the "not null" restriction. If so it always has to have a value and can never be null.

A different reason could be a wrong implementation of a foreign key. Check whether you always correctly insert/update in both tables.

Solutions on the web

via atlassian.com by Unknown author, 1 year ago
Cannot delete or update a parent row: a foreign key constraint fails (`confluence`.`AO_9412A1_USER_APP_LINK`, CONSTRAINT `fk_ao_9412a1_user_app_link_user_id` FOREIGN KEY (`USER_ID`) REFERENCES `AO_9412A1_AOUSER` (`ID`))
via Oracle Community by 970985, 1 year ago
Cannot add or update a child row: a foreign key constraint fails (`switchingb`.`dcs_price`, CONSTRAINT `dcs_pricpric_lst_f` FOREIGN KEY (`price_list`) REFERENCES `dcs_price_list` (`price_list_id`)) **** Error Thu Dec 06 17:47:48 EST 2012 1354834068934 /atg/commerce/pricing/priceLists/PriceLists_production
via GitHub by dezil
, 2 years ago
Cann n`, CONSTRAINT `SelectedTown_ibfk_2` FOREIGN KEY (`townName`) REFERENCES `Towns`
via sourceforge.net by Unknown author, 2 years ago
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Cannot add or update a child row: a foreign key constraint fails (`confluence`.<result 2 when explaining filename '#sql-c6e3_183421'>, CONSTRAINT `fk_user_dir_id` FOREIGN KEY (`directory_id`) REFERENCES `cwd_directory` (`id`))

Users with the same issue

Once, 9 hours ago
3 times, 12 hours ago
29 times, 5 days ago
Once, 2 weeks ago
94 times, 3 weeks ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.