TroubleShooting

    Trouble-shooting Strategies
    Error Messages and Solutions
    Problems and Solutions

Trouble-shooting Strategies

Strategy 1 -- "No Output":  Nothing happens when you run your product.
  1. Make sure you are running your product locally.
  2. Check the Process Monitor for error messages.
  3. Check the Error Messages section below for your error.


Strategy 2 -- "Baseline Problem": You are getting undesirable results with the baseline formatter (no threshold or variable overrides in the Overrides file).

  1.  If the problem is with a narrative phrase, check the Text Rules Reference documentation to see if there are thresholds and variables that you might set to produce desired results.
  2. If not, send a message to the  listserver including a description of the problem and the desired results.
Strategy 3 -- "Isolate Override": You are getting undesirable results and you have overridden some thresholds or variables in your Overrides file.
  1. Run the baseline version of the product to see if you get the same results.
  2. If so, see Strategy 2 above.
  3. If not, comment out the overrides in your Overrides file and run it as the baseline.
  4. Now begin adding in the overrides one-by-one until the problem re-occurs.
  5. That will give you a hint as to where the offending code might be.
  6. If it's not clear at that point, include all this information in a message to the Listserver.
Strategy 4 -- "Infinite Loop or No Words":  For a particular edit area, you get the message: 
        WARNING: TOO MANY PASSES ON TREE.
      or
        WARNING: EMPTY WORDS FROM TREE.

These problems are often data-dependent making it difficult to reproduce especially at another site.  Thus, you will have to perform some detective work "on the spot" in order to isolate the problem before seeking assistance from the support teams.  In these situations, the narrative product is not completing as intended.  The multiple-pass processing has the potential of an infinite loop if the logic is such that some method either does not return a "done" status (e.g. return self.setWords() or self.DONE()) or does not set the words for a phrase correctly.  In either case, the strategy for locating the problem is the same.  We want to locate the offending method, and turning on the "trace" flag will help us to see which method is being called repeatedly.  However, before we turn on the volumnious trace messages, we want to isolate the problem as much as possible.  We do this by isolating the edit area, time period, and phrase method that are causing the trouble.
  1. Isolate the edit area for which there is a problem. Run the product for that area ONLY by altering your Combinations file or the "defaultEditAreas" list.
  2. Isolate the time period for which there is a problem. Override the issuance_list for the product and comment out all periods except the first for the issuance causing the problem. For example, if we are running the 10-503 ZFP and getting a problem with the Morning issuance, we would comment out all but Period_1 in the _10_503_issuance_list.  (Be sure and copy the entire issuance_list method into your Overrides file).
  3.  
    def _10_503_issuance_list(self, argDict):
            narrativeDefAM = [
                ("Period_1", "period1"), 
                #("Period_2_3", 12), ("Period_2_3", 12), 
                #("Period_4_5", 12), ("Period_4_5", 12), 
                #("Period_6_14", 12), ("Period_6_14", 12), ("Period_6_14", 12), ("Period_6_14", 12), 
                #("Period_6_14", 12), ("Period_6_14", 12), ("Period_6_14", 12), ("Period_6_14", 12), 
                ]
            narrativeDefPM = [
                ("Period_1", "period1"),
                ("Period_2_3", 12), ("Period_2_3", 12), 
                ("Period_4_5", 12), ("Period_4_5", 12), 
                ("Period_6_14", 12), ("Period_6_14", 12), ("Period_6_14", 12), ("Period_6_14", 12), 
                ("Period_6_14", 12), ("Period_6_14", 12), ("Period_6_14", 12), ("Period_6_14", 12), 
                ("Period_6_14", 12),
                ]

           .....etc...
    Run the product for this time period and see if you get the same error.  If not, begin uncommenting the periods one at a time until you get the error.  Of course, the earlier the time period, the easier it will be to read the trace.  So for any components prior to the the one causing the trouble, override the Product Component definition and remove all the entries in the "analysisList" and "phraseList".  For example, if the problem does not occur until the third period of the Morning issuance, remove  the "analysisList" and "phraseList" entries for the "Period_1" component:

    def Period_1(self):
            component =  { 
                "type": "component",
                "methodList": [
                              self.assemblePhrases, 
                              self.wordWrap, 
                              ],
                "analysisList": [ 
                           ],
                "phraseList":[ 
                       ],
          }

  4. Isolate the phrase method.  Determine which phrase is causing the problem by overriding the product component for the time period causing the trouble. Comment out all but the first phrase method and run the product.  If the problem does not occur, begin uncommenting each phrase one-by-one running the product until you find which phrase is causing the problem.  Then comment out all but that phrase method and run the product again to see that the problem occurs.  In some rare cases, you may have to uncomment more that one phrase to get the problem to occur.)
  5. Check the offending phrase method code. Find the phrase "word" method in the Text Rules library (or your Overrides file if you have overridden or added methods) and ensure that all of it's return statements return either a self.DONE() call or a self.setWords() call.   If not, correct the code and run your product again.  If that was not the problem, proceed to the next step.
  6. Turn on the trace messages.  Now you can turn on the trace messages in your Overrides file by setting the 'Definition["trace"]' flag to 1.  Re-run the product and examine the end of the trace messages.  You are looking for a method that is repeating without returning a status of DONE as reported in the message OR is continually returning 'None' for the value of 'Words' in the trace message.   If you find the offending method, you can begin to investigate why it is not completing.  At this point, you can submit this information to the listserver post for more help.
  7. Check your overrides. You may want to try Strategy 3 (above) to see if the problem occurs with the baseline formatter.  If not, you will want to isolate which of your overrides introduces the problem.

