iApp Debugging Tips

Debugging your iApp templates

There are not a lot of debugging facilities available for iApp Templates. There is no way to step through a template code while it is executing, and the error messages can be confusing. The following are a few tips to make it a little bit easier.

Interpreting Import Error Message Line Numbers

When you import an iApp Template into the BIG-IP, it is must pass a syntax check for import to be successful. If there is a problem, you will receive an error message. The only problem is that it can be hard to figure out which part of the template the error message is referring to. The error message will contain a line number, but that line number is not measured from the beginning of the template file. Instead, the line number refers to the number of lines from the beginning of the section that contains the error, either the UI Presentation section or the back-end Implementation section.

Determining Which Section a Line Number Refers To

1) If an error message is of the form “line {line number}, {column number},” like this
/Common/another_Copy_of_f5.generic_http: line 57,5: error 9: Extraneous input - expected IDENT

Then the error message refers to a place in the Presentation Section.
2) If an error message just specifies “line {line number}” and no column number, like this
01070712:3: Caught configuration exception (0), ERROR app_template - /Common/another_Copy_of_f5.generic_http definition: line 36 [undefined procedure: sit] [sit cert $::ssl_encryption_questions__cert]

Then the error message refers to a place in the Implementation section.

Generating Debug Output

Once a template has been successfully imported, then you can run it. If you run into problems at this point, it can be helpful to generate debug messages to help determine where the problem is. In the Implementation section of the iApp template, you can generate debug output to /var/tmp/scriptd.out using the Tcl puts command.
puts "This message goes to /var/tmp/scriptd.out"

The BIG-IP API Reference documentation contains community-contributed content. F5 does not monitor or control community code contributions. We make no guarantees or warranties regarding the available code, and it may contain errors, defects, bugs, inaccuracies, or security vulnerabilities. Your access to and use of any code available in the BIG-IP API reference guides is solely at your own risk.