Developing for Splunk Platform

Why am I receiving Splunk Extension for VSCode debugger error on custom command

Path Finder

The python debugger in the Splunk Extension does not work when debugging a custom command (reporting command). It runs fine without the debugger, but when using the debugger it crashes at the dispatch() function and returns the following traceback:


Traceback (most recent call last):
  File "/opt/splunk/etc/apps/<app>/bin/<command>.py", line 149, in <module>
    dispatch(exportExcel, sys.argv, sys.stdin, sys.stdout, __name__)
  File "/opt/splunk/etc/apps/<app>/bin/../lib/splunklib/searchcommands/", line 1144, in dispatch
    command_class().process(argv, input_file, output_file, allow_empty_input)
  File "/opt/splunk/etc/apps/<app>/bin/../lib/splunklib/searchcommands/", line 450, in process
    self._process_protocol_v2(argv, ifile, ofile)
  File "/opt/splunk/etc/apps/<app>/bin/../lib/splunklib/searchcommands/", line 788, in _process_protocol_v2
  File "/opt/splunk/etc/apps/<app>/bin/../lib/splunklib/searchcommands/", line 813, in write_metadata
    self._write_chunk(metadata, '')
  File "/opt/splunk/etc/apps/<app>/bin/../lib/splunklib/searchcommands/", line 843, in _write_chunk
  File "/opt/splunk/etc/apps/<app>/bin/../lib/splunklib/searchcommands/", line 557, in write
  File "/opt/splunk/etc/apps/SA-VSCode/bin/ptvsd/_vendored/pydevd/_pydevd_bundle/", line 40, in write
TypeError: write() argument must be str, not bytes


The custom running code is similar to the python examples in the SDK repo in:

Any help ll be appreciated.

Labels (2)
0 Karma


If you think that's the issue with the VS code extension you can submit the issue here - 

Path Finder

Already did that, but no response so far.

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 ...