Our database contains years out of the allowed offset

Hi @Gassim ,
I have the following error when running the


resources table under the admin function get the following error log
WARN 2023-10-19T10:52:53,206 Your database contains years out of the allowed offset.

Range of years allowed (based on your system settings and existing data): [2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024].

Years out of range found: [0, 1, 2, 3, 4, 5, 10, 66, 1919, 1970, 2215, 20172, 20173, 20174, 20175, 20176, 20177]. (DefaultResourceTableService.java [taskScheduler-13]) UID:stI566T43u4

  • ERROR 2023-10-19T10:52:53,207 Your database contains years out of the allowed offset.

Range of years allowed (based on your system settings and existing data): [2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024].

Years out of range found: [0, 1, 2, 3, 4, 5, 10, 66, 1919, 1970, 2215, 20172, 20173, 20174, 20175, 20176, 20177]. (NotificationLoggerUtil.java [taskScheduler-13]) UID:stI566T43u4

  • ERROR 2023-10-19T10:52:53,208 [RESOURCE_TABLE stI566T43u4] Item failed after 7.556s: Your database contains years out of the allowed offset.

Range of years allowed (based on your system settings and existing data): [2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024].

Years out of range found: [0, 1, 2, 3, 4, 5, 10, 66, 1919, 1970, 2215, 20172, 20173, 20174, 20175, 20176, 20177]. (ControlledJobProgress.java [taskScheduler-13]) UID:stI566T43u4

java.lang.RuntimeException: Your database contains years out of the allowed offset.

Range of years allowed (based on your system settings and existing data): [2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023, 2024].

Years out of range found: [0, 1, 2, 3, 4, 5, 10, 66, 1919, 1970, 2215, 20172, 20173, 20174, 20175, 20176, 20177].

at org.hisp.dhis.resourcetable.DefaultResourceTableService.checkYearsOffset(DefaultResourceTableService.java:228) ~[dhis-service-administration-2.39.3.jar:?]

at org.hisp.dhis.resourcetable.DefaultResourceTableService.generateDatePeriodTable(DefaultResourceTableService.java:187) ~[dhis-service-administration-2.39.3.jar:?]

at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]

at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]

at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]

at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]

at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344) ~[spring-aop-5.3.30.jar:5.3.30]

at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:234) ~[spring-aop-5.3.30.jar:5.3.30]

at com.sun.proxy.$Proxy365.generateDatePeriodTable(Unknown Source) ~[?:?]

at org.hisp.dhis.scheduling.JobProgress.lambda$runStage$1(JobProgress.java:227) ~[dhis-api-2.39.3.jar:?]

at org.hisp.dhis.scheduling.JobProgress.lambda$runStage$3(JobProgress.java:282) ~[dhis-api-2.39.3.jar:?]

at org.hisp.dhis.scheduling.JobProgress.runStage(JobProgress.java:325) ~[dhis-api-2.39.3.jar:?]

at org.hisp.dhis.scheduling.JobProgress.runStage(JobProgress.java:277) ~[dhis-api-2.39.3.jar:?]

at org.hisp.dhis.scheduling.JobProgress.runStage(JobProgress.java:252) ~[dhis-api-2.39.3.jar:?]

at org.hisp.dhis.scheduling.JobProgress.runStage(JobProgress.java:242) ~[dhis-api-2.39.3.jar:?]

at org.hisp.dhis.scheduling.JobProgress.runStage(JobProgress.java:227) ~[dhis-api-2.39.3.jar:?]

at org.hisp.dhis.analytics.table.DefaultAnalyticsTableGenerator.generateResourceTablesInternal(DefaultAnalyticsTableGenerator.java:182) ~[dhis-service-analytics-2.39.3.jar:?]

at org.hisp.dhis.analytics.table.DefaultAnalyticsTableGenerator.generateResourceTables(DefaultAnalyticsTableGenerator.java:138) ~[dhis-service-analytics-2.39.3.jar:?]

at org.hisp.dhis.analytics.table.scheduling.ResourceTableJob.execute(ResourceTableJob.java:59) ~[dhis-service-analytics-2.39.3.jar:?]

at org.hisp.dhis.scheduling.AbstractSchedulingManager.execute(AbstractSchedulingManager.java:255) ~[dhis-service-core-2.39.3.jar:?]

at org.hisp.dhis.scheduling.DefaultSchedulingManager.lambda$executeNow$4(DefaultSchedulingManager.java:189) ~[dhis-service-core-2.39.3.jar:?]

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]

at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]

at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54) [spring-context-5.3.30.jar:5.3.30]

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]

at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]

at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]

at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]

at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]

at java.lang.Thread.run(Thread.java:829) [?:?]
  • ERROR 2023-10-19T10:52:53,209 skipped stage. 9 successful and 1 failed items (NotificationLoggerUtil.java [taskScheduler-13]) UID:stI566T43u4

  • ERROR 2023-10-19T10:52:53,209 [RESOURCE_TABLE stI566T43u4] Stage failed after 26.232s: skipped stage. 9 successful and 1 failed items (ControlledJobProgress.java [taskScheduler-13]) UID:stI566T43u4

Best regards

Hi @Beruck

It seems there are corrupted values in the database which are thought of as years. This has happened before and the proposed solution was to check the values/tables in the database. The clues here are the UIDs that you can see in the log such as stI566T43u4.

Hi @Gassim ,
what does that UID refer to? can you explain to me how to find this UID:stI566T43u4?

1 Like

Hi @Beruck

Apologies, I checked the log again and it seems the UID is for the process/job, but you’d have to either search in the Maintenance app or using PG Admin for the metadata that’s causing this issue. The error relates to getOrganisationUnitsViolatingExclusiveGroupSets so could you check that the OU groups and OU group sets, follow these two rules mentioned in the docs:

  • An organisation unit can only be a member of a single organisation unit group within an organisation unit group set.
  • An organisation unit group can be part of multiple organisation unit group sets.

Thanks! And sorry if the UID suggestion caused any confusion, I thought it was referring to to the metadata (which would’ve been so helpful!)

Blockquote The error relates to getOrganisationUnitsViolatingExclusiveGroupSets so could you check that the OU groups and OU group sets, follow these two rules mentioned in the docs:

Hi @Gassim,
Your final response looks definite, thanks but I’m experiencing same problem when I run analytics. Did you arrive at this cause from a look into the error log. Or this has been the only cause of this kind of error. I am trying to find in the error log an element relating to orgunits violating exclusive groupsets but not finding any such error.

Hi @Quoda

Thank you for the input! Sometimes there could actually be more than one error in the log and could be more than one cause as well so it’s sort of a process to find a solution by eliminating each possible cause through fixing the possible issues that the errors indicate. For example, if @Beruck checks the OU groups and OU groups and that is fixed but the main issue still exists then we’ll need to look for the other errors and see what could still be causing it.

It could actually be helpful to compare between the logs, please feel free to share the log error (without sensitive/authentication info) from your instance.

Thanks!