“嵌套DB TX!” Sonatype Nexus中的错误

时间:2017-07-12 15:07:16

标签: maven nexus

从Jenkins向我们的Nexus部署Maven工件时,我们遇到了一些偶发错误。我们从一开始就经历过这些错误,但后来大约每周一次。现在我们在Jenkins上运行更多的工作(也是并行),我们每小时就能得到一次。

Nexus版本为3.3.1。

这是完整的堆栈跟踪,如果它有帮助:

2017-07-12 16:34:11,869+0200 WARN  [qtp234963760-2207] pegasusgaswrite org.sonatype.nexus.repository.httpbridge.internal.ViewServlet - Failure servicing: PUT /nexus/repository/example-snapshots/com/example/example-parent/1.0-SNAPSHOT/example-parent-1.0-20170712.123107-9-api.jar
java.lang.IllegalArgumentException: Nested DB TX!
    at com.google.common.base.Preconditions.checkArgument(Preconditions.java:122) [na:na]
    at org.sonatype.nexus.repository.storage.StorageTxImpl.<init>(StorageTxImpl.java:146) [na:na]
    at org.sonatype.nexus.repository.storage.StorageFacetImpl.openStorageTx(StorageFacetImpl.java:248) [na:na]
    at org.sonatype.nexus.repository.storage.StorageFacetImpl.lambda$0(StorageFacetImpl.java:146) [na:na]
    at org.sonatype.nexus.transaction.UnitOfWork.acquireTransaction(UnitOfWork.java:171) [na:na]
    at org.sonatype.nexus.transaction.TransactionInterceptor.invoke(TransactionInterceptor.java:53) [na:na]
    at org.sonatype.nexus.repository.maven.internal.MavenFacetImpl.put(MavenFacetImpl.java:200) [na:na]
    at org.sonatype.nexus.repository.maven.internal.hosted.HostedHandler.doPut(HostedHandler.java:87) [na:na]
    at org.sonatype.nexus.repository.maven.internal.hosted.HostedHandler.handle(HostedHandler.java:61) [na:na]
    at org.sonatype.nexus.repository.view.Context.proceed(Context.java:80) [na:na]
    at org.sonatype.nexus.repository.storage.UnitOfWorkHandler.handle(UnitOfWorkHandler.java:39) [na:na]
    at org.sonatype.nexus.repository.view.Context.proceed(Context.java:80) [na:na]
    at org.sonatype.nexus.repository.view.handlers.ContentHeadersHandler.handle(ContentHeadersHandler.java:44) [na:na]
    at org.sonatype.nexus.repository.view.Context.proceed(Context.java:80) [na:na]
    at org.sonatype.nexus.repository.maven.internal.VersionPolicyHandler.handle(VersionPolicyHandler.java:60) [na:na]
    at org.sonatype.nexus.repository.view.Context.proceed(Context.java:80) [na:na]
    at org.sonatype.nexus.repository.http.PartialFetchHandler.handle(PartialFetchHandler.java:55) [na:na]
    at org.sonatype.nexus.repository.view.Context.proceed(Context.java:80) [na:na]
    at org.sonatype.nexus.repository.view.handlers.ConditionalRequestHandler.handle(ConditionalRequestHandler.java:72) [na:na]
    at org.sonatype.nexus.repository.view.Context.proceed(Context.java:80) [na:na]
    at com.sonatype.nexus.plugins.healthcheck.downloads.AssetDownloadCountContributedHandler.handle(AssetDownloadCountContributedHandler.java:47) [na:na]
    at org.sonatype.nexus.repository.view.Context.proceed(Context.java:80) [na:na]
    at org.sonatype.nexus.repository.view.handlers.HandlerContributor.handle(HandlerContributor.java:67) [na:na]
    at org.sonatype.nexus.repository.view.Context.proceed(Context.java:80) [na:na]
    at org.sonatype.nexus.repository.view.handlers.ExceptionHandler.handle(ExceptionHandler.java:43) [na:na]
    at org.sonatype.nexus.repository.view.Context.proceed(Context.java:80) [na:na]
    at org.sonatype.nexus.repository.security.SecurityHandler.handle(SecurityHandler.java:52) [na:na]
    at org.sonatype.nexus.repository.view.Context.proceed(Context.java:80) [na:na]
    at org.sonatype.nexus.repository.view.handlers.TimingHandler.handle(TimingHandler.java:46) [na:na]
    at org.sonatype.nexus.repository.view.Context.proceed(Context.java:80) [na:na]
    at org.sonatype.nexus.repository.view.Context.start(Context.java:114) [na:na]
    at org.sonatype.nexus.repository.view.Router.dispatch(Router.java:63) [na:na]
    at org.sonatype.nexus.repository.view.ConfigurableViewFacet.dispatch(ConfigurableViewFacet.java:52) [na:na]
    at org.sonatype.nexus.repository.view.ConfigurableViewFacet.dispatch(ConfigurableViewFacet.java:43) [na:na]
    at org.sonatype.nexus.repository.httpbridge.internal.ViewServlet.dispatchAndSend(ViewServlet.java:198) [na:na]
    at org.sonatype.nexus.repository.httpbridge.internal.ViewServlet.doService(ViewServlet.java:160) [na:na]
    at org.sonatype.nexus.repository.httpbridge.internal.ViewServlet.service(ViewServlet.java:117) [na:na]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790) [javax.servlet-api:3.1.0]
    at com.google.inject.servlet.ServletDefinition.doServiceImpl(ServletDefinition.java:286) [com.google.inject:4.1.0]
    [...]

错误消息似乎来自StorageTxImpl.java

目前磁盘上有超过50 GB的可用内存,内存使用率低于50%,所以我认为这不是资源问题。

1 个答案:

答案 0 :(得分:0)

嵌套的事务可能导致数据丢失,而OrientDB(底层Nexus在下面使用)仅对此提供基本支持。 Nexus团队决定postpone the discussion是否使用它。

无论何时发生这种状态,它们都会引发错误(带有checkArgument):import ibm_db import pandas as pd from sqlalchemy import create_engine dsn_driver = "IBM DB2 ODBC DRIVER" dsn_database = "..." dsn_hostname= "..." dsn_port="60000" dsn_protocol="TCPIP" dsn_uid="..." dsn_pwd="..." d = {'col1': [1, 2,3,4,5,6,7,8,9,10], 'col2': [3, 4,3,4,5,6,7,8,2,34], 'col3': [1, 2,3,14,5,36,72,8,9,10],} df = pd.DataFrame(data=d) engine = create_engine('ibm_db_sa://'+ dsn_uid + ':' + dsn_pwd + '@'+dsn_hostname+':'+dsn_port+'/' + dsn_database ) df.to_sql('pandas1', engine) 。我们发现重启Nexus实例是规避它的最佳方法。