All Apps and Add-ons

Debugging app breakpoints fail in Visual Studio and PyCharm

stephendavisWK
Explorer

I am working to setup debugging for app development in Splunk 6.6.3. My challenge has been getting the breakpoints in the app to trigger.

Following the blog post below, I have tried setting up both VS 2015 & PyCharm 2017.2.3 with success in starting SplunkWeb.
Post: "How to debug Django applications with pdb, PyCharm, and Visual Studio"

I can get a breakpoint to trigger in root.py, but not in my app. I start debugging, hit the root.py breakpoint, continue and open a browser. When I perform an operation (save/delete of kvstore) the expected breakpoints in the .py code do not trigger. But, the operation completes and the kvstore is updated.

I am at a loss to understand why breakpoints set in myapp in "C:\Program Files\Splunk\etc\apps\myapp" will not trigger.
VS project folder: C:\Projects\SplunkPython
VS project home: C:\Program Files\Splunk\
VS startup file: C:\Program Files\Splunk\Python-2.7\Lib\site-packages\splunk\appserver\mrsparkle\root.py
VS working dir: C:\Program Files\Splunk

I have also tried setting breakpoints in an installed 3rd party app with the same result.
Any suggestions from you developers out there?

0 Karma
1 Solution

stephendavisWK
Explorer

No answer was found as to get break points to work. The work around was to debug using PyCharm with an entirely different script. I setup a test fixture which logged in to get a connection established. Which simulated the UI user session. Then hard coded kwargs values.

The connection and kwargs were used in the code that followed. This allowed the development of Python code which could be copied into the actual .py script for use in the app. Debugging for the final code was performed using logger.debug statements to confirm the final functionality.

View solution in original post

0 Karma

stephendavisWK
Explorer

No answer was found as to get break points to work. The work around was to debug using PyCharm with an entirely different script. I setup a test fixture which logged in to get a connection established. Which simulated the UI user session. Then hard coded kwargs values.

The connection and kwargs were used in the code that followed. This allowed the development of Python code which could be copied into the actual .py script for use in the app. Debugging for the final code was performed using logger.debug statements to confirm the final functionality.

0 Karma

stephendavisWK
Explorer

Additional info: On the app launcher home page. App icons show as broken links. Viewing the images gives a 500 server error. The URL to the images is correct. Just not found when debugging. All installed apps are affected. Including Search & Reporting. AppIconAlt.png (menu icon) images also missing.

0 Karma
Get Updates on the Splunk Community!

Improve Your Security Posture

Watch NowImprove Your Security PostureCustomers are at the center of everything we do at Splunk and security ...

Maximize the Value from Microsoft Defender with Splunk

 Watch NowJoin Splunk and Sens Consulting for this Security Edition Tech TalkWho should attend:  Security ...

This Week's Community Digest - Splunk Community Happenings [6.27.22]

Get the latest news and updates from the Splunk Community here! News From Splunk Answers ✍️ Splunk Answers is ...