I think this is fixed by https://github.com/apache/cloudstack/pull/6825

Try to create that dir/file yourself until the fix makes it into Cloudstack.
mkdir -p /usr/local/libexec
echo 1 > /usr/local/libexec/sanity-check-last-id

On 2023-03-14 13:10, cristian.c@istream.today wrote:
Today I saw a strange error in the usage log:


2023-03-14 12:30:23,317 DEBUG [cloud.usage.UsageManagerImpl]
(Usage-Job-1:null) (logid:) processed Usage for 0 RECENTLY DELETED accts
2023-03-14 12:30:23,337 INFO  [cloud.usage.UsageManagerImpl]
(Usage-Job-1:null) (logid:) usage job complete
2023-03-14 12:30:23,337 INFO  [cloud.usage.UsageManagerImpl]
(Usage-Job-1:null) (logid:) starting usage job...
2023-03-14 12:30:23,339 INFO  [cloud.usage.UsageManagerImpl]
(Usage-Job-1:null) (logid:) not parsing usage records since start time mills
(1678795200000) is on or after end time
millis (1678795199999)
2023-03-14 12:30:23,343 INFO  [cloud.usage.UsageManagerImpl]
(Usage-Job-1:null) (logid:) usage job complete
2023-03-14 12:39:06,192 ERROR [cloud.usage.UsageSanityChecker]
(Usage-Sanity-1:null) (logid:)
readLastCheckId:Exception:/usr/local/libexec/sanity-check-last-id (No such
file or directory)
java.io.FileNotFoundException: /usr/local/libexec/sanity-check-last-id (No
such file or directory)
        at java.base/java.io.FileInputStream.open0(Native Method)
at java.base/java.io.FileInputStream.open(FileInputStream.java:219)
        at
java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
        at
java.base/java.io.FileInputStream.<init>(FileInputStream.java:112)
        at java.base/java.io.FileReader.<init>(FileReader.java:60)
        at
com.cloud.usage.UsageSanityChecker.readLastCheckId(UsageSanityChecker.java:1
73)
        at
com.cloud.usage.UsageSanityChecker.runSanityCheck(UsageSanityChecker.java:21
1)
        at
com.cloud.usage.UsageManagerImpl$SanityCheck.runInContext(UsageManagerImpl.j
ava:2161)
        at
org.apache.cloudstack.managed.context.ManagedContextRunnable$1.run(ManagedCo
ntextRunnable.java:48)
        at
org.apache.cloudstack.managed.context.impl.DefaultManagedContext$1.call(Defa
ultManagedContext.java:55)
        at
org.apache.cloudstack.managed.context.impl.DefaultManagedContext.callWithCon
text(DefaultManagedContext.java:102)
        at
org.apache.cloudstack.managed.context.impl.DefaultManagedContext.runWithCont
ext(DefaultManagedContext.java:52)
        at
org.apache.cloudstack.managed.context.ManagedContextRunnable.run(ManagedCont
extRunnable.java:45)
        at
java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java
:515)
        at
java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305)
        at
java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTa
sk.run(ScheduledThreadPoolExecutor.java:305)
        at
java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecut
or.java:1128)
        at
java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecu
tor.java:628)
        at java.base/java.lang.Thread.run(Thread.java:829)
2023-03-14 12:39:06,205 ERROR [cloud.usage.UsageSanityChecker]
(Usage-Sanity-1:null) (logid:) checkItemCountByPstmt:Exception:Parameter
index out of range (2 > number of parameters, which is 1).


Any idea why?

Regards,
Cristian

-----Original Message-----
From: cristian.c@istream.today <cristian.c@istream.today>
Sent: Monday, March 13, 2023 3:47 PM
To: users@cloudstack.apache.org
Subject: RE: cloud usage - Not owner of usage job, skipping

Hello,

    Just did this, looks like I had some jobs with null, removed and
restarted the suage fixed the issue.

Thank you,
Cristian

-----Original Message-----
From: Nux <n...@li.nux.ro>
Sent: Monday, March 13, 2023 2:26 PM
To: users@cloudstack.apache.org
Subject: Re: cloud usage - Not owner of usage job, skipping

Hello,

It's possible that due to an "unclean" shutdown there is probably a usage server running that is not having the same pid as the last scheduled job's
(the linux pid is used in the job schedule table).
To correct this, shut down the usage server and delete the last job (the one
that hasn't run yet).

HTH

On 2023-03-13 11:50, cristian.c@istream.today wrote:
Hello,





   I just found today that my cloud usage stopped to collect data from
2022, for sure is related to some upgrade, but it is quite impossible
to find out which one.  my question is, how can I fix this?  Can I
reset the cloudstack usage db? And start collection from today?

"Usage-HB-1:null) (logid:) it's been 17573256046 ms since last usage
job and
71243955 ms until next job, scheduling an immediate job to catch up
(aggregation duration is 1440 minutes)

2023-03-13 05:27:36,045 DEBUG [cloud.usage.UsageManagerImpl]
(Usage-HB-1:null) (logid:) Scheduling Usage job...

2023-03-13 05:27:36,046 INFO  [cloud.usage.UsageManagerImpl]
(Usage-Job-1:null) (logid:) starting usage job...

2023-03-13 05:27:36,048 DEBUG [cloud.usage.UsageManagerImpl]
(Usage-Job-1:null) (logid:) Not owner of usage job, skipping...

2023-03-13 05:27:36,048 INFO  [cloud.usage.UsageManagerImpl]
(Usage-Job-1:null) (logid:) usage job complete"


Thank you,

Cristian

Reply via email to