René's URL Explorer Experiment


Title: Usage Server repeatedly reprocesses historical usage and creates duplicate cloud_usage records for usage_type=1 · Issue #13399 · apache/cloudstack · GitHub

Open Graph Title: Usage Server repeatedly reprocesses historical usage and creates duplicate cloud_usage records for usage_type=1 · Issue #13399 · apache/cloudstack

X Title: Usage Server repeatedly reprocesses historical usage and creates duplicate cloud_usage records for usage_type=1 · Issue #13399 · apache/cloudstack

Description: problem We are experiencing what appears to be the same issue described in #13112, however in our environment it affects usage_type = 1 (default VM usage) instead of the usage type reported in the original issue. The Usage Server repeate...

Open Graph Description: problem We are experiencing what appears to be the same issue described in #13112, however in our environment it affects usage_type = 1 (default VM usage) instead of the usage type reported in the ...

X Description: problem We are experiencing what appears to be the same issue described in #13112, however in our environment it affects usage_type = 1 (default VM usage) instead of the usage type reported in the ...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Usage Server repeatedly reprocesses historical usage and creates duplicate cloud_usage records for usage_type=1","articleBody":"### problem\n\nWe are experiencing what appears to be the same issue described in #13112, however in our environment it affects `usage_type = 1` (default VM usage) instead of the usage type reported in the original issue.\nThe Usage Server repeatedly reprocesses historical usage records from a fixed timestamp and continuously inserts duplicate records into the `cloud_usage` table.\n\n### **observed behaviour**\n\nThe Usage Server repeatedly processes the same historical records and generates duplicate rows in `cloud_usage`.\n\n* start date repeatedly reprocessed: `2026-05-29T22:00:00+0200`\n\n### **relation to #13112**\n\nThis issue appears very similar to #13112.\n\nDifferences:\n\n* #13112 reported the problem for usage_type = `13`\n* We observe the same behaviour for usage_type = `1`\n* The issue was reported as fixed in a later CloudStack release by the original Poster, however we are running `4.22.1.0` which is newer than the reported version.\n\nBecause the symptoms are effectively identical, it indicates that the issue still persists in newer versions.\n\n### **evidence**\n\nRelevant Usage Server logs:\n\nDuring the period where duplicate usage records are generated, the Usage Server repeatedly processes historical time ranges and emits SQL integrity constraint violations.\nA log snippet is attached. VM and account names have been redacted from the logs for data protection purposes. \n\n[_usage.2026-05-28.log](https://github.com/user-attachments/files/28835661/_usage.2026-05-28.log)\n\nA representative example is shown below:\n`2026-05-29 23:15:00,005 INFO Parsing usage records between [2026-05-29T20:00:00+0000] and [2026-05-29T20:59:59+0000]\nERROR: Duplicate entry '570-2026-05-29 20:50:40' for key 'id' java.sql.SQLIntegrityConstraintViolationException\nWARN: Failed to create usage event id: 1703940 type: VOLUME.CREATE due to Entity already exists`\nThe exception indicates that the Usage Server is attempting to insert records that already exist. This appears to coincide with the repeated processing of historical usage intervals and the continuous growth of duplicate usage records described above.\n\nTo quantify the issue, we wrote a Python script that hashes usage records and counts identical entries for a single virtual machine grouped by hour.\nThe expected result is exactly one record per hourly interval (`count = 1`).\nThis expectation is met until `2026-05-29 22:00`, after which duplicate records begin appearing. The duplication follows a distinct pattern:\n\n* `2026-05-29 22:00` → 204 identical records\n* `2026-05-29 23:00` → 203 identical records\n* `2026-05-30 00:00` → 202 identical records\n* `2026-05-30 01:00` → 201 identical records\n\nThe pattern continues with each subsequent hourly bucket containing one fewer duplicate than the previous bucket.\nThis suggests that historical usage intervals are being repeatedly regenerated or reprocessed by the Usage Server. While the total number of records continues to increase over time, the number of duplicates associated with each successive hourly interval decreases by one.\nExample output for a single VM:\n\n`{`\\\n`  \"2026-05-29\": {`\\\n`    \"21\": 1,`\\\n`    \"22\": 204,`\\\n`    \"23\": 203`\\\n`  },`\\\n`  \"2026-05-30\": {`\\\n`    \"00\": 202,`\\\n`    \"01\": 201,`\\\n`    \"02\": 200,`\\\n`    \"03\": 199`\\\n`  }`\\\n`}`\n\n### versions\n\nOS: `Ubuntu 24.04.4 LTS`\nHypervisor: KVM, `libvirt 10.0.0-2ubuntu8.13`\nDatabase: `MariaDB 10.11.14-MariaDB-0ubuntu0.24.04.1-log Ubuntu 24.04`\nCloudStack: `4.22.1.0`\n\n### The steps to reproduce the bug\n\nThe exact trigger is currently unknown. In our environment, the issue can be observed with the following setup:\n\n1. Enable the Usage Server in Apache CloudStack.\n2. Configure:\n   - `usage.stats.job.aggregation.range = 60`\n   - `usage.stats.job.exec.time = 00:15`\n3. Allow the Usage Server to run normally for an extended period.\n4. Observe the `cloud_usage` table and Usage Server logs.\n5. Duplicate usage records begin appearing and continue to accumulate over time.\n\n### What to do about it?\n\nOne observation that might be relevant, is a start-timestamp on 2026-05-29 at 20:00:14 (UTC). This is the only differing usage record. All other duplicates are exactly the same (within VM, day and hour) and their start-timestamps are all for second \"00\". Without knowing the actual contexts, it does look as if this one existing usage record for second \"14\" kind of congests the system now. Meaning the server did create an entry for second \"14\". At the same time it tried to create an entry for second \"00\". This failed due to the constraint-violation by having the same ID as the entry for second \"14\". This is observable in the logs.\n\nStarting the following hour the system is indeed creating entries for all subsequent usage records including the one for the timestamp in question. But somehow maybe because of this one \"failed\" entry, the system does not recognize all subsequently created entries as valid/processed and recreates all of them again every hour.","author":{"url":"https://github.com/mwa-sudo","@type":"Person","name":"mwa-sudo"},"datePublished":"2026-06-11T11:14:10.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/13399/cloudstack/issues/13399"}

