All Apps and Add-ons

Geeting error in Splunk Appinspect :- Check that python version is python3 for executables in restmap.conf.

sacumen
Explorer

While running AppInspect(version 2.1.0) against splunk addon getting an error "check_rest_handler_python_executable_exists - Check that python version is python3 for executables in restmap.conf." even I updated it to python3 but still the same error is there however if I am running with old appinspect(version 1.7) it passes splunk app-inspect.

Kindly let me know what I am missing here.

Thanks.

Labels (1)
0 Karma
1 Solution

vsheshadri_splu
Splunk Employee
Splunk Employee

This check was newly added as part of appinspect 2.1.0 in order to encourage Python3 adoption over Python2.7

Please include the python.version = python3 in the restmap.conf stanzas.

Example:

[admin_external:my_settings]
handlertype = python
handlerfile = file.py
handleractions = edit, list
python.version = python3

If you still encounter issues, please post your restmap.conf file.

View solution in original post

NozomiNetworks
Loves-to-Learn Everything

Hi, I'm trying to validate my app but got these errors:
{

category: app_cert_validation

   description: Check that python version is python3 for executables in restmap.conf..

...

   message_id: 7004

   messages: [{"code": "reporter.fail(reporter_message, file_path, handler.lineno)", "filename": "check_rest_endpoints.py", "line": 126, "message": "The handler of stanza [admin_external:TA_nozomi_networks_add_on_account] should be `python3` executable. File: default/restmap.conf Line Number: 6", "result": "failure", "message_filename": "default/restmap.conf", "message_line": 6}, {"code": "reporter.fail(reporter_message, file_path, handler.lineno)", "filename": "check_rest_endpoints.py", "line": 126, "message": "The handler of stanza [admin_external:TA_nozomi_networks_add_on_settings] should be `python3` executable. File: default/restmap.conf Line Number: 11", "result": "failure", "message_filename": "default/restmap.conf", "message_line": 11}, {"code": "reporter.fail(reporter_message, file_path, handler.lineno)", "filename": "check_rest_endpoints.py", "line": 126, "message": "The handler of stanza [admin_external:TA_nozomi_networks_add_on_variables] should be `python3` executable. File: default/restmap.conf Line Number: 16", "result": "failure", "message_filename": "default/restmap.conf", "message_line": 16}, {"code": "reporter.fail(reporter_message, file_path, handler.lineno)", "filename": "check_rest_endpoints.py", "line": 126, "message": "The handler of stanza [admin_external:TA_nozomi_networks_add_on_alert] should be `python3` executable. File: default/restmap.conf Line Number: 21", "result": "failure", "message_filename": "default/restmap.conf", "message_line": 21}, {"code": "reporter.fail(reporter_message, file_path, handler.lineno)", "filename": "check_rest_endpoints.py", "line": 126, "message": "The handler of stanza [admin_external:TA_nozomi_networks_add_on_sessions] should be `python3` executable. File: default/restmap.conf Line Number: 26", "result": "failure", "message_filename": "default/restmap.conf", "message_line": 26}, {"code": "reporter.fail(reporter_message, file_path, handler.lineno)", "filename": "check_rest_endpoints.py", "line": 126, "message": "The handler of stanza [admin_external:TA_nozomi_networks_add_on_health_logs] should be `python3` executable. File: default/restmap.conf Line Number: 31", "result": "failure", "message_filename": "default/restmap.conf", "message_line": 31}, {"code": "reporter.fail(reporter_message, file_path, handler.lineno)", "filename": "check_rest_endpoints.py", "line": 126, "message": "The handler of stanza [admin_external:TA_nozomi_networks_add_on_node_cpe_changes] should be `python3` executable. File: default/restmap.conf Line Number: 36", "result": "failure", "message_filename": "default/restmap.conf", "message_line": 36}, {"code": "reporter.fail(reporter_message, file_path, handler.lineno)", "filename": "check_rest_endpoints.py", "line": 126, "message": "The handler of stanza [admin_external:TA_nozomi_networks_add_on_node_cpes] should be `python3` executable. File: default/restmap.conf Line Number: 41", "result": "failure", "message_filename": "default/restmap.conf", "message_line": 41}, {"code": "reporter.fail(reporter_message, file_path, handler.lineno)", "filename": "check_rest_endpoints.py", "line": 126, "message": "The handler of stanza [admin_external:TA_nozomi_networks_add_on_assertion] should be `python3` executable. File: default/restmap.conf Line Number: 46", "result": "failure", "message_filename": "default/restmap.conf", "message_line": 46}, {"code": "reporter.fail(reporter_message, file_path, handler.lineno)", "filename": "check_rest_endpoints.py", "line": 126, "message": "The handler of stanza [admin_external:TA_nozomi_networks_add_on_link_events] should be `python3` executable. File: default/restmap.conf Line Number: 51", "result": "failure", "message_filename": "default/restmap.conf", "message_line": 51}, {"code": "reporter.fail(reporter_message, file_path, handler.lineno)", "filename": "check_rest_endpoints.py", "line": 126, "message": "The handler of stanza [admin_external:TA_nozomi_networks_add_on_asset] should be `python3` executable. File: default/restmap.conf Line Number: 56", "result": "failure", "message_filename": "default/restmap.conf", "message_line": 56}, {"code": "reporter.fail(reporter_message, file_path, handler.lineno)", "filename": "check_rest_endpoints.py", "line": 126, "message": "The handler of stanza [admin_external:TA_nozomi_networks_add_on_node_cve_s] should be `python3` executable. File: default/restmap.conf Line Number: 61", "result": "failure", "message_filename": "default/restmap.conf", "message_line": 61}, {"code": "reporter.fail(reporter_message, file_path, handler.lineno)", "filename": "check_rest_endpoints.py", "line": 126, "message": "The handler of stanza [admin_external:TA_nozomi_networks_add_on_node_points] should be `python3` executable. File: default/restmap.conf Line Number: 66", "result": "failure", "message_filename": "default/restmap.conf", "message_line": 66}, {"code": "reporter.fail(reporter_message, file_path, handler.lineno)", "filename": "check_rest_endpoints.py", "line": 126, "message": "The handler of stanza [admin_external:TA_nozomi_networks_add_on_captured_url_s] should be `python3` executable. File: default/restmap.conf Line Number: 71", "result": "failure", "message_filename": "default/restmap.conf", "message_line": 71}, {"code": "reporter.fail(reporter_message, file_path, handler.lineno)", "filename": "check_rest_endpoints.py", "line": 126, "message": "The handler of stanza [admin_external:TA_nozomi_networks_add_on_links] should be `python3` executable. File: default/restmap.conf Line Number: 76", "result": "failure", "message_filename": "default/restmap.conf", "message_line": 76}]

following the solution on this post I added the puython3 conf to restmap:

[admin_external:TA_nozomi_networks_add_on_links]
handlertype = python
python.version=python3
handlerfile = check_rest_endpoints.py
handleractions = edit, list, remove, create

[admin_external:TA_nozomi_networks_add_on_captured_url_s]
handlertype = python
python.version=python3
handlerfile = check_rest_endpoints.py
handleractions = edit, list, remove, create

[admin_external:TA_nozomi_networks_add_on_node_points]
handlertype = python
python.version=python3
handlerfile = check_rest_endpoints.py
handleractions = edit, list, remove, create

[admin_external:TA_nozomi_networks_add_on_node_cve_s]
handlertype = python
python.version=python3
handlerfile = check_rest_endpoints.py
handleractions = edit, list, remove, create

[admin_external:TA_nozomi_networks_add_on_asset]
handlertype = python
python.version=python3
handlerfile = check_rest_endpoints.py
handleractions = edit, list, remove, create

[admin_external:TA_nozomi_networks_add_on_link_events]
handlertype = python
python.version=python3
handlerfile = check_rest_endpoints.py
handleractions = edit, list, remove, create

[admin_external:TA_nozomi_networks_add_on_assertion]
handlertype = python
python.version=python3
handlerfile = check_rest_endpoints.py
handleractions = edit, list, remove, create

[admin_external:TA_nozomi_networks_add_on_node_cpes]
handlertype = python
python.version=python3
handlerfile = check_rest_endpoints.py
handleractions = edit, list, remove, create

[admin_external:TA_nozomi_networks_add_on_node_cpe_changes]
handlertype = python
python.version=python3
handlerfile = check_rest_endpoints.py
handleractions = edit, list, remove, create

[admin_external:TA_nozomi_networks_add_on_health_logs]
handlertype = python
python.version=python3
handlerfile = check_rest_endpoints.py
handleractions = edit, list, remove, create

[admin_external:TA_nozomi_networks_add_on_sessions]
handlertype = python
python.version=python3
handlerfile = check_rest_endpoints.py
handleractions = edit, list, remove, create

[admin_external:TA_nozomi_networks_add_on_alert]
handlertype = python
python.version=python3
handlerfile = check_rest_endpoints.py
handleractions = edit, list, remove, create

[admin_external:TA_nozomi_networks_add_on_variables]
handlertype = python
python.version=python3
handlerfile = check_rest_endpoints.py
handleractions = edit, list, remove, create

[admin_external:TA_nozomi_networks_add_on_settings]
handlertype = python
python.version=python3
handlerfile = check_rest_endpoints.py
handleractions = edit, list, remove, create

[admin_external:TA_nozomi_networks_add_on_account]
handlertype = python
python.version=python3
handlerfile = check_rest_endpoints.py
handleractions = edit, list, remove, create

But I'm still having the validation error 😞

Someone can help me?

Thanks!



 

0 Karma

vsheshadri_splu
Splunk Employee
Splunk Employee

This check was newly added as part of appinspect 2.1.0 in order to encourage Python3 adoption over Python2.7

Please include the python.version = python3 in the restmap.conf stanzas.

Example:

[admin_external:my_settings]
handlertype = python
handlerfile = file.py
handleractions = edit, list
python.version = python3

If you still encounter issues, please post your restmap.conf file.

ashu1
Loves-to-Learn Lots

Thanks a lot. It worked for me!!

0 Karma

sacumen
Explorer

I had also implemented the same and it started working.
Thanks.

0 Karma

stuartidelta01
Path Finder

I am also getting this issue running splunk 8.04 and add-on builder v3.0.1. I'm developing an add-on that makes some very simple REST API calls (add-on works fine).

I also changed the global python.version to be python3 in server.conf as well as adding python.version=python3 entries in each of the scripts defined in restmap.conf. I still get the error when running "validate" in the add-on builder (which runs appinspect).

I tested another REST based add-on that previously passed appinspect. It now fails with the same error. This add-on is already on splunkbase and is showing the "AppInspect passed" badge:

https://splunkbase.splunk.com/app/4976/

Looking at this page, the entry near the top suggests appInspect was updated 28th April

https://dev.splunk.com/enterprise/docs/releaseapps/appinspect/appinspectreferencetopics/splunkappins...

I'm going to email a link to this ticket to the app inspect email address to raise awareness. You should add the "appinspect" tag to this ticket if you can.

0 Karma

stuartidelta01
Path Finder

restmap.conf - note that I have modified this to add the python.version lines, the add-on builder does not include this by default. Both setups return the error as per original post

(Update - this now works OK for me)

  [admin:TA_add_on_for_carbon_intensity]
    match = /
    members = TA_add_on_for_carbon_intensity_settings, TA_add_on_for_carbon_intensity_generation, TA_add_on_for_carbon_intensity_regional, TA_add_on_for_carbon_intensity_intensity

    [admin_external:TA_add_on_for_carbon_intensity_settings]
    handlertype = python
    python.version=python3
    handlerfile = TA_add_on_for_carbon_intensity_rh_settings.py
    handleractions = edit, list

    [admin_external:TA_add_on_for_carbon_intensity_generation]
    handlertype = python
    python.version=python3
    handlerfile = TA_add_on_for_carbon_intensity_rh_generation.py
    handleractions = edit, list, remove, create

    [admin_external:TA_add_on_for_carbon_intensity_regional]
    handlertype = python
    python.version=python3
    handlerfile = TA_add_on_for_carbon_intensity_rh_regional.py
    handleractions = edit, list, remove, create

    [admin_external:TA_add_on_for_carbon_intensity_intensity]
    handlertype = python
    python.version=python3
    handlerfile = TA_add_on_for_carbon_intensity_rh_intensity.py
    handleractions = edit, list, remove, create
0 Karma

vsheshadri_splu
Splunk Employee
Splunk Employee

Can you please share the error message as well.

0 Karma

stuartidelta01
Path Finder

Just managed to get the add-on through the app inspect phase. I had trouble connecting to the app inspect REST API for a couple of days and I think this error was confusing things. Thanks for your help - I'm will uptick your answer below as the restmap.conf above is now working OK for me.

0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...