You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by GitBox <gi...@apache.org> on 2021/10/19 12:08:08 UTC
[GitHub] [cloudstack] dredknight opened a new issue #5587: Usage server is not collecting data
dredknight opened a new issue #5587:
URL: https://github.com/apache/cloudstack/issues/5587
<!--
Verify first that your issue/request is not already reported on GitHub.
Also test if the latest release and main branch are affected too.
Always add information AFTER of these HTML comments, but no need to delete the comments.
-->
##### ISSUE TYPE
<!-- Pick one below and delete the rest -->
* Bug Report
##### COMPONENT NAME
<!--
Categorize the issue, e.g. API, VR, VPN, UI, etc.
-->
~~~
Usage server
~~~
##### CLOUDSTACK VERSION
<!--
New line separated list of affected versions, commit ID for issues on main branch.
-->
4.15.0
4.15.2
~~~
~~~
##### CONFIGURATION
<!--
Information about the configuration if relevant, e.g. basic network, advanced networking, etc. N/A otherwise
-->
N/A
##### OS / ENVIRONMENT
<!--
Information about the environment if relevant, N/A otherwise
-->
N/A
##### SUMMARY
<!-- Explain the problem/feature briefly -->
Usage server is active since 04.2021 but from the database it can be seen in cloud_usage table that there is data only for the period between 2021-04-22 23:59:59 and 2021-05-19 23:59:59 and nothing since.
/var/log/cloudstack/usage.log constantly reports this error and warning messages
`2021-10-19 13:33:40,184 INFO [cloud.usage.UsageManagerImpl] (Usage-Job-1:null) (logid:) starting usage job...
2021-10-19 13:33:40,315 INFO [cloud.usage.UsageManagerImpl] (Usage-Job-1:null) (logid:) Parsing usage records between Thu May 20 02:00:00 CEST 2021 and Tue Oct 19 01:59:59 CEST 2021
2021-10-19 13:37:57,870 DEBUG [cloud.usage.UsageManagerImpl] (Usage-Job-1:null) (logid:) assigning ip address: 10.10.179.184 to account: 29
2021-10-19 13:37:57,876 ERROR [cloud.usage.UsageManagerImpl] (Usage-Job-1:null) (logid:) Exception in usage manager
java.lang.NullPointerException
at com.cloud.usage.UsageManagerImpl.createIPHelperEvent(UsageManagerImpl.java:1423)
at com.cloud.usage.UsageManagerImpl.createHelperRecord(UsageManagerImpl.java:987)
at com.cloud.usage.UsageManagerImpl.parse(UsageManagerImpl.java:649)
at com.cloud.usage.UsageManagerImpl.runInContextInternal(UsageManagerImpl.java:405)
at com.cloud.usage.UsageManagerImpl$1.runInContext(UsageManagerImpl.java:347)
at org.apache.cloudstack.managed.context.ManagedContextRunnable$1.run(ManagedContextRunnable.java:48)
at org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(DefaultManagedContext.java:55)
at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithContext(DefaultManagedContext.java:102)
at org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithContext(DefaultManagedContext.java:52)
at org.apache.cloudstack.managed.context.ManagedContextRunnable.run(ManagedContextRunnable.java:45)
at com.cloud.usage.UsageManagerImpl.run(UsageManagerImpl.java:349)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
2021-10-19 13:37:57,878 DEBUG [db.Transaction.Transaction] (Usage-Job-1:null) (logid:) Rolling back the transaction: Time = 11 Name = -UsageManagerImpl.parse:631-UsageManagerImpl.runInContextInternal:405-UsageManagerImpl$1.runInContext:347-ManagedContextRunnable$1.run:48-DefaultManagedContext$1.call:55-DefaultManagedContext.callWithContext:102-DefaultManagedContext.runWithContext:52-ManagedContextRunnable.run:45-UsageManagerImpl.run:349-Executors$RunnableAdapter.call:515-FutureTask.run:264-ScheduledThreadPoolExecutor$ScheduledFutureTask.run:304; called by -TransactionLegacy.rollback:888-UsageManagerImpl.parse:849-UsageManagerImpl.runInContextInternal:405-UsageManagerImpl$1.runInContext:347-ManagedContextRunnable$1.run:48-DefaultManagedContext$1.call:55-DefaultManagedContext.callWithContext:102-DefaultManagedContext.runWithContext:52-ManagedContextRunnable.run:45-UsageManagerImpl.run:349-Executors$RunnableAdapter.call:515-FutureTask.run:264
2021-10-19 13:37:57,950 WARN [db.Transaction.Transaction] (Usage-Job-1:null) (logid:) txn: Commit called when it is not a transaction: -UsageManagerImpl.parse:858-UsageManagerImpl.runInContextInternal:405-UsageManagerImpl$1.runInContext:347-ManagedContextRunnable$1.run:48-DefaultManagedContext$1.call:55-DefaultManagedContext.callWithContext:102-DefaultManagedContext.runWithContext:52-ManagedContextRunnable.run:45-UsageManagerImpl.run:349-Executors$RunnableAdapter.call:515-FutureTask.run:264-ScheduledThreadPoolExecutor$ScheduledFutureTask.run:304
2021-10-19 13:37:57,950 WARN [apache.cloudstack.alerts] (Usage-Job-1:null) (logid:) alertType:: 20 // dataCenterId:: 0 // podId:: 0 // clusterId:: null // message:: Usage job failed. Job id: 250841
2021-10-19 13:37:57,970 DEBUG [cloud.usage.UsageAlertManagerImpl] (Usage-Job-1:null) (logid:) Have already sent: 1 emails for alert type '20' -- skipping send email
2021-10-19 13:37:57,970 INFO [cloud.usage.UsageManagerImpl] (Usage-Job-1:null) (logid:) usage job complete
`
Full log is attached here: [usage.log](https://github.com/apache/cloudstack/files/7373049/usage.log)
##### STEPS TO REPRODUCE
<!--
For bugs, show exactly how to reproduce the problem, using a minimal test-case. Use Screenshots if accurate.
For new features, show how the feature would be used.
-->
<!-- Paste example playbooks or commands between quotes below -->
~~~
I don't know. Nothing was done out of the ordinary. Usage server was installed and enabled.
~~~
<!-- You can also paste gist.github.com links for larger files -->
##### EXPECTED RESULTS
<!-- What did you expect to happen when running the steps above? -->
~~~
Usage server to collect all data.
~~~
##### ACTUAL RESULTS
<!-- What actually happened? -->
<!-- Paste verbatim command output between quotes below -->
~~~
Usage does not collect all data.
~~~
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] weizhouapache commented on issue #5587: Usage server is not collecting data
Posted by GitBox <gi...@apache.org>.
weizhouapache commented on issue #5587:
URL: https://github.com/apache/cloudstack/issues/5587#issuecomment-946668812
@dredknight
could you please check database if account id=29 is removed ?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] dredknight edited a comment on issue #5587: Usage server is not collecting data
Posted by GitBox <gi...@apache.org>.
dredknight edited a comment on issue #5587:
URL: https://github.com/apache/cloudstack/issues/5587#issuecomment-946671875
@weizhouapache - yes such account ID does not exist both in CLOUD and CLOUD_USAGE database
I remember at the time the issue may have occurred I was playing with accounts and domains and was deleting and recreating such.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] weizhouapache commented on issue #5587: Usage server is not collecting data
Posted by GitBox <gi...@apache.org>.
weizhouapache commented on issue #5587:
URL: https://github.com/apache/cloudstack/issues/5587#issuecomment-947400437
@dredknight
you might be able to find the account with id=29 in cloud_usage.account table.
If so, you can insert record into cloud.account table with same value by manual DB change.
for example, `insert into cloud.account values (29, xxx,xxx......)`.
Do NOT remove records from cloudstack database which will lead to unexpected results.
`account` table has a column `removed`, you could update it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] weizhouapache closed issue #5587: Usage server is not collecting data
Posted by GitBox <gi...@apache.org>.
weizhouapache closed issue #5587:
URL: https://github.com/apache/cloudstack/issues/5587
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] dredknight commented on issue #5587: Usage server is not collecting data
Posted by GitBox <gi...@apache.org>.
dredknight commented on issue #5587:
URL: https://github.com/apache/cloudstack/issues/5587#issuecomment-946960371
I never touched accounts manually in **cloud_usage** DB.
Manual deletions were done only in **cloud** DB. I will test and let you know.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] dredknight edited a comment on issue #5587: Usage server is not collecting data
Posted by GitBox <gi...@apache.org>.
dredknight edited a comment on issue #5587:
URL: https://github.com/apache/cloudstack/issues/5587#issuecomment-946960371
No manual changes were done in **cloud_usage** DB.
But manual deletions in term of domains and accounts were done in **cloud** DB.
I will test and let you know.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] dredknight removed a comment on issue #5587: Usage server is not collecting data
Posted by GitBox <gi...@apache.org>.
dredknight removed a comment on issue #5587:
URL: https://github.com/apache/cloudstack/issues/5587#issuecomment-947389787
Do you have any tip on how to create account with this ID safely?
I created new account from GUI and tried to change the ID from the DB but it seems it is bound to some other tables so it wont allow me.
`Reason:
SQL Error [1451] [23000]: (conn=12049652) Cannot delete or update a parent row: a foreign key constraint fails (`cloud`.`resource_count`, CONSTRAINT `fk_resource_count__account_id` FOREIGN KEY (`account_id`) REFERENCES `account` (`id`) ON DELETE CASCADE)`
As alternative i don't mind resetting the whole usage server database if that will help. Just let me know how to do it, if possible.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] weizhouapache commented on issue #5587: Usage server is not collecting data
Posted by GitBox <gi...@apache.org>.
weizhouapache commented on issue #5587:
URL: https://github.com/apache/cloudstack/issues/5587#issuecomment-946804548
> @weizhouapache - yes such account ID does not exist both in CLOUD and CLOUD_USAGE database I remember at the time the issue may have occurred I was playing with accounts and domains and was deleting and recreating such.
@dredknight
you should not remove any account from cloudstack db.
You need to add back the account (with id=29) to cloud and cloud_usage database manually.
I think it is not a bug.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] dredknight commented on issue #5587: Usage server is not collecting data
Posted by GitBox <gi...@apache.org>.
dredknight commented on issue #5587:
URL: https://github.com/apache/cloudstack/issues/5587#issuecomment-946671875
@weizhouapache - yes such account ID does not exist both in CLOUD and CLOUD_USAGE database
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] dredknight commented on issue #5587: Usage server is not collecting data
Posted by GitBox <gi...@apache.org>.
dredknight commented on issue #5587:
URL: https://github.com/apache/cloudstack/issues/5587#issuecomment-947419819
Updating the DB fixed the issue. Usage server interpreted all the stored events and performance data is available.
Thank you for your help 👍 !
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] dredknight edited a comment on issue #5587: Usage server is not collecting data
Posted by GitBox <gi...@apache.org>.
dredknight edited a comment on issue #5587:
URL: https://github.com/apache/cloudstack/issues/5587#issuecomment-946671875
@weizhouapache - yes such account ID does not exist both in CLOUD and CLOUD_USAGE database
I remember at the time I was playing with accounts and domains and was deleting and recreating such.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [cloudstack] dredknight commented on issue #5587: Usage server is not collecting data
Posted by GitBox <gi...@apache.org>.
dredknight commented on issue #5587:
URL: https://github.com/apache/cloudstack/issues/5587#issuecomment-947389787
Do you have any tip on how to create account with this ID safely?
I created new account from GUI and tried to change the ID from the DB but it seems it is bound to some other tables so it wont allow me.
`Reason:
SQL Error [1451] [23000]: (conn=12049652) Cannot delete or update a parent row: a foreign key constraint fails (`cloud`.`resource_count`, CONSTRAINT `fk_resource_count__account_id` FOREIGN KEY (`account_id`) REFERENCES `account` (`id`) ON DELETE CASCADE)`
As alternative i don't mind resetting the whole usage server database if that will help. Just let me know how to do it, if possible.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org