route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:e275c000-893a-0fac-1afd-ed9ebd80022a
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE40C:2C9E7F:D377B1:11CD4CC:6A4D49A9
html-safe-nonce5dcf5dba01c956fdf543ee221175f493c2954f7696c0ce812514a656e3121b84
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNDBDOjJDOUU3RjpEMzc3QjE6MTFDRDRDQzo2QTRENDlBOSIsInZpc2l0b3JfaWQiOiI0Njg2MDk0MDA4MjAyODc5MTMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmac400997d8d1469857d64463456f1579820c956cd8abd1a4ebd52deb8a37544237
hovercard-subject-tagissue:4639868405
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/13399/issue_layout
twitter:imagehttps://opengraph.githubassets.com/d21cb0c2dbaad069dbebff903ecf61f83174a3da37b6cee7ab6b81d86b44173c/apache/cloudstack/issues/13399
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d21cb0c2dbaad069dbebff903ecf61f83174a3da37b6cee7ab6b81d86b44173c/apache/cloudstack/issues/13399
og:image:altproblem We are experiencing what appears to be the same issue described in #13112, however in our environment it affects usage_type = 1 (default VM usage) instead of the usage type reported in the ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamemwa-sudo
hostnamegithub.com
expected-hostnamegithub.com
None92571a8944142227b7e19cd10918b1ddd06e5066c1ad5bc7e4769cf6140a87e6
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
release56fc8347865a14e2ec811533d68f929cf4e0ec19
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/apache/cloudstack/issues/13399#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fapache%2Fcloudstack%2Fissues%2F13399
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%2F13399
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/13399
Reloadhttps://github.com/apache/cloudstack/issues/13399
Reloadhttps://github.com/apache/cloudstack/issues/13399
Please reload this pagehttps://github.com/apache/cloudstack/issues/13399
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 535 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"
Usage Server repeatedly reprocesses historical usage and creates duplicate cloud_usage records for usage_type=1https://github.com/apache/cloudstack/issues/13399#top
4.20.4https://github.com/apache/cloudstack/milestone/45
https://github.com/mwa-sudo
mwa-sudohttps://github.com/mwa-sudo
on Jun 11, 2026https://github.com/apache/cloudstack/issues/13399#issue-4639868405
#13112https://github.com/apache/cloudstack/issues/13112
#13112https://github.com/apache/cloudstack/issues/13112
#13112https://github.com/apache/cloudstack/issues/13112
Apache CloudStack Usage Server repeatedly reprocesses historical usage from fixed start date and creates duplicate cloud_usage records #13112https://github.com/apache/cloudstack/issues/13112
_usage.2026-05-28.loghttps://github.com/user-attachments/files/28835661/_usage.2026-05-28.log
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.