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!

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...

SplunkTrust Application Period is Officially OPEN!

It's that time, folks! The application/nomination period for the 2026-2027 SplunkTrust is officially open. If ...