We are running Nexus 2.14 in a kubernetes container (using the latest image), we migrated this from a centos 6 vm running Nexus 2.11 and followed documentation for migrating nexus-data and reindexing.
It mostly seems to be working, except the H2 database appears to crash or become unresponsive, we get the following error in the logs, at the same time users report they can’t see any packages in a NuGet feed:
2020-07-16 09:27:28,963+0000 WARN [qtp1690254271-1972] anonymous com.sonatype.nexus.plugins.nuget.odata.ODataNugetGallery - Problem querying NuGet packages: $filter=IsLatestVersion&$orderby=Id&searchTerm=’’&targetFramework=’’&includePrerelease=false&$skip=0&$top=30&semVerLevel=2.0.0 in: [nuget-releases]
org.h2.jdbc.JdbcSQLException: IO Exception: “java.io.IOException: Input/output error”; “/sonatype-work/nuget/odata.h2.db”; SQL statement:
SELECT P.*,(P.VERSION=L.AV) AS ISABSOLUTELATESTVERSION,(P.VERSION=L.V) AS ISLATESTVERSION FROM (SELECT ID,MAX_VERSION(VERSION) AS AV,MAX_VERSION(CASEWHEN(ISPRERELEASE,’’,VERSION)) AS V FROM PACKAGES WHERE LOCATE(CONCAT(CONCAT(’:’,REPOSITORYID),’:’),?1) GROUP BY ID) AS L INNER JOIN PACKAGES AS P ON L.ID=P.ID WHERE
LOCATE(CONCAT(CONCAT(’:’,REPOSITORYID),’:’),?1) AND NOT P.ISPRERELEASE AND (((P.VERSION=L.V))) ORDER BY P.ID,P.ID,P.VERSION LIMIT 30 OFFSET 0 [90031-175]
Restarting the container temporarily fixes the issue but we have to do this every day at the same time. We have rebuilt the h2 database and refreshed the NuGet feed’s as another article suggested as well, this didn’t resolve the issue.
The issue also doesn’t seem to appear if we schedule a curl query to run every 5 mins to query the nuget source, which comes back with packages in XML format. That seems to stop the issue occurring.
Also to note, this issue doesn’t occur in the Nexus 2.11 vm we migrated from.