<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Trying to install an app via the REST API, why am I getting error &amp;quot;'NoneType' object has no attribute '_cafile'&amp;quot;? in Installation</title>
    <link>https://community.splunk.com/t5/Installation/Trying-to-install-an-app-via-the-REST-API-why-am-I-getting-error/m-p/252151#M3883</link>
    <description>&lt;P&gt;I've started getting the following error when trying to install an app via the REST API:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;response&amp;gt;
  &amp;lt;messages&amp;gt;
    &amp;lt;msg type="ERROR"&amp;gt;
 In handler 'appinstall': 'NoneType' object has no attribute '_cafile'&amp;lt;/msg&amp;gt;
  &amp;lt;/messages&amp;gt;
&amp;lt;/response&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The command I used is as follows (edited for privacy):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;curl -1 -s -k -u admin:changeme &lt;A href="https://localhost:8089/services/apps/appinstall" target="test_blank"&gt;https://localhost:8089/services/apps/appinstall&lt;/A&gt; -d name=http://local.repo/files/splunk_apps/sideview-utils-lgpl_135.tgz
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This worked fine in Splunk version 6.2.0, but I noticed that versions 6.3.x+ (including the latest 6.4 version) started throwing this error. I haven't tested any other 6.2.x versions.&lt;/P&gt;
&lt;P&gt;I seem to have tracked this down to the &lt;CODE&gt;$SPLUNK_HOME/lib/python2.7/site-packages/splunk/appbuilder.py&lt;/CODE&gt; and &lt;CODE&gt;$SPLUNK_HOME/lib/python2.7/site-packages/splunk/clilib/bundle_paths.py&lt;/CODE&gt; code. Specifically the &lt;CODE&gt;installApp&lt;/CODE&gt; and &lt;CODE&gt;install_from_url&lt;/CODE&gt; methods that contain an &lt;CODE&gt;sslpol=None&lt;/CODE&gt; argument.&lt;/P&gt;
&lt;P&gt;The following line calls &lt;CODE&gt;sslpol._cafile&lt;/CODE&gt; without checking that sslpol isn't &lt;CODE&gt;None&lt;/CODE&gt;?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;lib/python2.7/site-packages/splunk/clilib/bundle_paths.py:260:            logger.debug("Verifying server cert: %s cafile: %s" % (req.get_full_url(), sslpol._cafile))
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;sslpol doesn't seem to be assigned anywhere?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;[root@6f2de504bfa4 splunk]# grep -Rin --exclude=*.py? sslpol lib
lib/python2.7/site-packages/splunk/appbuilder.py:153:def installApp(location, force=False, sslpol=None):
lib/python2.7/site-packages/splunk/appbuilder.py:160:            return installer.install_from_url(req, force, sslpol)
lib/python2.7/site-packages/splunk/clilib/bundle_paths.py:254:    def install_from_url(self, req, force=False, sslpol=None):
lib/python2.7/site-packages/splunk/clilib/bundle_paths.py:260:            logger.debug("Verifying server cert: %s cafile: %s" % (req.get_full_url(), sslpol._cafile))
lib/python2.7/site-packages/splunk/clilib/bundle_paths.py:261:            self.validate_server_cert(req.get_full_url(), sslpol)
lib/python2.7/site-packages/splunk/clilib/bundle_paths.py:324:    def validate_server_cert(self, url, sslpol):
lib/python2.7/site-packages/splunk/clilib/bundle_paths.py:325:        validator = ServerCertValidator(sslpol)
lib/python2.7/site-packages/splunk/clilib/bundle_paths.py:851:class SSLPolicy:
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;UPDATE:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;A bit of additional investigation shows where sslpol is defined:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;etc/system/bin/appsmanager.py:82:        self._sslpol = bundle_paths.SSLPolicy()
etc/system/bin/appsmanager.py:112:                    self._sslpol._cafile = bundle_paths.expandvars(s["caCertFile"])
etc/system/bin/appsmanager.py:114:                    self._sslpol._sslCommonNameList = bundle_paths.expandvars(s["sslCommonNameList"])
etc/system/bin/appsmanager.py:116:                    self._sslpol._cipherSuite = bundle_paths.expandvars(s["cipherSuite"])
etc/system/bin/appsmanager.py:127:        if self._sslpol._cafile is None:
etc/system/bin/appsmanager.py:128:            logger.debug("applicationsManagement.caCertFile = %s" % str(self._sslpol._cafile))
etc/system/bin/appsmanager.py:129:        if self._sslpol._sslCommonNameList is None:
etc/system/bin/appsmanager.py:130:            logger.debug("applicationsManagement.sslCommonNameList = %s" % str(self._sslpol._sslCommonNameList))
etc/system/bin/appsmanager.py:131:        if self._sslpol._cipherSuite is None:
etc/system/bin/appsmanager.py:132:            logger.debug("applicationsManagement.cipherSuite = %s" % str(self._sslpol._cipherSuite))
etc/system/bin/appsmanager.py:149:            bundle_paths.BundleInstaller().validate_server_cert(self._login, self._sslpol)
etc/system/bin/appsmanager.py:260:            b, status = installer.install_from_url(req, sslpol=self._sslpol)
etc/system/bin/appsmanager.py:336:            bundle_paths.BundleInstaller().validate_server_cert(target_url, self._sslpol)
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I'm assuming &lt;CODE&gt;bundle_paths.expandvars(s["caCertFile"])&lt;/CODE&gt; isn't expanding correctly?&lt;/P&gt;
&lt;P&gt;I think perhaps this might be server config related, though the error message isn't particularly helpful. Any advice on configuration should be greatly appreciated!?&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;UPDATE 2:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;If I install from a local file, this works fine, e.g.:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;curl -1 -s -k -u admin:changeme &lt;A href="https://localhost:8089/services/apps/appinstall" target="test_blank"&gt;https://localhost:8089/services/apps/appinstall&lt;/A&gt; -d 'name=/root/sideview-utils-lgpl_135.tgz'
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This makes me believe it may be a bug, as opposed to config related?&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;UPDATE 3:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I turned on debug mode and get the following output in &lt;CODE&gt;/opt/splunk/var/log/splunk/splunkd.log&lt;/CODE&gt;:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;[root@fb8562ae3b7a splunk]# tail -F var/log/splunk/splunkd.log | grep cafile
05-25-2016 12:15:49.180 +0000 DEBUG AdminManagerExternal - Got back data: &amp;lt;eai_error&amp;gt;&amp;lt;recognized&amp;gt;true&amp;lt;/recognized&amp;gt;&amp;lt;type&amp;gt;&amp;lt;class 'splunk.admin.InternalException'&amp;gt;&amp;lt;/type&amp;gt;&amp;lt;message&amp;gt;'NoneType' object has no attribute '_cafile'&amp;lt;/message&amp;gt;&amp;lt;stacktrace&amp;gt;Traceback (most recent call last):\n  File "/opt/splunk/lib/python2.7/site-packages/splunk/admin.py", line 129, in init\n    hand.execute(info)\n  File "/opt/splunk/lib/python2.7/site-packages/splunk/admin.py", line 589, in execute\n    if self.requestedAction == ACTION_CREATE:   self.handleCreate(confInfo)\n  File "/opt/splunk/etc/system/bin/appinstall.py", line 38, in handleCreate\n    bundle, status = appbuilder.installApp(location, force)\n  File "/opt/splunk/lib/python2.7/site-packages/splunk/appbuilder.py", line 170, in installApp\n    raise admin.InternalException(e)\nInternalException: 'NoneType' object has no attribute '_cafile'\n&amp;lt;/stacktrace&amp;gt;&amp;lt;/eai_error&amp;gt;\n

