Improve investigation while encoutering a MathIllegalStateException

Thanks you both @sdinot @evan.ward !
I will know all that for the next time :wink:

We also have a contributing guide :slight_smile:

1 Like

I have followed the steps from contribution guide.

Now my branch is created but still failing:

There has been a timeout failure or the job got stuck. Check your timeout limits or try again

Do you have access to more details ?

Hi @Anne-Laure

On your fork it’s normal. It’s because by default Orekit’s forks are not connected to the Continuous Integration worker.

I know that it’s possible to connect it to the worker, but we need the intervention of our Gitlab expert @sdinot :slight_smile:


Oups,I’m really sorry, I had completely missed the rest of this exchange. When I don’t answer, don’t hesitate to ask me again!

I just allowed your clone to use one of our runners.

And I am back… after few weeks again… Sorry!

I have rebased my branch on develop to be up to date.
I have completed the MISSING TRANSLATION in all language files.
I have replaced the embed exception with supressed exception as you requested, now the trace is :

org.orekit.errors.OrekitException: maximal count (5) exceeded
	at org.orekit.errors.OrekitException.unwrap(
	at org.orekit.propagation.analytical.AbstractAnalyticalPropagator.propagate(
	at org.orekit.propagation.AbstractPropagator.propagate(
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
	at java.lang.reflect.Method.invoke(
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(
	at org.junit.internal.runners.statements.RunBefores.evaluate(
	at org.junit.runners.ParentRunner$3.evaluate(
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(
	at org.junit.runners.ParentRunner.runLeaf(
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(
	at org.junit.runners.ParentRunner$
	at org.junit.runners.ParentRunner$1.schedule(
	at org.junit.runners.ParentRunner.runChildren(
	at org.junit.runners.ParentRunner.access$100(
	at org.junit.runners.ParentRunner$2.evaluate(
	at org.junit.runners.ParentRunner$3.evaluate(
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(
	at com.intellij.rt.junit.JUnitStarter.main(
Caused by: org.hipparchus.exception.MathIllegalStateException: maximal count (5) exceeded
	at org.hipparchus.util.Incrementor.lambda$static$0(
	at org.hipparchus.util.Incrementor.increment(
	at org.hipparchus.analysis.solvers.BaseAbstractUnivariateSolver.incrementEvaluationCount(
	at org.hipparchus.analysis.solvers.BaseAbstractUnivariateSolver.computeObjectiveValue(
	at org.hipparchus.analysis.solvers.BracketingNthOrderBrentSolver.doSolveInterval(
	at org.hipparchus.analysis.solvers.BracketingNthOrderBrentSolver.solveInterval(
	at org.hipparchus.analysis.solvers.BracketedUnivariateSolver.solveInterval(
	at org.orekit.propagation.analytical.AbstractAnalyticalPropagator.acceptStep(
	at org.orekit.propagation.analytical.AbstractAnalyticalPropagator.propagate(
	... 28 more
	Suppressed: org.orekit.errors.OrekitException: a-fake-detector failed to find root between 2011-05-11T00:00:00.000 (g=1.000e+00) and 2011-05-11T00:01:39.178 (g=-1.000e+00) : maximal count (5) exceeded
Last iteration at 2011-05-11T00:00:00.000 (g=1.000e+00)
		... 31 more
	[CIRCULAR REFERENCE:org.hipparchus.exception.MathIllegalStateException: maximal count (5) exceeded]

While running tests, I have found a duplicated message in the italian file so I fixed that in a separate commit (don’t know if it passes on develop?).

Thanks @sdinot for letting me use the gitlab pipeline, it helped a lot!
Still, my branch is failure because it can not execute sonar, maybe because I am on a fork ?

I don’t know if this could be merged before 11.0 release ? I have seen that it is in discussion…

Best regards,


You are welcome!

You are right, but here is how to solve this problem:

  1. Connect to our SonarQube instance using your Gitlab account.
  2. The first time you log in, SonarQube will prompt you to generate a token. Generate it and keep it safe on your workstation. If you did not do so the first time you logged in, you can do so later by going to your account settings on SonarQube: My account → Security → Generate Tokens
  3. Then connect to Gitlab.
  4. Go to the continuous integration (CI) configuration page of your fork (Settings → CI/CD → Variables → Expand) and declare a variable named SONAR_TOKEN. The value of this variable must be the value of the token provided by SonarQube. Check the “Mask variable” option and click on “Add variable”.
  5. SonarQube dynamically initiates the project on the first submission, but the first submission must be on the master branch. You can cause this by manually triggering a pipeline:
    • Once Orekit version 11 has been released (and its code pushed to master), all you will have to do will be follow this path: Project home page → CI/CD → Pipelines → Run pipeline → Select master branch → Run pipeline → Wait half an hour :wink:
    • While waiting for the release of Orekit version 11, you need to perform one more step, just before launching the pipeline: You have to override (in the web interface of Gitlab) the definition of the MAVEN_CLI_OPTS variable (defined in the CI script). Just before clicking on the final “Run pipeline”, state that MAVEN_CLI_OPTS variable value is:
      -s .CI/maven-settings.xml --batch-mode --errors --fail-at-end --show-version -DinstallAtEnd=true -DdeployAtEnd=true -Dsonar.projectKey="Anne-Laure/orekit" -Dsonar.projectName="Orekit (Anne-Laure/orekit)"
      In fact, this is the default value of the MAVEN_CLI_OPTS variable, increased by the following parameters:
      -Dsonar.projectKey="Anne-Laure/orekit" -Dsonar.projectName="Orekit (Anne-Laure/orekit)"
      Then, run the pipeline and wait half an hour.
  6. After that, you can run again the pipeline on your working branch. But if your working branch was created from master or release-10.3 branches, you have to override the MAVEN_CLI_OPTS variable as on the master branch.


1 Like


Thank you for your advice. I have followed the first steps.

I have tried to run master at the moment and it worked (with simple quote).
Still my branch is RED after that maybe because I need to wait for 11.0 release ?
@sdinot Do I understand well that I could not run sonar on my branch until 11.0 is released ?

Best regards,


We would be very happy to include this contribution in the 11.0 release.

Sorry, but I am afraid that the workaround I provided does not work because of the following command line in the CI script. :frowning:

    - mvn $MAVEN_CLI_OPTS sonar:sonar -Dsonar.login=${SONAR_TOKEN}${CI_COMMIT_REF_NAME}

In fact, the initial submission should not specify a branch while the above command does. So you have no choice but to initiate this first solution from your workstation:

cd orekit-repository
git switch master

export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64

mvn -s .CI/maven-settings.xml --batch-mode --errors --fail-at-end \
    --show-version -DinstallAtEnd=true -DdeployAtEnd=true verify site

export SONAR_TOKEN=<your-sonarqube-token>
export CI_PROJECT_TITLE=Orekit
export CI_PROJECT_NAMESPACE=<your-namespace>
export CI_PROJECT_NAME=orekit

mvn -s .CI/maven-settings.xml --batch-mode --errors --fail-at-end \
    --show-version -DinstallAtEnd=true -DdeployAtEnd=true sonar:sonar \
    -Dsonar.login=$SONAR_TOKEN -Dsonar.projectKey="$SONAR_PROJECT_KEY" \

Of course, this only works if Maven can connect to the Orekit SonarQube server from your workstation.

I apologize for the lost time, but in my defense, SonarQube is really a fussy software…

I know integration can be hard, even if I have never used Sonar, that’s totally fine!

As you quote, it does not work from my side as I am not connected to the network…

To sumup :

  • my branch would need the handy copy of @evan.ward as suggested above
  • Should I wait for this copy before requesting a merge ?
  • sonar did not execute : how we could solve that ? Is it possible to move this branch on the main repository ? Shall we merge blindly (my modifications are minor I think) ? I do not know what could be the best way to avoid or to succeed the sonar step ?

Best regards,


I think that I can initialize your project on SonarQube for you. Do you agree?

Since I had a little time to devote to this problem tonight and won’t have much tomorrow, I took the liberty of :

  • generate another token in SonarQube for you;
  • build Orekit on my workstation by initializing as I had indicated in a previous message some environment variables;
  • launch the quality analysis and push the result on SonarQube.

Here is the report.

And I just restarted the last failed pipeline on your working branch.

Here is the report on branch issue-797. I have filtered the issues to show only those assigned to you (but 150 issues are not assigned).

Thank you a lot @sdinot !!! And sorry that it bothered you late yesterday :roll_eyes:
I fixed 2 of the 4 errors found :+1: .

The other 2 are about “missing javadoc” in OrekitMessages. I have seen that this same error is also raised for others messages in the same file. I decided to let the code as it was, really similar to others. Hope that’s ok for you?

Best regards,


I am not a member of the development team. I’m just the guy who makes sure that people have the tools to make their lives easier and that they can contribute. :wink:

But many of the unassigned warnings are “missing Javadoc”, so I guess the team won’t be shocked if two such warnings appear in addition to the others. :slight_smile:

Hello everyone,

With the sonar fixed and all the merge request feedbacks taken into account… I think my branch could be ready for merge now ?! :blush:

Thank you a lot for your help and advices to all of you!
Really sorry it took me so long !
I learned a lot about contributing to Orekit and I will share this experience with my team very soon.

Best regards,

1 Like


I have second thoughts about the exception handling.

With the supresssed use, the detailed message does not appear on top/first.
Whereas with the caused by exception, the detailed message appears on top/first, especially it can be reached with e.getMessage() for any logging mechanism for example.

Also, I would think that it is more meaningful for a user that the exception is ‘caused by something else’ than it is “suppressed”.

Best regards,



That would be fine. The word “suppressed” doesn’t really describe the relationship between the two messages.

Best Regards,

1 Like