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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...