Error 500 trying to install plugin from Archive with API

wbezou
wbezou Registered Posts: 8 ✭✭✭

Hello,

I'm in the process of automating a complete installation of DataIku. While I'm almost done, I'm struggling with plugins install. I'm unable to use the ansible collection or the python API as I keep getting an error 500 from the server when trying to install a plugin from a zip archive (installing the same plugin through the GUI works fine).

the (very simple script, based on the API documentation):

from pprint import pprint
import dataikuapi
client = dataikuapi.DSSClient("http://localhost:10000/", "*******") 
future = client.install_plugin_from_archive('dss-plugin-ab-test-calculator-1.0.1.zip')
result = future.wait_for_result()
pprint(result)

the error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/dist-packages/dataikuapi/dssclient.py", line 1452, in _perform_http
    http_res.raise_for_status()
  File "/usr/local/lib/python3.8/dist-packages/requests/models.py", line 1024, in raise_for_status
    raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 500 Server Error: Server Error for url: http://localhost:10000//dip/publicapi/plugins/actions/installFromZip

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "test.py", line 6, in <module>
    future = client.install_plugin_from_archive('dss-plugin-ab-test-calculator-1.0.1.zip')
  File "/usr/local/lib/python3.8/dist-packages/dataikuapi/dssclient.py", line 286, in install_plugin_from_archive
    self._perform_json("POST", "/plugins/actions/installFromZip", files=files)
  File "/usr/local/lib/python3.8/dist-packages/dataikuapi/dssclient.py", line 1468, in _perform_json
    return self._perform_http(method, path,  params=params, body=body, files=files, stream=False, raw_body=raw_body).json()
  File "/usr/local/lib/python3.8/dist-packages/dataikuapi/dssclient.py", line 1459, in _perform_http
    raise DataikuException("%s: %s" % (ex.get("errorType", "Unknown error"), ex.get("detailedMessage", ex.get("message", "No message"))))
dataikuapi.utils.DataikuException: java.lang.Exception: Could not install the plugin

From what I understand, the server is replying with error 500, as I don't have many option to try on client side, I have absolutly no idea what is wrong ...

any help would be appreciated.

tested on dataiku 12.6.3 with latest python API


Operating system used: Ubuntu 20.04

Tagged:

Best Answer

  • wbezou
    wbezou Registered Posts: 8 ✭✭✭
    edited July 17 Answer ✓

    Sure, if you go in the documentation examples section, you can find related info on the method "install_plugin_from_archive" (here : Plugins - Dataiku Developer Guide )

    In the API documentation, there is no mention of this method in the plugins section.

    Finaly, in the dss_client.py code of the dataiku API, there is another method the "start_install_plugin_from_archve" who works with future and can be called with "wait_for_result"

    as such, the code in the ansible collection goes from

    if args.zip_file is not None:
         future = client.install_plugin_from_archive(args.zip_file)

    to

    if args.zip_file is not None:
        with open(args.zip_file,"rb") as f:
             future = client.start_install_plugin_from_archive(f)

    with an updated local collection, it works

Answers

Setup Info
    Tags
      Help me…