{"record":{"id":"55f38cbb95714e8b","repo":"theonedev/onedev","slug":"internal-error","errorCode":null,"errorMessage":"internal error","messagePattern":"internal error","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"critical","filePath":"server-plugin/server-plugin-pack-nuget/src/main/java/io/onedev/server/plugin/pack/nuget/NugetPackHandler.java","lineNumber":330,"sourceCode":"\t\t\t\t\t\t\t\t\t\tpackBlobs.add(nupkgBlob);\n\n\t\t\t\t\t\t\t\t\tpack.setData(new NugetData(data.getNupkgBlobSha256Hash(), snupkgBlob.getSha256Hash(), \n\t\t\t\t\t\t\t\t\t\t\tdata.getMetadata()));\n\t\t\t\t\t\t\t\t\tpackService.createOrUpdate(pack, packBlobs, false);\n\t\t\t\t\t\t\t\t\tresponse.setStatus(SC_CREATED);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}));\n\t\t\t\t\t\t} catch (ParseException e) {\n\t\t\t\t\t\t\tlogger.warn(\"Package version is not a SemVer v2 compatible version\");\n\t\t\t\t\t\t\tthrow new ClientException(SC_BAD_REQUEST);\n\t\t\t\t\t\t} finally {\n\t\t\t\t\t\t\tFileUtils.deleteFile(tempFile);\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new ClientException(SC_BAD_REQUEST);\n\t\t\t\t\t}\n\t\t\t\t} catch (FileUploadException | IOException e) {\n\t\t\t\t\tthrow new RuntimeException(e);\n\t\t\t\t}\n\t\t\t} else if (isDelete) {\n\t\t\t\tif (pathSegments.isEmpty()) {\n\t\t\t\t\tlogger.warn(\"Package id is missing\");\n\t\t\t\t\tthrow new ClientException(SC_BAD_REQUEST);\n\t\t\t\t}\n\t\t\t\tvar name = pathSegments.get(0);\n\t\t\t\tpathSegments = pathSegments.subList(1, pathSegments.size());\n\t\t\t\tif (pathSegments.isEmpty()) {\n\t\t\t\t\tlogger.warn(\"Package version is missing\");\n\t\t\t\t\tthrow new ClientException(SC_BAD_REQUEST);\n\t\t\t\t}\n\t\t\t\tvar version = pathSegments.get(0);\n\n\t\t\t\tLockUtils.run(getLockName(projectId, name), () -> transactionService.run(() -> {\n\t\t\t\t\tvar project = checkProject(projectId, true);\n\t\t\t\t\tvar pack = packService.findByNameAndVersion(project, TYPE, name, version);\n\t\t\t\t\tif (pack != null) {","sourceCodeStart":312,"sourceCodeEnd":348,"githubUrl":"https://github.com/theonedev/onedev/blob/d44925c47c37992c828ea673a5f9620539bc3ff2/server-plugin/server-plugin-pack-nuget/src/main/java/io/onedev/server/plugin/pack/nuget/NugetPackHandler.java#L312-L348","documentation":"The message 'internal error' is produced by rethrowing a caught FileUploadException or IOException from the NuGet publish handler as a RuntimeException with the exception as cause. The client sees a 500-style internal error indicating the uploaded package stream could not be read or parsed, with the root cause (disk I/O, multipart parse failure, network truncation) attached.","triggerScenarios":"PUT push where reading the multipart upload or temp file throws FileUploadException or IOException — e.g. malformed multipart body, interrupted connection, or disk failure while staging the temp .nupkg.","commonSituations":"Large packages exceeding a proxy's body size limit and getting cut off mid-upload; flaky network between CI and OneDev; servlet container temp directory permissions or full disk causing temp file writes to fail; a non-NuGet client POSTing a malformed body to the push endpoint.","solutions":["Inspect the OneDev server log for the RuntimeException's cause to identify the underlying FileUploadException/IOException.","Retry the push; for flaky connections use a resumable/robust network path or run the push from the same network as the server.","Increase proxy/upload size limits (nginx client_max_body_size, container max POST size) for large .nupkg files.","Verify server disk space and write permissions on the servlet temp directory used for upload staging.","Confirm the push uses the standard NuGet push protocol against the OneDev NuGet source rather than a hand-crafted upload."],"exampleFix":"// before — nginx truncating large uploads\nclient_max_body_size 10m;\n// after\nclient_max_body_size 500m;","handlingStrategy":"try-catch","validationCode":"# Check upload size limits and server reachability before pushing\nSIZE=$(stat -c%s *.nupkg)\nLIMIT=$((500*1024*1024))\nif [ \"$SIZE\" -gt \"$LIMIT\" ]; then echo \"Package exceeds 500MB upload limit\"; exit 1; fi\ncurl -fsS -o /dev/null \"${ONDEV_URL}/nuget/${PROJECT}/index.json\" || { echo 'NuGet source unreachable'; exit 1; }","typeGuard":null,"tryCatchPattern":"try {\n  dotnet nuget push pkg.nupkg -s $ONDEV_SOURCE -k $TOKEN;\n} catch {\n  echo \"Push failed with internal error; check OneDev server log for the FileUploadException/IOException cause (truncated upload, disk space, temp dir permissions).\";\n}","preventionTips":["Raise proxy and servlet upload size limits for large .nupkg files.","Monitor server disk space and temp directory permissions.","Retry pushes on flaky networks; inspect server logs for the root cause.","Push with standard NuGet clients to guarantee well-formed multipart bodies."],"tags":["nuget","internal-error","file-upload"],"backgroundTag":"http-request-failed","analyzedSha":"d44925c47c37992c828ea673a5f9620539bc3ff2","analyzedAt":"2026-09-06T07:18:27.995Z","contentChangedAt":"2026-09-06T07:18:27.995Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}