org.h2.jdbc.JdbcSQLException: General error: "java.lang.RuntimeException: try to remove head"; SQL statement: MERGE INTO PACKAGES VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) [50000-175]

Sonatype JIRA | Rich Seddon | 11 months ago
tip
Do you find the tips below useful? Click on the to mark them and say thanks to rafael . Or join the community to write better ones.
  1. 0

    Under certain circumstances (yet to be determined) the NuGet h2 database starts throwing errors like these in response to queries: {noformat} 2016-05-26 15:17:34 WARN [qtp1641102868-2377] anonymous com.sonatype.nexus.plugins.nuget.odata.ODataNugetGallery - Problem updating NuGet package in: NuGet-Gallery org.h2.jdbc.JdbcSQLException: General error: "java.lang.RuntimeException: try to remove head"; SQL statement: MERGE INTO PACKAGES VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) [50000-175] at org.h2.message.DbException.getJdbcSQLException(DbException.java:332) ~[nexus-h2-plugin-2.12.1-01/:na] at org.h2.message.DbException.get(DbException.java:161) ~[nexus-h2-plugin-2.12.1-01/:na] at org.h2.message.DbException.convert(DbException.java:284) ~[nexus-h2-plugin-2.12.1-01/:na] at org.h2.table.RegularTable.addRow(RegularTable.java:137) ~[nexus-h2-plugin-2.12.1-01/:na] at org.h2.command.dml.Merge.merge(Merge.java:161) ~[nexus-h2-plugin-2.12.1-01/:na] at org.h2.command.dml.Merge.update(Merge.java:106) ~[nexus-h2-plugin-2.12.1-01/:na] at org.h2.command.CommandContainer.update(CommandContainer.java:79) ~[nexus-h2-plugin-2.12.1-01/:na] at org.h2.command.Command.executeUpdate(Command.java:253) ~[nexus-h2-plugin-2.12.1-01/:na] at org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:154) ~[nexus-h2-plugin-2.12.1-01/:na] at org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:140) ~[nexus-h2-plugin-2.12.1-01/:na] at com.sonatype.nexus.plugins.nuget.odata.ODataNugetGallery.put(ODataNugetGallery.java:456) ~[nexus-nuget-plugin-2.12.1-01/:na] at com.sonatype.nexus.plugins.nuget.passthrough.PassThroughNugetGallery$FeedLoader$1$1.consume(PassThroughNugetGallery.java:362) [nexus-nuget-plugin-2.12.1-01/:na] at com.sonatype.nexus.plugins.nuget.odata.FeedSplicer.ended(FeedSplicer.java:108) [nexus-nuget-plugin-2.12.1-01/:na] at com.sonatype.nexus.plugins.nuget.odata.XmlSplicer.consume(XmlSplicer.java:81) [nexus-nuget-plugin-2.12.1-01/:na] at com.sonatype.nexus.plugins.nuget.odata.FeedSplicer.consumePage(FeedSplicer.java:57) [nexus-nuget-plugin-2.12.1-01/:na] at com.sonatype.nexus.plugins.nuget.feed.NugetFeedFetcher.cachePackageFeed(NugetFeedFetcher.java:78) [nexus-nuget-plugin-2.12.1-01/:na] at com.sonatype.nexus.plugins.nuget.passthrough.PassThroughNugetGallery$FeedLoader$1.call(PassThroughNugetGallery.java:358) [nexus-nuget-plugin-2.12.1-01/:na] at com.sonatype.nexus.plugins.nuget.passthrough.PassThroughNugetGallery$FeedLoader$1.call(PassThroughNugetGallery.java:355) [nexus-nuget-plugin-2.12.1-01/:na] at com.google.common.cache.LocalCache$LocalManualCache$1.load(LocalCache.java:4739) [guava-16.0.1.jar:na] at com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524) [guava-16.0.1.jar:na] at com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317) [guava-16.0.1.jar:na] at com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280) [guava-16.0.1.jar:na] at com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195) [guava-16.0.1.jar:na] at com.google.common.cache.LocalCache.get(LocalCache.java:3934) [guava-16.0.1.jar:na] at com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4736) [guava-16.0.1.jar:na] at com.sonatype.nexus.plugins.nuget.passthrough.PassThroughNugetGallery.passQueryToRemoteRepos(PassThroughNugetGallery.java:289) [nexus-nuget-plugin-2.12.1-01/:na] at com.sonatype.nexus.plugins.nuget.passthrough.PassThroughNugetGallery.feed(PassThroughNugetGallery.java:156) [nexus-nuget-plugin-2.12.1-01/:na] at com.sonatype.nexus.plugins.nuget.rest.NugetGalleryResource.get(NugetGalleryResource.java:157) [nexus-nuget-plugin-2.12.1-01/:na] at org.sonatype.plexus.rest.resource.RestletResource.represent(RestletResource.java:233) [nexus-restlet1x-plugin-2.12.1-01/:na] at org.sonatype.nexus.rest.NexusRestletResource.represent(NexusRestletResource.java:39) [nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.resource.Resource.getRepresentation(Resource.java:302) [nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.resource.Resource.handleGet(Resource.java:464) [nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.Finder.handle(Finder.java:353) [nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.Filter.doHandle(Filter.java:150) [nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.Filter.handle(Filter.java:195) [nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.Router.handle(Router.java:504) [nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.Filter.doHandle(Filter.java:150) [nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.Filter.handle(Filter.java:195) [nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.Filter.doHandle(Filter.java:150) [nexus-restlet1x-plugin-2.12.1-01/:na] at org.sonatype.plexus.rest.RetargetableRestlet.doHandle(RetargetableRestlet.java:36) [nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.Filter.handle(Filter.java:195) [nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.Filter.doHandle(Filter.java:150) [nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.Filter.handle(Filter.java:195) [nexus-restlet1x-plugin-2.12.1-01/:na] at org.restlet.Filter.doHandle(Filter.java:150) [nexus-restlet1x-plugin-2.12.1-01/:na] {noformat} We've seen this twice now. I haven't been able to determine the cause from available information. In both cases it was necessary to rebuild the h2 database to recover.

    Sonatype JIRA | 11 months ago | Rich Seddon
    org.h2.jdbc.JdbcSQLException: General error: "java.lang.RuntimeException: try to remove head"; SQL statement: MERGE INTO PACKAGES VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) [50000-175]
  2. 0
    samebug tip
    Check if you're not creating unused SQL entities, as it might cause this exception.
  3. 0

    H2 "OTHER" data type throws Exception when storing String or Boolean

    Stack Overflow | 2 years ago | Steve McLeod
    org.h2.jdbc.JdbcSQLException: Hexadecimal string contains non-hex character: "foobar"; SQL statement: insert into test (key, value) values (?, ?) -- (?1, ?2) [90004-188]
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    Unable to generate an api-token on rundeck 1.5

    GitHub | 4 years ago | connaryscott
    org.h2.jdbc.JdbcSQLException: Value too long for column AUTH_ROLES VARCHAR(255) NOT NULL: 'GS-Members-MISMO-CORP,GS-EComm-WebAdmins,GS-WebSiteAccess-MIS-CORP,Web Admins-eCommerce,$MISMO,GS-PrivNAS-AK-CORP,GS-Everyone-M... (303); SQL statement: insert into auth_token (id, version, auth_roles, token, user_id) values (null, ?, ?, ?, ?) [90005-112]
  6. 0

    creating a job on the UI leads to "value too long for column USER_RULE_LIST..."

    GitHub | 4 years ago | connaryscott
    org.h2.jdbc.JdbcSQLException: Value too long for column USER_ROLE_LIST VARCHAR(255): 'SNC-Ecommerce Search,GS-Members-MISMO-CORP,$MISMO,GS-PrivNAS-AK-CORP,GS-APMQALDAP,GS-APMPRDLDAP,IT eCommerce Organization,SNC-E... (412); SQL statement: insert into scheduled_execution (id, version, adhoc_execution, adhoc_filepath, adhoc_local_string, adhoc_remote_string, arg_string, date_created, day_of_month, day_of_week, description, do_nodedispatch, exec_count, group_path, hour, job_name, last_updated, loglevel, minute, month, multiple_executions, next_execution, node_exclude, node_exclude_name, node_exclude_os_arch, node_exclude_os_family, node_exclude_os_name, node_exclude_os_version, node_exclude_precedence, node_exclude_tags, node_include, node_include_name, node_include_os_arch, node_include_os_family, node_include_os_name, node_include_os_version, node_include_tags, node_keepgoing, node_rank_attribute, node_rank_order_ascending, node_threadcount, project, scheduled, seconds, total_time, rduser, user_role_list, uuid, workflow_id, year) values (null, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) [90005-112]
Not finding the right solution?
Take a tour to get the most out of Samebug.

Tired of useless tips?

Automated exception search integrated into your IDE

Root Cause Analysis

  1. org.h2.jdbc.JdbcSQLException

    General error: "java.lang.RuntimeException: try to remove head"; SQL statement: MERGE INTO PACKAGES VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) [50000-175]

    at org.h2.message.DbException.getJdbcSQLException()
  2. H2 Database Engine
    JdbcPreparedStatement.executeUpdate
    1. org.h2.message.DbException.getJdbcSQLException(DbException.java:332)[nexus-h2-plugin-2.12.1-01/:na]
    2. org.h2.message.DbException.get(DbException.java:161)[nexus-h2-plugin-2.12.1-01/:na]
    3. org.h2.message.DbException.convert(DbException.java:284)[nexus-h2-plugin-2.12.1-01/:na]
    4. org.h2.table.RegularTable.addRow(RegularTable.java:137)[nexus-h2-plugin-2.12.1-01/:na]
    5. org.h2.command.dml.Merge.merge(Merge.java:161)[nexus-h2-plugin-2.12.1-01/:na]
    6. org.h2.command.dml.Merge.update(Merge.java:106)[nexus-h2-plugin-2.12.1-01/:na]
    7. org.h2.command.CommandContainer.update(CommandContainer.java:79)[nexus-h2-plugin-2.12.1-01/:na]
    8. org.h2.command.Command.executeUpdate(Command.java:253)[nexus-h2-plugin-2.12.1-01/:na]
    9. org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:154)[nexus-h2-plugin-2.12.1-01/:na]
    10. org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:140)[nexus-h2-plugin-2.12.1-01/:na]
    10 frames
  3. com.sonatype.nexus
    PassThroughNugetGallery$FeedLoader$1.call
    1. com.sonatype.nexus.plugins.nuget.odata.ODataNugetGallery.put(ODataNugetGallery.java:456)[nexus-nuget-plugin-2.12.1-01/:na]
    2. com.sonatype.nexus.plugins.nuget.passthrough.PassThroughNugetGallery$FeedLoader$1$1.consume(PassThroughNugetGallery.java:362)[nexus-nuget-plugin-2.12.1-01/:na]
    3. com.sonatype.nexus.plugins.nuget.odata.FeedSplicer.ended(FeedSplicer.java:108)[nexus-nuget-plugin-2.12.1-01/:na]
    4. com.sonatype.nexus.plugins.nuget.odata.XmlSplicer.consume(XmlSplicer.java:81)[nexus-nuget-plugin-2.12.1-01/:na]
    5. com.sonatype.nexus.plugins.nuget.odata.FeedSplicer.consumePage(FeedSplicer.java:57)[nexus-nuget-plugin-2.12.1-01/:na]
    6. com.sonatype.nexus.plugins.nuget.feed.NugetFeedFetcher.cachePackageFeed(NugetFeedFetcher.java:78)[nexus-nuget-plugin-2.12.1-01/:na]
    7. com.sonatype.nexus.plugins.nuget.passthrough.PassThroughNugetGallery$FeedLoader$1.call(PassThroughNugetGallery.java:358)[nexus-nuget-plugin-2.12.1-01/:na]
    8. com.sonatype.nexus.plugins.nuget.passthrough.PassThroughNugetGallery$FeedLoader$1.call(PassThroughNugetGallery.java:355)[nexus-nuget-plugin-2.12.1-01/:na]
    8 frames
  4. Guava
    LocalCache$LocalManualCache.get
    1. com.google.common.cache.LocalCache$LocalManualCache$1.load(LocalCache.java:4739)[guava-16.0.1.jar:na]
    2. com.google.common.cache.LocalCache$LoadingValueReference.loadFuture(LocalCache.java:3524)[guava-16.0.1.jar:na]
    3. com.google.common.cache.LocalCache$Segment.loadSync(LocalCache.java:2317)[guava-16.0.1.jar:na]
    4. com.google.common.cache.LocalCache$Segment.lockedGetOrLoad(LocalCache.java:2280)[guava-16.0.1.jar:na]
    5. com.google.common.cache.LocalCache$Segment.get(LocalCache.java:2195)[guava-16.0.1.jar:na]
    6. com.google.common.cache.LocalCache.get(LocalCache.java:3934)[guava-16.0.1.jar:na]
    7. com.google.common.cache.LocalCache$LocalManualCache.get(LocalCache.java:4736)[guava-16.0.1.jar:na]
    7 frames
  5. com.sonatype.nexus
    NugetGalleryResource.get
    1. com.sonatype.nexus.plugins.nuget.passthrough.PassThroughNugetGallery.passQueryToRemoteRepos(PassThroughNugetGallery.java:289)[nexus-nuget-plugin-2.12.1-01/:na]
    2. com.sonatype.nexus.plugins.nuget.passthrough.PassThroughNugetGallery.feed(PassThroughNugetGallery.java:156)[nexus-nuget-plugin-2.12.1-01/:na]
    3. com.sonatype.nexus.plugins.nuget.rest.NugetGalleryResource.get(NugetGalleryResource.java:157)[nexus-nuget-plugin-2.12.1-01/:na]
    3 frames
  6. ${project.groupId}:${project.artifactId}
    RestletResource.represent
    1. org.sonatype.plexus.rest.resource.RestletResource.represent(RestletResource.java:233)[nexus-restlet1x-plugin-2.12.1-01/:na]
    1 frame
  7. Nexus Core
    NexusRestletResource.represent
    1. org.sonatype.nexus.rest.NexusRestletResource.represent(NexusRestletResource.java:39)[nexus-restlet1x-plugin-2.12.1-01/:na]
    1 frame
  8. org.restlet.resource
    Resource.handleGet
    1. org.restlet.resource.Resource.getRepresentation(Resource.java:302)[nexus-restlet1x-plugin-2.12.1-01/:na]
    2. org.restlet.resource.Resource.handleGet(Resource.java:464)[nexus-restlet1x-plugin-2.12.1-01/:na]
    2 frames
  9. org.restlet
    Filter.doHandle
    1. org.restlet.Finder.handle(Finder.java:353)[nexus-restlet1x-plugin-2.12.1-01/:na]
    2. org.restlet.Filter.doHandle(Filter.java:150)[nexus-restlet1x-plugin-2.12.1-01/:na]
    3. org.restlet.Filter.handle(Filter.java:195)[nexus-restlet1x-plugin-2.12.1-01/:na]
    4. org.restlet.Router.handle(Router.java:504)[nexus-restlet1x-plugin-2.12.1-01/:na]
    5. org.restlet.Filter.doHandle(Filter.java:150)[nexus-restlet1x-plugin-2.12.1-01/:na]
    6. org.restlet.Filter.handle(Filter.java:195)[nexus-restlet1x-plugin-2.12.1-01/:na]
    7. org.restlet.Filter.doHandle(Filter.java:150)[nexus-restlet1x-plugin-2.12.1-01/:na]
    7 frames
  10. ${project.groupId}:${project.artifactId}
    RetargetableRestlet.doHandle
    1. org.sonatype.plexus.rest.RetargetableRestlet.doHandle(RetargetableRestlet.java:36)[nexus-restlet1x-plugin-2.12.1-01/:na]
    1 frame
  11. org.restlet
    Filter.doHandle
    1. org.restlet.Filter.handle(Filter.java:195)[nexus-restlet1x-plugin-2.12.1-01/:na]
    2. org.restlet.Filter.doHandle(Filter.java:150)[nexus-restlet1x-plugin-2.12.1-01/:na]
    3. org.restlet.Filter.handle(Filter.java:195)[nexus-restlet1x-plugin-2.12.1-01/:na]
    4. org.restlet.Filter.doHandle(Filter.java:150)[nexus-restlet1x-plugin-2.12.1-01/:na]
    4 frames