Survey banner
The Dataiku Community is moving to a new home! Some short term disruption starting next week: LEARN MORE

Create Project Macro - Ambiguous componentId Error

Solved!
Dominic-S
Level 3
Create Project Macro - Ambiguous componentId Error

Hi,

  I have a Create Project Macro, which will give me the following error when I have a dynamic select parameter in runnable.json. If I changed the param to static select, it will work.

  What am I missing? 

  Thanks,

Error Message:

"message": {
"callPath": "/api/plugins/call-python-do",
"auditTopic": "generic",
"msgType": "plugin-python-do",
"componentId": "template-odf",
"authSource": "USER_FROM_UI",
"pluginId": "odf-template",
"errorType": "com.dataiku.dip.CodedRuntimeException",
"errorMsg": "Ambiguous componentId template-odf matches 2 components",
},

 

Code fragments:

runnable.json:

    "paramsPythonSetup": "template_choices.py",
        {
            "name": "owner",
            "label": "Owner",
            "type": "SELECT",
            "getChoicesFromPython": true,
            "mandatory": true
        },
 
do method in resource/template_choices.py:
 
import dataiku
def do(payload, config, plugin_config, inputs😞
    dss_client = dataiku.api_client()
    users = dss_client.list_users()
    user_array = []
    if payload.get('parameterName') == 'owner':
        for user in users:
            login_user = dss_client.get_user(user['login'])
            user_array.append({'value':login_user,'label':login_user})

    return {"choices": user_array}
 

  

 

0 Kudos
1 Solution
AlexT
Dataiker

Hi @Dominic-S ,
The error :Ambiguous componentId template-odf matches 2 components", suggests you have multiple component with the same ID "template-odf". Based on the code snippets provided alone, I can't see where this is occurring you may have other component types with the same id.
As I am unable to create 2 components with the same ID of the same type from the UI. 

Could you please create a support ticket with a zip of the plugin so we can debug further?
Thanks,


View solution in original post

0 Kudos
5 Replies
AlexT
Dataiker

Hi @Dominic-S ,
The error :Ambiguous componentId template-odf matches 2 components", suggests you have multiple component with the same ID "template-odf". Based on the code snippets provided alone, I can't see where this is occurring you may have other component types with the same id.
As I am unable to create 2 components with the same ID of the same type from the UI. 

Could you please create a support ticket with a zip of the plugin so we can debug further?
Thanks,


0 Kudos
Dominic-S
Level 3
Author

Hi Alex,

   Thanks for your reply.

What puzzles me is that if I hard-coded the select's choices, instead of using "getChoicesFromPython", I will not get that error.

  Thanks,

0 Kudos
Dominic-S
Level 3
Author

Hi Alex,

    How can I find out the componentId, I am able to find the pluginId from plugin.json, but I don't know where I can find the component Id from either runnable.json or connector.json

  Thanks

0 Kudos
AlexT
Dataiker

The component ID is the one defined blow it create a folder with that id 

Screenshot 2023-07-11 at 5.00.51 PM.pngScreenshot 2023-07-11 at 5.00.44 PM.png

As mentioned I thin it would be easiest if you can submit a support ticket with the current export of the plugin and your confirming your DSS, to help us understand and reproduce this. 

0 Kudos
Dominic-S
Level 3
Author

Hi Alex,

  I will submit a support ticket as you suggested.

  Thanks

0 Kudos