05-25-2016 12:15:49.180 +0000 DEBUG AdminManagerExternal - Serialized error: name="&amp;lt;class 'splunk.admin.InternalException'&amp;gt;", msg="'NoneType' object has no attribute '_cafile'", stack="\nTraceback (most recent call last):\n  File "/opt/splunk/lib/python2.7/site-packages/splunk/admin.py", line 129, in init\n    hand.execute(info)\n  File "/opt/splunk/lib/python2.7/site-packages/splunk/admin.py", line 589, in execute\n    if self.requestedAction == ACTION_CREATE:   self.handleCreate(confInfo)\n  File "/opt/splunk/etc/system/bin/appinstall.py", line 38, in handleCreate\n    bundle, status = appbuilder.installApp(location, force)\n  File "/opt/splunk/lib/python2.7/site-packages/splunk/appbuilder.py", line 170, in installApp\n    raise admin.InternalException(e)\nInternalException: 'NoneType' object has no attribute '_cafile'\n".

05-25-2016 12:15:49.180 +0000 ERROR AdminManagerExternal - 'NoneType' object has no attribute '_cafile'
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The problem seems to be here:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;bundle, status = appbuilder.installApp(location, force)
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It looks as though a call is being made to &lt;CODE&gt;appbuilder.installApp&lt;/CODE&gt;at line 38 of &lt;CODE&gt;/opt/splunk/etc/system/bin/appinstall.py&lt;/CODE&gt; with the arguments &lt;CODE&gt;location&lt;/CODE&gt; and &lt;CODE&gt;force&lt;/CODE&gt;, however this method also takes an &lt;CODE&gt;sslpol&lt;/CODE&gt; argument, that defaults to &lt;CODE&gt;None&lt;/CODE&gt; if not supplied. Line 160 of &lt;CODE&gt;/opt/splunk/lib/python2.7/site-packages/splunk/appbuilder.py&lt;/CODE&gt; then calls &lt;CODE&gt;installer.install_from_url(req, force, sslpol)&lt;/CODE&gt; with &lt;CODE&gt;sslpol&lt;/CODE&gt; set to &lt;CODE&gt;None&lt;/CODE&gt;.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;def installApp(location, force=False, sslpol=None):
    installer = bundle_paths.BundleInstaller()
    location = location.strip()

    try:
        if location.startswith('http'):
            req = urllib2.Request(url=location)
            return installer.install_from_url(req, force, sslpol)
        else:
            return installer.install_from_tar(location, force)
    except splunk.ResourceNotFound, e:
        raise admin.ArgValidationException(e.msg)
    except splunk.RESTException, e:
        if e.statusCode == 409:
            raise admin.AlreadyExistsException(e.msg)
        raise admin.InternalException(e.msg)
    except Exception, e:
        raise admin.InternalException(e)
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I tried changing to this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;bundle, status = appbuilder.installApp(location, force, bundle_paths.SSLPolicy())
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now the install from url works again! I'm not sure if this is the right fix or not, or whether something different should be handling &lt;CODE&gt;/apps/appinstall&lt;/CODE&gt; in &lt;CODE&gt;restmap.conf&lt;/CODE&gt; for example? I've submitted this as a support request to Splunk, and will update this post once I have more information from their engineers.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;NB:&lt;/STRONG&gt; The line numbers above may be different in different versions of Splunk (these are relevant to version 6.4.1).&lt;/P&gt;</description>
    <pubDate>Wed, 17 Jun 2020 18:04:03 GMT</pubDate>
    <dc:creator>gawbul</dc:creator>
    <dc:date>2020-06-17T18:04:03Z</dc:date>
    <item>
      <title>Trying to install an app via the REST API, why am I getting error "'NoneType' object has no attribute '_cafile'"?</title>
      <link>https://community.splunk.com/t5/Installation/Trying-to-install-an-app-via-the-REST-API-why-am-I-getting-error/m-p/252151#M3883</link>
      <description>&lt;P&gt;I've started getting the following error when trying to install an app via the REST API:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;
