Strange error message

Issue #77 closed
Erik Schnetter created an issue

I received the following error message from SimFactory:

$ ./simfactory/sim sync mars Traceback (most recent call last): File "./simfactory/sim", line 158, in <module> SimEnvironment.initApp(usageString=buildUsageString(), optionGroups=optionGroups) File "/Users/eschnett/EinsteinToolkit-hg/simfactory/lib/simenv.py", line 71, in initApp self.LoadConfigurationDatabase() File "/Users/eschnett/EinsteinToolkit-hg/simfactory/lib/simenv.py", line 131, in LoadConfigurationDatabase self.ConfigurationDatabase.Load() File "/Users/eschnett/EinsteinToolkit-hg/simfactory/lib/simdb.py", line 78, in Load self.CheckSyntax() File "/Users/eschnett/EinsteinToolkit-hg/simfactory/lib/simdb.py", line 109, in CheckSyntax syntaxChecker.SyntaxCheck() File "/Users/eschnett/EinsteinToolkit-hg/simfactory/lib/pyini.py", line 357, in SyntaxCheck self.SyntaxError("required key %s in section %s is missing" % (skey, ini_section)) File "/Users/eschnett/EinsteinToolkit-hg/simfactory/lib/pyini.py", line 418, in SyntaxError dprint("Syntax error: %s" % (error)) File "/Users/eschnett/EinsteinToolkit-hg/simfactory/lib/libutil.py", line 22, in dprint lib = env.SimLib AttributeError: SimEnvironment instance has no attribute 'SimLib'

I assume I have an error in my local mdb for a machine called "Mars"; however, I don't see what key is missing or what error I have.

Keyword:

Comments (5)

  1. Ian Hinder
    • removed comment

    The same thing happened to me. I think it is happening whenever there is a syntax error in one of the configuration files. The dprint function which is supposed to print the error message is running into a missing SimLib instance, possibly because the error is being generated before the SimLib has been created (guessing here). You should be able to temporarily work around the problem by adding

    print statement

    to the dprint function (e.g. on line 20 of libutil.py). This will at least print the correct error message to the screen so you can see what is going on, until the problem with the error reporting is fixed.

  2. Erik Schnetter reporter
    • removed comment

    Thanks!

    That begs the question: Is there a code checker for Python that eliminates these kinds of problems?

  3. Ian Hinder
    • removed comment

    I assume that this problem has been fixed, since the logging code has been completely rewritten. Can we close the ticket?

  4. Log in to comment