René's URL Explorer Experiment


Title: Netty IllegalReferenceCountException causes false upload failure despite successful upload · Issue #12489 · apache/cloudstack · GitHub

Open Graph Title: Netty IllegalReferenceCountException causes false upload failure despite successful upload · Issue #12489 · apache/cloudstack

X Title: Netty IllegalReferenceCountException causes false upload failure despite successful upload · Issue #12489 · apache/cloudstack

Description: problem Related Issue Related to #12486 Summary When uploading templates/ISOs from local file via the UI, the upload completes successfully on the SSVM (file is written to disk, SSVM returns HTTP 200 "upload successful"), but a Netty Ill...

Open Graph Description: problem Related Issue Related to #12486 Summary When uploading templates/ISOs from local file via the UI, the upload completes successfully on the SSVM (file is written to disk, SSVM returns HTTP 2...

X Description: problem Related Issue Related to #12486 Summary When uploading templates/ISOs from local file via the UI, the upload completes successfully on the SSVM (file is written to disk, SSVM returns HTTP 2...

Opengraph URL: https://github.com/apache/cloudstack/issues/12489

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Netty IllegalReferenceCountException causes false upload failure despite successful upload","articleBody":"### problem\n\n**Related Issue**\nRelated to https://github.com/apache/cloudstack/issues/12486\n\n**Summary**\nWhen uploading templates/ISOs from local file via the UI, the upload completes successfully on the SSVM (file is written to disk, SSVM returns HTTP 200 \"upload successful\"), but a Netty IllegalReferenceCountException occurs during response handling. This causes the UI to display an error to the user even though the upload actually succeeded. The template eventually becomes \"Ready\" after background processing completes.\n\n### versions\n\nCloudStack Version 4.20.2.0\n\n### The steps to reproduce the bug\n\n1. Navigate to Images → Templates\n2. Click \"Upload Template from local\"\n4. Fill in the form and submit\n5. Watch browser Network tab - upload returns 200 OK\n6. Check browser Console - may show error despite 200 OK\n7. Check SSVM logs - see Netty IllegalReferenceCountException\n8. Wait - template eventually becomes Ready\n\nNote: This issue is intermittent.\n\n**Expected Behavior**\nWhen the upload succeeds (HTTP 200, file written to disk), the UI should show success to the user.\n\n**Actual Behavior**\n\n- Upload succeeds (HTTP 200, \"upload successful\")\n- File is written to disk correctly\n- Netty throws IllegalReferenceCountException during cleanup\n- UI may show error to user (HTTP 432 in some cases)\n- Template eventually becomes Ready after background processing\n\n\n**Impact**\n\n- User confusion: User sees error but upload actually worked\n- Duplicate uploads: User may retry, creating duplicate templates\n- Wasted time: User troubleshoots non-existent problem\n\n\n**Root Cause Analysis**\nThe IllegalReferenceCountException occurs in `HttpUploadServerHandler.channelUnregistered()` when trying to destroy the `HttpPostRequestDecoder`. The decoder's reference count has already reached 0, indicating it was already released elsewhere.\nThis is a reference counting bug in the Netty upload handler - the decoder is being released twice:\n\n- Once during normal processing\n- Again in `channelUnregistered()` cleanup\n\n**Evidence**\n\nBrowser Network Tab - Upload Succeeded (HTTP 200)\nRequest Headers (all correct):\n\n```\nX-Expires: 2026-01-21T16:46:06.391Z\nX-Metadata: 7d9tasmSFbD/i/a+7cIPVHUKLB5oZUTfHOf6nIwEo6gdgJ1IHcgXfSHe1TouKFGRARpVRJJyyfVX5fqGcsv14oYurocRB4KGOkuW6zfW3GZC3hxhM2vA5OjK5Q497cxlc/TkgD/BOYoyx3VS32w4jFFxfVty9YSrc2tx1/bo9kE4MFXbFiuGNHI799xK8WhEXiTuR/7iyxRqLM17+ql/JYxlPLSP7DWbVOMFwm7HACbmSSaUNyJhi2OiaOmmU0TC5jpezvLxXhVmDsl9Fe9/uhTG2PDtmd/d2L+QtQz8+zNqxwgrS8EJqJKsk7q7tPzoDFKWc7Qp0uYpPvMqpyd377kXA2qhKnphEKrB6rBvIHV0OaX071UMNSysfrYC+GOIi3smUK6p5x939GlNlVFI6kYM5pkVZ9AsuNzGii4SMDZc8UGYrYmhazT10+ye0IlAVw5cFu5hcwVmeGnK8O2xDQkHo1z5wFYxiqCzZSuVdrhk0jdV0ktZ0CAcQeZzjBblu4DWFCcdqRDHl+8SkeAwtUjV3ZDht0u4D1lQdgV4G/NeDPCPhkm61WhKcR4AHvq5pb1+bs9h/8+b2BkuhfNbdNCd/gjW2kMsl4KcbhQwB+3uQsxZ9srg+hKacPB2Cyd8kgdLzuC4zYBq8mv8pRg4gpj5fbVC5Vs7pYbzpDlfoeIAuCZS7pDJM4Jontlae/QoGGo5\nX-Signature: zw+vnaAEiYNsjUfHov44KNZ/GBw=\nContent-Length: 400621794\n```\n\n- Response:\n\n```\nStatus Code: 200 OK\nBody: upload successful.\n```\n\n- SSVM Logs (/var/log/cloud.log) - Upload Received and Processed\n\n```\n2026-01-21T15:46:06,551 INFO  [storage.resource.HttpUploadServerHandler] (nioEventLoopGroup-3-6:[]) HEADER: SIGNATURE=zw+vnaAEiYNsjUfHov44KNZ/GBw=\n2026-01-21T15:46:06,552 INFO  [storage.resource.HttpUploadServerHandler] (nioEventLoopGroup-3-6:[]) HEADER: METADATA=7d9tasmSFbD/i/a+7cIPVHUKLB5oZUT...\n2026-01-21T15:46:06,552 INFO  [storage.resource.HttpUploadServerHandler] (nioEventLoopGroup-3-6:[]) HEADER: EXPIRES=2026-01-21T16:46:06.391Z\n2026-01-21T15:46:06,552 INFO  [storage.resource.HttpUploadServerHandler] (nioEventLoopGroup-3-6:[]) HEADER: HOST=10.0.56.181\n2026-01-21T15:46:06,553 INFO  [storage.resource.HttpUploadServerHandler] (nioEventLoopGroup-3-6:[]) HEADER: CONTENT_LENGTH=400621794\n2026-01-21T15:46:06,554 INFO  [storage.resource.HttpUploadServerHandler] (nioEventLoopGroup-3-6:[]) URI: uuid=6c80606a-8826-460f-88a8-c15ed3606a6c\n2026-01-21T15:46:06,555 INFO  [storage.resource.HttpUploadServerHandler] (nioEventLoopGroup-3-6:[]) base directory: /mnt/SecStorage/5f75abe3-3803-3595-89ad-52d23b3dea97/template/tmpl/2/203\n2026-01-21T15:46:06,611 INFO  [storage.resource.HttpUploadServerHandler] (nioEventLoopGroup-3-6:[]) BODY: FileUpload: name=\"file\"; filename=\"linux-debian-11-x86_64-gen2-v1.qcow2\"\n```\n\n- SSVM Logs - Netty Exception During Cleanup\n\n```\n2026-01-21T15:47:30,572 WARN  [storage.resource.HttpUploadServerHandler] (nioEventLoopGroup-3-6:[]) \nDecoder already destroyed \nio.netty.util.IllegalReferenceCountException: refCnt: 0, decrement: 1\n    at io.netty.util.internal.ReferenceCountUpdater.toLiveRealRefCnt(ReferenceCountUpdater.java:83)\n    at io.netty.util.internal.ReferenceCountUpdater.release(ReferenceCountUpdater.java:140)\n    at io.netty.util.AbstractReferenceCounted.release(AbstractReferenceCounted.java:79)\n    at io.netty.handler.codec.http.multipart.HttpPostRequestDecoder.destroy(HttpPostRequestDecoder.java:293)\n    at org.apache.cloudstack.storage.resource.HttpUploadServerHandler.channelUnregistered(HttpUploadServerHandler.java:169)\n```\n\n- File Successfully Written to SSVM\n\n```\nroot@s-1-VM:~# ls -la /mnt/SecStorage/5f75abe3-3803-3595-89ad-52d23b3dea97/template/tmpl/2/203/\ntotal 391236\ndrwxrwxrwx 2 root root        95 Jan 21  2026 .\ndrwxr-xr-x 3 root root        25 Jan 21  2026 ..\n-rw-rw-rw- 1 root root 400621568 Jan 21  2026 c620128e-31ef-31ec-a04a-24104a89fdf0.qcow2\n-rw-rw-rw- 1 root root       340 Jan 21  2026 template.properties\n```\n\n- Template Properties File Created\n\n```\nroot@s-1-VM:~# cat /mnt/SecStorage/5f75abe3-3803-3595-89ad-52d23b3dea97/template/tmpl/2/203/template.properties\n#\n#Wed Jan 21 15:47:30 UTC 2026\nuniquename=203-2-0cb72ddc-d73a-3f2c-9f1f-24af1d033391\nqcow2.filename=c620128e-31ef-31ec-a04a-24104a89fdf0.qcow2\nqcow2.virtualsize=5368709120\ndescription=test\nqcow2.size=400621568\nfilename=c620128e-31ef-31ec-a04a-24104a89fdf0.qcow2\nsize=400621568\npublic=true\nid=203\nhvm=true\nvirtualsize=5368709120\nqcow2=true\n```\n\n- Despite the error shown to the user, the template eventually became Ready:\n\n```\n{\n  \"id\": \"6c80606a-8826-460f-88a8-c15ed3606a6c\",\n  \"name\": \"Debian 11\",\n  \"isready\": true,\n  \"status\": \"Download Complete\",\n  \"downloaddetails\": [\n    {\n      \"datastore\": \"NFS://10.0.32.4/acs/secondary/ref-trl-10677-k-Mr8-rositsa-kyuchukova/ref-trl-10677-k-Mr8-rositsa-kyuchukova-sec1\",\n      \"downloadPercent\": \"100\",\n      \"downloadState\": \"DOWNLOADED\"\n    }\n  ],\n  \"physicalsize\": 400621568,\n  \"size\": 5368709120\n}\n```\n\n### What to do about it?\n\nIn H`ttpUploadServerHandler.java`, add a null check or try-catch around the decoder destruction in `channelUnregistered()`\n\n**Workaround**\n\nIgnore the error in the UI and wait - template will eventually become Ready\nRefresh the template list after a minute to see actual status","author":{"url":"https://github.com/RosiKyu","@type":"Person","name":"RosiKyu"},"datePublished":"2026-01-21T18:22:02.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/12489/cloudstack/issues/12489"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:5ff8bc69-89c2-08d9-cff4-81d0a5aa3156
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id8D06:3BEDBF:1119DD8:17B11A4:6A4DDE0A
html-safe-nonce0f33acfe461ebd763bc348b6ad4c0a26e3bc8ca81d65c27bcdc2bd4d04445143
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4RDA2OjNCRURCRjoxMTE5REQ4OjE3QjExQTQ6NkE0RERFMEEiLCJ2aXNpdG9yX2lkIjoiODU4ODEwMjg0NjA2NjMxODg1OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac4af57ffdb1545d66203efc2a29a617a419050763a38d14e15bb795ffb6af3e0d
hovercard-subject-tagissue:3839483924
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/apache/cloudstack/12489/issue_layout
twitter:imagehttps://opengraph.githubassets.com/80f611250c55fea9ce1ccc7098fcffdb160aeb53e744aae10e87ac692d94da8c/apache/cloudstack/issues/12489
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/80f611250c55fea9ce1ccc7098fcffdb160aeb53e744aae10e87ac692d94da8c/apache/cloudstack/issues/12489
og:image:altproblem Related Issue Related to #12486 Summary When uploading templates/ISOs from local file via the UI, the upload completes successfully on the SSVM (file is written to disk, SSVM returns HTTP 2...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernameRosiKyu
hostnamegithub.com
expected-hostnamegithub.com
None06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33
turbo-cache-controlno-preview
go-importgithub.com/apache/cloudstack git https://github.com/apache/cloudstack.git
octolytics-dimension-user_id47359
octolytics-dimension-user_loginapache
octolytics-dimension-repository_id9759448
octolytics-dimension-repository_nwoapache/cloudstack
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id9759448
octolytics-dimension-repository_network_root_nwoapache/cloudstack
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release1d344bdb7547fe6bca17a59bb2b8aac3dc9532a0
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/apache/cloudstack/issues/12489#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Fcloudstack%2Fissues%2F12489
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
GitHub Starshttps://stars.github.com
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://github.com/security/advanced-security
Copilot for BusinessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Fcloudstack%2Fissues%2F12489
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=apache%2Fcloudstack
Reloadhttps://github.com/apache/cloudstack/issues/12489
Reloadhttps://github.com/apache/cloudstack/issues/12489
Reloadhttps://github.com/apache/cloudstack/issues/12489
Please reload this pagehttps://github.com/apache/cloudstack/issues/12489
apache https://github.com/apache
cloudstackhttps://github.com/apache/cloudstack
Notifications https://github.com/login?return_to=%2Fapache%2Fcloudstack
Fork 1.3k https://github.com/login?return_to=%2Fapache%2Fcloudstack
Star 3k https://github.com/login?return_to=%2Fapache%2Fcloudstack
Code https://github.com/apache/cloudstack
Issues 536 https://github.com/apache/cloudstack/issues
Pull requests 268 https://github.com/apache/cloudstack/pulls
Discussions https://github.com/apache/cloudstack/discussions
Actions https://github.com/apache/cloudstack/actions
Projects https://github.com/apache/cloudstack/projects
Wiki https://github.com/apache/cloudstack/wiki
Security and quality 0 https://github.com/apache/cloudstack/security
Insights https://github.com/apache/cloudstack/pulse
Code https://github.com/apache/cloudstack
Issues https://github.com/apache/cloudstack/issues
Pull requests https://github.com/apache/cloudstack/pulls
Discussions https://github.com/apache/cloudstack/discussions
Actions https://github.com/apache/cloudstack/actions
Projects https://github.com/apache/cloudstack/projects
Wiki https://github.com/apache/cloudstack/wiki
Security and quality https://github.com/apache/cloudstack/security
Insights https://github.com/apache/cloudstack/pulse
Bughttps://github.com/apache/cloudstack/issues?q=type:"Bug"
Netty IllegalReferenceCountException causes false upload failure despite successful uploadhttps://github.com/apache/cloudstack/issues/12489#top
Severity:Minorhttps://github.com/apache/cloudstack/issues?q=state%3Aopen%20label%3A%22Severity%3AMinor%22
component:secondary-storagehttps://github.com/apache/cloudstack/issues?q=state%3Aopen%20label%3A%22component%3Asecondary-storage%22
component:ssvmhttps://github.com/apache/cloudstack/issues?q=state%3Aopen%20label%3A%22component%3Assvm%22
type:bughttps://github.com/apache/cloudstack/issues?q=state%3Aopen%20label%3A%22type%3Abug%22
4.20.4https://github.com/apache/cloudstack/milestone/45
https://github.com/RosiKyu
RosiKyuhttps://github.com/RosiKyu
on Jan 21, 2026https://github.com/apache/cloudstack/issues/12489#issue-3839483924
#12486https://github.com/apache/cloudstack/issues/12486
Severity:Minorhttps://github.com/apache/cloudstack/issues?q=state%3Aopen%20label%3A%22Severity%3AMinor%22
component:secondary-storagehttps://github.com/apache/cloudstack/issues?q=state%3Aopen%20label%3A%22component%3Asecondary-storage%22
component:ssvmhttps://github.com/apache/cloudstack/issues?q=state%3Aopen%20label%3A%22component%3Assvm%22
type:bughttps://github.com/apache/cloudstack/issues?q=state%3Aopen%20label%3A%22type%3Abug%22
Bughttps://github.com/apache/cloudstack/issues?q=type:"Bug"
Apache CloudStack BugFest - Issueshttps://github.com/orgs/apache/projects/362
4.20.4No due datehttps://github.com/apache/cloudstack/milestone/45
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.