&amp;lt;response&amp;gt;
  &amp;lt;messages&amp;gt;
    &amp;lt;msg type="ERROR"&amp;gt;
 In handler 'appinstall': 'NoneType' object has no attribute '_cafile'&amp;lt;/msg&amp;gt;
  &amp;lt;/messages&amp;gt;
&amp;lt;/response&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The command I used is as follows (edited for privacy):&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;curl -1 -s -k -u admin:changeme &lt;A href="https://localhost:8089/services/apps/appinstall" target="test_blank"&gt;https://localhost:8089/services/apps/appinstall&lt;/A&gt; -d name=http://local.repo/files/splunk_apps/sideview-utils-lgpl_135.tgz
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This worked fine in Splunk version 6.2.0, but I noticed that versions 6.3.x+ (including the latest 6.4 version) started throwing this error. I haven't tested any other 6.2.x versions.&lt;/P&gt;
&lt;P&gt;I seem to have tracked this down to the &lt;CODE&gt;$SPLUNK_HOME/lib/python2.7/site-packages/splunk/appbuilder.py&lt;/CODE&gt; and &lt;CODE&gt;$SPLUNK_HOME/lib/python2.7/site-packages/splunk/clilib/bundle_paths.py&lt;/CODE&gt; code. Specifically the &lt;CODE&gt;installApp&lt;/CODE&gt; and &lt;CODE&gt;install_from_url&lt;/CODE&gt; methods that contain an &lt;CODE&gt;sslpol=None&lt;/CODE&gt; argument.&lt;/P&gt;
&lt;P&gt;The following line calls &lt;CODE&gt;sslpol._cafile&lt;/CODE&gt; without checking that sslpol isn't &lt;CODE&gt;None&lt;/CODE&gt;?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;lib/python2.7/site-packages/splunk/clilib/bundle_paths.py:260:            logger.debug("Verifying server cert: %s cafile: %s" % (req.get_full_url(), sslpol._cafile))
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;sslpol doesn't seem to be assigned anywhere?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;[root@6f2de504bfa4 splunk]# grep -Rin --exclude=*.py? sslpol lib
lib/python2.7/site-packages/splunk/appbuilder.py:153:def installApp(location, force=False, sslpol=None):
lib/python2.7/site-packages/splunk/appbuilder.py:160:            return installer.install_from_url(req, force, sslpol)
lib/python2.7/site-packages/splunk/clilib/bundle_paths.py:254:    def install_from_url(self, req, force=False, sslpol=None):
lib/python2.7/site-packages/splunk/clilib/bundle_paths.py:260:            logger.debug("Verifying server cert: %s cafile: %s" % (req.get_full_url(), sslpol._cafile))
lib/python2.7/site-packages/splunk/clilib/bundle_paths.py:261:            self.validate_server_cert(req.get_full_url(), sslpol)
lib/python2.7/site-packages/splunk/clilib/bundle_paths.py:324:    def validate_server_cert(self, url, sslpol):
lib/python2.7/site-packages/splunk/clilib/bundle_paths.py:325:        validator = ServerCertValidator(sslpol)
lib/python2.7/site-packages/splunk/clilib/bundle_paths.py:851:class SSLPolicy:
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;STRONG&gt;UPDATE:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;A bit of additional investigation shows where sslpol is defined:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;etc/system/bin/appsmanager.py:82:        self._sslpol = bundle_paths.SSLPolicy()
etc/system/bin/appsmanager.py:112:                    self._sslpol._cafile = bundle_paths.expandvars(s["caCertFile"])
etc/system/bin/appsmanager.py:114:                    self._sslpol._sslCommonNameList = bundle_paths.expandvars(s["sslCommonNameList"])
etc/system/bin/appsmanager.py:116:                    self._sslpol._cipherSuite = bundle_paths.expandvars(s["cipherSuite"])
etc/system/bin/appsmanager.py:127:        if self._sslpol._cafile is None:
etc/system/bin/appsmanager.py:128:            logger.debug("applicationsManagement.caCertFile = %s" % str(self._sslpol._cafile))
etc/system/bin/appsmanager.py:129:        if self._sslpol._sslCommonNameList is None:
etc/system/bin/appsmanager.py:130:            logger.debug("applicationsManagement.sslCommonNameList = %s" % str(self._sslpol._sslCommonNameList))
etc/system/bin/appsmanager.py:131:        if self._sslpol._cipherSuite is None:
etc/system/bin/appsmanager.py:132:            logger.debug("applicationsManagement.cipherSuite = %s" % str(self._sslpol._cipherSuite))
etc/system/bin/appsmanager.py:149:            bundle_paths.BundleInstaller().validate_server_cert(self._login, self._sslpol)
etc/system/bin/appsmanager.py:260:            b, status = installer.install_from_url(req, sslpol=self._sslpol)
etc/system/bin/appsmanager.py:336:            bundle_paths.BundleInstaller().validate_server_cert(target_url, self._sslpol)
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I'm assuming &lt;CODE&gt;bundle_paths.expandvars(s["caCertFile"])&lt;/CODE&gt; isn't expanding correctly?&lt;/P&gt;
&lt;P&gt;I think perhaps this might be server config related, though the error message isn't particularly helpful. Any advice on configuration should be greatly appreciated!?&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;UPDATE 2:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;If I install from a local file, this works fine, e.g.:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;curl -1 -s -k -u admin:changeme &lt;A href="https://localhost:8089/services/apps/appinstall" target="test_blank"&gt;https://localhost:8089/services/apps/appinstall&lt;/A&gt; -d 'name=/root/sideview-utils-lgpl_135.tgz'
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This makes me believe it may be a bug, as opposed to config related?&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;UPDATE 3:&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I turned on debug mode and get the following output in &lt;CODE&gt;/opt/splunk/var/log/splunk/splunkd.log&lt;/CODE&gt;:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;[root@fb8562ae3b7a splunk]# tail -F var/log/splunk/splunkd.log | grep cafile
05-25-2016 12:15:49.180 +0000 DEBUG AdminManagerExternal - Got back data: &amp;lt;eai_error&amp;gt;&amp;lt;recognized&amp;gt;true&amp;lt;/recognized&amp;gt;&amp;lt;type&amp;gt;&amp;lt;class 'splunk.admin.InternalException'&amp;gt;&amp;lt;/type&amp;gt;&amp;lt;message&amp;gt;'NoneType' object has no attribute '_cafile'&amp;lt;/message&amp;gt;&amp;lt;stacktrace&amp;gt;Traceback (most recent call last):\n  File "/opt/splunk/lib/python2.7/site-packages/splunk/admin.py", line 129, in init\n    hand.execute(info)\n  File "/opt/splunk/lib/python2.7/site-packages/splunk/admin.py", line 589, in execute\n    if self.requestedAction == ACTION_CREATE:   self.handleCreate(confInfo)\n  File "/opt/splunk/etc/system/bin/appinstall.py", line 38, in handleCreate\n    bundle, status = appbuilder.installApp(location, force)\n  File "/opt/splunk/lib/python2.7/site-packages/splunk/appbuilder.py", line 170, in installApp\n    raise admin.InternalException(e)\nInternalException: 'NoneType' object has no attribute '_cafile'\n&amp;lt;/stacktrace&amp;gt;&amp;lt;/eai_error&amp;gt;\n

