com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '23068d2b-9421-44a4-8db5-745ff921bad9-1' for key 'PRIMARY'

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.

,

Nothing is wrong with the database. When it gives you those errors, it's telling you that you are trying to input "nothing" (null) into a column that doesn't allow it. Fix it by removing the not null constraint or by passing a value to that field.

Solutions on the web

via GitHub by ProgrammerDan
, 1 year ago
Duplicate entry '23068d2b-9421-44a4-8db5-745ff921bad9-1' for key 'PRIMARY'
via Stack Overflow by Mykhailo Seniutovych
, 11 months ago
Cannot add or update a child row: a foreign key constraint fails (`grades_book_db`.`grades`, CONSTRAINT `FK_Grades_Subject` FOREIGN KEY (`Subject_Id`) REFERENCES `subjects` (`Subject_Id`))
via Stack Overflow by Milos Vulic
, 9 hours ago
Cannot add or update a child row: a foreign key constraint fails (`projekatbaze`.`pesmica`, CONSTRAINT `pesmica_ibfk_1` FOREIGN KEY (`id_album`) REFERENCES `album` (`id_album`) ON DELETE CASCADE ON UPDATE NO ACTION)
via Stack Overflow by Romil Jain
, 1 year ago
Duplicate entry 'owner1:warehouseid1:skuid98238:08-11-2016' for key 'PRIMARY'
via cayenne-user by Andrew Willerding, 1 year ago
Duplicate entry '2-9999-1922-1' for key 'U_ProjectContact'
com.mysql.jdbc.exceptions.jdbc4.MySQLIntegrityConstraintViolationException: Duplicate entry '23068d2b-9421-44a4-8db5-745ff921bad9-1' for key 'PRIMARY'
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at com.mysql.jdbc.Util.handleNewInstance(Util.java:404)
at com.mysql.jdbc.Util.getInstance(Util.java:387)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:934)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3870)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3806)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2470)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2617)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2550)
at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1861)
at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2073)
at com.mysql.jdbc.PreparedStatement.executeUpdateInternal(PreparedStatement.java:2009)
at com.mysql.jdbc.PreparedStatement.executeLargeUpdate(PreparedStatement.java:5094)
at com.mysql.jdbc.PreparedStatement.executeUpdate(PreparedStatement.java:1994)
at vg.civcraft.mc.bettershards.database.DatabaseManager.getPlayerLock(DatabaseManager.java:373)
at vg.civcraft.mc.bettershards.database.DatabaseManager.savePlayerData(DatabaseManager.java:435)
at vg.civcraft.mc.bettershards.misc.CustomWorldNBTStorage.save(CustomWorldNBTStorage.java:54)
at org.bukkit.craftbukkit.v1_10_R1.entity.CraftPlayer.saveData(CraftPlayer.java:503)
at vg.civcraft.mc.prisonpearl.listener.PlayerListener.onPlayerQuitPearlCheck(PlayerListener.java:274)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:306)
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:502)
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:487)
at net.minecraft.server.v1_10_R1.PlayerList.disconnect(PlayerList.java:385)
at net.minecraft.server.v1_10_R1.PlayerConnection.a(PlayerConnection.java:1058)
at net.minecraft.server.v1_10_R1.NetworkManager.handleDisconnection(NetworkManager.java:318)
at net.minecraft.server.v1_10_R1.ServerConnection.c(ServerConnection.java:174)
at net.minecraft.server.v1_10_R1.MinecraftServer.D(MinecraftServer.java:832)
at net.minecraft.server.v1_10_R1.DedicatedServer.D(DedicatedServer.java:399)
at net.minecraft.server.v1_10_R1.MinecraftServer.C(MinecraftServer.java:672)
at net.minecraft.server.v1_10_R1.MinecraftServer.run(MinecraftServer.java:571)
at java.lang.Thread.run(Thread.java:745)

Users with the same issue

6 times, 1 week ago
Once, 1 week ago
5 times, 4 weeks ago
4 times, 1 month ago
2 times, 1 month ago

Write tip

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