Unknown error value is not legal

While creating new version,

sg.create(‘Version’, version_data)

get a ‘not legal’ error for this line:

version_data[‘sg_element’] = {‘type’: ‘Element’, ‘id’: data[‘element_id’], ‘name’: data[‘element_name’]}

Fault: API create() CRUD ERROR #6: Invalid field value, update failed [5 - Update failed for [Version.sg_element]: Value is not legal.]

Whereas for test purpose, This works :

version_data[‘sg_element’] = {‘type’: ‘Element’, ‘id’: 44436, ‘name’: ‘ABCD_V621K_HDRI.EXR’}

Any clue ? Also it has worked earlier in the day but not so now

What is the field type on your sg_element ?

CRUD ERROR #6: Invalid field value

seems to be hinting that what you’re putting in there is a different type?

1 Like

data[key] is returning None i would suspect. so the update failed. you should check your data queries with dictionary.get(“key”, None) and only pass them into your update_dict if the value is validated so… if its A. correct datatype (int for id) ect, and B. Not None