05-25-2016 12:15:49.180 +0000 DEBUG AdminManagerExternal - Serialized error: name="&amp;lt;class 'splunk.admin.InternalException'&amp;gt;", msg="'NoneType' object has no attribute '_cafile'", stack="\nTraceback (most recent call last):\n  File "/opt/splunk/lib/python2.7/site-packages/splunk/admin.py", line 129, in init\n    hand.execute(info)\n  File "/opt/splunk/lib/python2.7/site-packages/splunk/admin.py", line 589, in execute\n    if self.requestedAction == ACTION_CREATE:   self.handleCreate(confInfo)\n  File "/opt/splunk/etc/system/bin/appinstall.py", line 38, in handleCreate\n    bundle, status = appbuilder.installApp(location, force)\n  File "/opt/splunk/lib/python2.7/site-packages/splunk/appbuilder.py", line 170, in installApp\n    raise admin.InternalException(e)\nInternalException: 'NoneType' object has no attribute '_cafile'\n".

05-25-2016 12:15:49.180 +0000 ERROR AdminManagerExternal - 'NoneType' object has no attribute '_cafile'
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The problem seems to be here:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;bundle, status = appbuilder.installApp(location, force)
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It looks as though a call is being made to &lt;CODE&gt;appbuilder.installApp&lt;/CODE&gt;at line 38 of &lt;CODE&gt;/opt/splunk/etc/system/bin/appinstall.py&lt;/CODE&gt; with the arguments &lt;CODE&gt;location&lt;/CODE&gt; and &lt;CODE&gt;force&lt;/CODE&gt;, however this method also takes an &lt;CODE&gt;sslpol&lt;/CODE&gt; argument, that defaults to &lt;CODE&gt;None&lt;/CODE&gt; if not supplied. Line 160 of &lt;CODE&gt;/opt/splunk/lib/python2.7/site-packages/splunk/appbuilder.py&lt;/CODE&gt; then calls &lt;CODE&gt;installer.install_from_url(req, force, sslpol)&lt;/CODE&gt; with &lt;CODE&gt;sslpol&lt;/CODE&gt; set to &lt;CODE&gt;None&lt;/CODE&gt;.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;def installApp(location, force=False, sslpol=None):
    installer = bundle_paths.BundleInstaller()
    location = location.strip()

    try:
        if location.startswith('http'):
            req = urllib2.Request(url=location)
            return installer.install_from_url(req, force, sslpol)
        else:
            return installer.install_from_tar(location, force)
    except splunk.ResourceNotFound, e:
        raise admin.ArgValidationException(e.msg)
    except splunk.RESTException, e:
        if e.statusCode == 409:
            raise admin.AlreadyExistsException(e.msg)
        raise admin.InternalException(e.msg)
    except Exception, e:
        raise admin.InternalException(e)
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I tried changing to this:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;bundle, status = appbuilder.installApp(location, force, bundle_paths.SSLPolicy())
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Now the install from url works again! I'm not sure if this is the right fix or not, or whether something different should be handling &lt;CODE&gt;/apps/appinstall&lt;/CODE&gt; in &lt;CODE&gt;restmap.conf&lt;/CODE&gt; for example? I've submitted this as a support request to Splunk, and will update this post once I have more information from their engineers.&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;NB:&lt;/STRONG&gt; The line numbers above may be different in different versions of Splunk (these are relevant to version 6.4.1).&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 18:04:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Installation/Trying-to-install-an-app-via-the-REST-API-why-am-I-getting-error/m-p/252151#M3883</guid>
      <dc:creator>gawbul</dc:creator>
      <dc:date>2020-06-17T18:04:03Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to install an app via the REST API, why am I getting error "'NoneType' object has no attribute '_cafile'"?</title>
      <link>https://community.splunk.com/t5/Installation/Trying-to-install-an-app-via-the-REST-API-why-am-I-getting-error/m-p/252152#M3884</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Change the default admin password&lt;/P&gt;

