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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Build the Future of Agentic AI: Join the Splunk Agentic Ops Hackathon

AI is changing how teams investigate incidents, detect threats, automate workflows, and build intelligent ...

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...