Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JdbcBatchUpdateException: Unique index or primary key violation PUBLIC.PRIMARY_KEY_3 #6408

Open
OndrejSpanel opened this issue May 15, 2024 · 3 comments
Labels
bug Something that is making a piece of functionality unusable investigation needed

Comments

@OndrejSpanel
Copy link

Describe the bug

To Reproduce Steps to reproduce the behavior:

When importing my SBT project (quite complex, custom crossbuilding JVM and JS), I get following errors:

org.h2.jdbc.JdbcBatchUpdateException: Unique index or primary key violation: "PUBLIC.PRIMARY_KEY_3 ON PUBLIC.TOPLEVEL_SYMBOL(JAR, PATH, SYMBOL) VALUES ( /* key:22557 */ 126, '/org/scalatest/enablers/TableAsserting.scala', 'org/scalatest/enablers/ForResult#')"; SQL statement:
insert into toplevel_symbol (symbol, path, jar) values (?, ?, ?) [23505-224]
	at org.h2.jdbc.JdbcPreparedStatement.executeBatch(JdbcPreparedStatement.java:1282)
	at scala.meta.internal.metals.JarTopLevels.putToplevels(JarTopLevels.scala:177)
	at scala.meta.internal.metals.JarTopLevels.putJarIndexingInfo(JarTopLevels.scala:128)
	at scala.meta.internal.metals.Indexer.addSourceJarSymbols(Indexer.scala:657)

2024.05.15 18:08:40 ERROR error processing file:///C:/Users/Ondra/AppData/Local/Coursier/Cache/v1/https/repo1.maven.org/maven2/org/scalatest/scalatest-core_3/3.2.11/scalatest-core_3-3.2.11-sources.jar
org.h2.jdbc.JdbcBatchUpdateException: Unique index or primary key violation: "PUBLIC.PRIMARY_KEY_3 ON PUBLIC.TOPLEVEL_SYMBOL(JAR, PATH, SYMBOL) VALUES ( /* key:25297 */ 143, '/org/scalatest/enablers/TableAsserting.scala', 'org/scalatest/enablers/ForResult#')"; SQL statement:
insert into toplevel_symbol (symbol, path, jar) values (?, ?, ?) [23505-224]
	at org.h2.jdbc.JdbcPreparedStatement.executeBatch(JdbcPreparedStatement.java:1282)
	at scala.meta.internal.metals.JarTopLevels.putToplevels(JarTopLevels.scala:177)
	at scala.meta.internal.metals.JarTopLevels.putJarIndexingInfo(JarTopLevels.scala:128)


org.h2.jdbc.JdbcBatchUpdateException: Unique index or primary key violation: "PUBLIC.PRIMARY_KEY_3 ON PUBLIC.TOPLEVEL_SYMBOL(JAR, PATH, SYMBOL) VALUES ( /* key:25297 */ 143, '/org/scalatest/enablers/TableAsserting.scala', 'org/scalatest/enablers/ForResult#')"; SQL statement:
insert into toplevel_symbol (symbol, path, jar) values (?, ?, ?) [23505-224]
	at org.h2.jdbc.JdbcPreparedStatement.executeBatch(JdbcPreparedStatement.java:1282)
	at scala.meta.internal.metals.JarTopLevels.putToplevels(JarTopLevels.scala:177)
	at scala.meta.internal.metals.JarTopLevels.putJarIndexingInfo(JarTopLevels.scala:128)
	at scala.meta.internal.metals.Indexer.addSourceJarSymbols(Indexer.scala:657)

Expected behavior

No errors

Installation:

  • Operating system: Windows 11 x64
  • VSCode version: Version: 1.89.1 (user setup)
  • VSCode extension version: v1.31.5 (pre-release)
  • Metals version: 1.3.0+74-0500a8cd-SNAPSHOT

Search terms

scalatest
PRIMARY_KEY_3

@tgodzik tgodzik transferred this issue from scalameta/metals-vscode May 16, 2024
@tgodzik
Copy link
Contributor

tgodzik commented May 16, 2024

Thanks for reporting! This shouldn't be too much an issue, but might be worth looking into.

@OndrejSpanel
Copy link
Author

If it is not an issue, then it should not yell ERROR at me. I am starting with Metals and it is hard to be sure what is issue and what is not.

@tgodzik
Copy link
Contributor

tgodzik commented May 16, 2024

If it is not an issue, then it should not yell ERROR at me. I am starting with Metals and it is hard to be sure what is issue and what is not.

It is an error and should be fixed for sure, just we don't have time to currently look into every error, so doing a bit of triage here.

@tgodzik tgodzik added bug Something that is making a piece of functionality unusable investigation needed labels May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that is making a piece of functionality unusable investigation needed
Projects
None yet
Development

No branches or pull requests

2 participants