&lt;P&gt;Hope i help you&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2016 10:44:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Installation/Trying-to-install-an-app-via-the-REST-API-why-am-I-getting-error/m-p/252152#M3884</guid>
      <dc:creator>jmallorquin</dc:creator>
      <dc:date>2016-05-18T10:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to install an app via the REST API, why am I getting error "'NoneType' object has no attribute '_cafile'"?</title>
      <link>https://community.splunk.com/t5/Installation/Trying-to-install-an-app-via-the-REST-API-why-am-I-getting-error/m-p/252153#M3885</link>
      <description>&lt;P&gt;That isn't my actual password! Hence:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;P&gt;The command I used is as follows (edited for privacy):&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Wed, 18 May 2016 11:47:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Installation/Trying-to-install-an-app-via-the-REST-API-why-am-I-getting-error/m-p/252153#M3885</guid>
      <dc:creator>gawbul</dc:creator>
      <dc:date>2016-05-18T11:47:50Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to install an app via the REST API, why am I getting error "'NoneType' object has no attribute '_cafile'"?</title>
      <link>https://community.splunk.com/t5/Installation/Trying-to-install-an-app-via-the-REST-API-why-am-I-getting-error/m-p/252154#M3886</link>
      <description>&lt;P&gt;I downvoted this post because this doesn't answer my question!&lt;/P&gt;</description>
      <pubDate>Wed, 18 May 2016 11:48:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Installation/Trying-to-install-an-app-via-the-REST-API-why-am-I-getting-error/m-p/252154#M3886</guid>
      <dc:creator>gawbul</dc:creator>
      <dc:date>2016-05-18T11:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to install an app via the REST API, why am I getting error "'NoneType' object has no attribute '_cafile'"?</title>
      <link>https://community.splunk.com/t5/Installation/Trying-to-install-an-app-via-the-REST-API-why-am-I-getting-error/m-p/252155#M3887</link>
      <description>&lt;P&gt;Try using apps/local end point to upload your app using a URI. So, if I were you, considering the example you gave I would do something like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;curl -1 -s -k -u admin:changeme &lt;A href="https://localhost:8089/services/apps/local" target="test_blank"&gt;https://localhost:8089/services/apps/local&lt;/A&gt; -d name=http://local.repo/files/splunk_apps/sideview-utils-lgpl_135.tgz -d filename=true
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;the extra filename parameter is for stating that the URI is a file indeed.&lt;/P&gt;

&lt;P&gt;I hope this helps.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2016 22:13:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Installation/Trying-to-install-an-app-via-the-REST-API-why-am-I-getting-error/m-p/252155#M3887</guid>
      <dc:creator>mchheda_splunk</dc:creator>
      <dc:date>2016-09-09T22:13:35Z</dc:date>
    </item>
  </channel>
</rss>

