Nexus Repository 2 officially sunsetted June 30, 2025. Visit my.sonatype.com for archived documentation. Migrate to Sonatype Nexus Repository 3 as soon as possible.
Symptoms
You are running an older version of Nexus Repository 2 NuGet plugin and see WARN messages in your log that include lines similar to
2013-09-03 16:36:28 WARN [41230120-103480] - com.sonatype.nexus.plugins.nuget.odata.ODataNugetGallery - Problem updating NuGet package in: company-releases org.h2.jdbc.JdbcSQLException: Timeout trying to lock table "PACKAGES"; SQL statement: MERGE INTO PACKAGES VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?) [50200-163]
2013-09-03 13:03:12 WARN [41230120-101386] - com.sonatype.nexus.plugins.nuget.odata.ODataNugetGallery - Problem deleting NuGet package: nexus:repo:/Some.Package/3.3.2.0/Some.Package-3.3.2.0.nupkg from: repo org.h2.jdbc.JdbcSQLException: Timeout trying to lock table "PACKAGES"; SQL statement: DELETE FROM PACKAGES WHERE REPOSITORYID=? AND LOCATION=? [50200-163]
Workaround
The timeout for locking database tables in older versions of the NuGet plugin was very brief. Under high load performing updates to Nuget packages, this results in lock contention. Newer versions have the timeout set to 60 seconds by default. As a short term workaround, you can also set this to 60 seconds without upgrading Nexus versions.
Edit <nexus_install_dir>/conf/nexus.properties
and add the following:
nexus-nuget-h2-settings:LOCK_TIMEOUT=60000;FILE_LOCK=SOCKET;QUERY_CACHE_SIZE=0;CACHE_SIZE=0;CACHE_TYPE=SOFT_LRU;MULTI_THREADED=1
...then restart Nexus.
Note: It is strongly recommended to always use the latest Nexus Repository version when using NuGet features since NuGet is a fast moving project that has been known to introduce bugs into otherwise working Nexus installations.