Error Messages

Below are  some common error messages and solutions.

******************************
Error message:

Traceback (most recent call last):
  File "<string>", line 1, in ?
  File "/scratch/hansen/HEAD/GFESuite/headline/TextFormatter.py", line 949, in profMain
    main2(arg)
  File "/scratch/hansen/HEAD/GFESuite/headline/TextFormatter.py", line 890, in main2
    forecast = formatter.getForecast(forecastType, argDict)
  File "/scratch/hansen/HEAD/GFESuite/headline/TextFormatter.py", line 154, in getForecast
    raise Exception, LogStream.exc()
Exception: Traceback (most recent call last):
   File "/scratch/hansen/HEAD/GFESuite/headline/TextFormatter.py", line 151, in getForecast
    text = product.generateForecast(argDict)
   File "FWF", line 593, in generateForecast
   File "FWF", line 676, in _sampleData
   File "/scratch/hansen/HEAD/GFESuite/headline/ForecastNarrative.py", line 467, in getNarrativeData
    error = self.__breakOutDefinition(argDict, narrativeDefinition, timeRange, areaList)
   File "/scratch/hansen/HEAD/GFESuite/headline/ForecastNarrative.py", line 628, in __breakOutDefinition
    editAreas = self.__intersectEditAreas(leAreaLabel, argDict)
   File "/scratch/hansen/HEAD/GFESuite/headline/ForecastNarrative.py", line 733, in __intersectEditAreas
    leArea = self.findEditArea(None, leAreaLabel)
   File "/scratch/hansen/HEAD/GFESuite/headline/ForecastNarrative.py", line 767, in findEditArea
    editArea = self.getEditAreas(self.__argDict, [areaLabel])[0]
   File "EditAreaUtils", line 82, in getEditAreas
   File "/scratch/hansen/HEAD/GFESuite/libs/pyInter/AFPSSup.py", line 2283, in getReferenceData
    def getReferenceData(*args): return apply(_AFPSSup.IFPClient_getReferenceData,args)
 TypeError: IFPClient::getReferenceData()failed : Unable to find reference data [(BelowElev,P=0,A=0)]

Solution:

******************************
Error message:

Problem importing module: CWFPeriod--
Traceback (innermost last):
 File "imputil.py", line 106, in _import_hook
ImportError: No module named CWFPeriod

Solution:

  • Find the offending Product Component (in this case CWFPeriod in the Overrides file)
  • Try commenting out sections within the product component (e.g. CWFPeriod) until you do not get the error.
  • Incrementally comment lines back in to find which line is the offender.
  • ******************************

    Error message:
    Traceback (most recent call last):
    File "<string>", line 1, in ?
    File "TextFormatter.py", line 949, in profMain
    File "TextFormatter.py", line 890, in main2
    File "TextFormatter.py", line 154, in getForecast
    Exception: Traceback (most recent call last):
    File "TextFormatter.py", line 151, in getForecast
    File "AreaFcst", line 759, in generateForecast
    File "AreaFcst", line 881, in _makeProduct
    File "ForecastNarrative.py", line 523, in generateForecast
    File "ForecastNarrative.py", line 563, in traverseTree
    File "ForecastNarrative.py", line 563, in traverseTree
    File "ForecastNarrative.py", line 544, in traverseTree
    File "PhraseBuilder", line 830, in consolidatePhrase
    File "PhraseBuilder", line 691, in checkForDifferences
    File "PhraseBuilder", line 739, in checkScalarDifference
    File "ConfigVariables", line 517, in scalar_difference_nlValue
    File "TextUtils", line 177, in access_dictionary
    AttributeError: 'NoneType' object has no attribute 'has_key'

    Solution:

        def scalar_difference_nlValue_dict(self, tree, node):
            # Scalar difference.  If the difference between scalar values
            # for 2 sub-periods is greater than or equal to this value,
            # the different values will be noted in the phrase.
            dict = TextRules.TextRules.scalar_difference_nlValue_dict(self, tree, node)
            dict["WindGust"] = 10 # knots or mph depending on product
            dict["Period"] = 5 # seconds
            dict["PoP"] = 10 # percentage
    -->  return dict



    ******************************

    Problems/Solutions

    Problem:
    "minimum_range" or "maximum_range" is not taking effect.

    Solution:
    Check to to see if a "range_nlValue" is being set for this weather element either in the Overrides file, Standard file, or in ConfigVariables.  The range_nlValue supercedes the other ranges and should be set to zero in order to apply minimum or maximum ranges.