Menu

Failed to process class 'Model', from '/var/www/html/itop/datamodels/2.x/itop-config-mgmt': Field: 'type', (type: AttributeEnum), missing (or empty) mandatory tag 'code' under the tag 'value'

2022-12-11
2023-01-09
  • Andres Cubas

    Andres Cubas - 2022-12-11

    Hello! I am attempting to change the class "Model" to have an extra type value through a custom extension. However, I am getting the following error when going through the setup wizard to install my extension. I have been able to come up with a simple example that yields the same error. The following are the steps to recreate it:

    1. Go to https://www.itophub.io/wiki/page?id=3_0_0:customization:datamodel#creating_a_module to generate a sample custom extension with the default values in the form.
    2. Unzip it and add 'itop-bridge-cmdb-ticket/3.0' as one of the dependencies in the module.sample-extension.php
    3. Add the following code to the datamodel.sample-extension.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <itop_design xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="1.6">
      <constants>
      </constants>
      <classes>
        <class id="Model" _delta="must_exist">
          <fields _delta="must_exist">
            <field id="type" _define="must_exist">
              <values _define="must_exist">
                <value id="example" _define="define"><code>example</code></value>
              </values>
            </field>
          </fields>
        </class>  
      </classes>
      <menus>
      </menus>
      <user_rights>
        <groups>
        </groups>
        <profiles>
        </profiles>
      </user_rights>
    </itop_design>
    

    uname output: Linux *** 4.15.0-196-generic #207-Ubuntu SMP Thu Oct 27 21:24:58 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux

    iTop version 3.0.2-1-9957 built on 2022-09-12 14:08:58
    MySQL: 5.7.40-0ubuntu0.18.04.1
    PHP: 7.4.32

    I tried using the up to date ToolKit to see what is wrong with my data model, but I am getting a similar output to https://sourceforge.net/p/itop/discussion/customizing-itop/thread/8203a6f142/ . The following is the actual output when I actually check for consistency with ToolKit:

    Class Organization
    Attribute 'status' (object state) has an allowed value (active) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Attribute 'status' (object state) has an allowed value (inactive) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Attribute 'status' (object state) has a state () which is not an allowed value (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Class Location
    Attribute 'status' (object state) has an allowed value (active) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Attribute 'status' (object state) has an allowed value (inactive) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Attribute 'status' (object state) has a state () which is not an allowed value (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Class Contact
    Attribute 'status' (object state) has an allowed value (active) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Attribute 'status' (object state) has an allowed value (inactive) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Attribute 'status' (object state) has a state () which is not an allowed value (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Class Document
    Attribute 'status' (object state) has an allowed value (draft) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Attribute 'status' (object state) has an allowed value (obsolete) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Attribute 'status' (object state) has an allowed value (published) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Attribute 'status' (object state) has a state () which is not an allowed value (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Class PhysicalDevice
    Attribute 'status' (object state) has an allowed value (implementation) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Attribute 'status' (object state) has an allowed value (obsolete) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Attribute 'status' (object state) has an allowed value (production) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Attribute 'status' (object state) has an allowed value (stock) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Attribute 'status' (object state) has a state () which is not an allowed value (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Class ApplicationSolution
    Attribute 'status' (object state) has an allowed value (active) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Attribute 'status' (object state) has an allowed value (inactive) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Attribute 'status' (object state) has a state () which is not an allowed value (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Class BusinessProcess
    Attribute 'status' (object state) has an allowed value (active) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Attribute 'status' (object state) has an allowed value (inactive) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Attribute 'status' (object state) has a state () which is not an allowed value (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Class SoftwareInstance
    Attribute 'status' (object state) has an allowed value (active) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Attribute 'status' (object state) has an allowed value (inactive) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Attribute 'status' (object state) has a state () which is not an allowed value (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Class Group
    Attribute 'status' (object state) has an allowed value (implementation) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Attribute 'status' (object state) has an allowed value (obsolete) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Attribute 'status' (object state) has an allowed value (production) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Attribute 'status' (object state) has a state () which is not an allowed value (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Class Contract
    Attribute 'status' (object state) has an allowed value (implementation) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Attribute 'status' (object state) has an allowed value (obsolete) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Attribute 'status' (object state) has an allowed value (production) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Attribute 'status' (object state) has a state () which is not an allowed value (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Class Service
    Attribute 'status' (object state) has an allowed value (implementation) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Attribute 'status' (object state) has an allowed value (obsolete) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Attribute 'status' (object state) has an allowed value (production) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Attribute 'status' (object state) has a state () which is not an allowed value (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Class ServiceSubcategory
    Attribute 'status' (object state) has an allowed value (implementation) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Attribute 'status' (object state) has an allowed value (obsolete) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Attribute 'status' (object state) has an allowed value (production) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Attribute 'status' (object state) has a state () which is not an allowed value (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Class VirtualDevice
    Attribute 'status' (object state) has an allowed value (implementation) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Attribute 'status' (object state) has an allowed value (obsolete) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Attribute 'status' (object state) has an allowed value (production) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Attribute 'status' (object state) has an allowed value (stock) which is not a known state (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Attribute 'status' (object state) has a state () which is not an allowed value (You may define its allowed_values property as [new ValueSetEnum('')], or reconsider the list of states)
    Class RemoteApplicationConnection
    Unknown attribute code 'application' in the list of reconciliation keys (Expecting a value in name, remoteapplicationtype_id, environment, url, actions_list, finalclass, friendlyname, remoteapplicationtype_id_friendlyname)
    Class RemoteiTopConnection
    Unknown attribute code 'application' in the list of reconciliation keys (Expecting a value in name, remoteapplicationtype_id, environment, url, actions_list, auth_user, auth_pwd, version, finalclass, friendlyname, remoteapplicationtype_id_friendlyname)
    

    Finally, when I attempt to go through the installation wizard, the following error arrizes:
    Failed to process class 'Model', from '/var/www/html/itop/datamodels/2.x/itop-config-mgmt': Field: 'type', (type: AttributeEnum), missing (or empty) mandatory tag 'code' under the tag 'value'

    I hope I have been clear with how to reproduce my error. If I did leave something out, please let me know. 👍

     
  • Pierre Goiffon

    Pierre Goiffon - 2023-01-09

    Hello,

    The Model class is defined in the itop-config-mgmt module (datamodels/2.x/itop-config-mgmt/datamodel.itop-config-mgmt.xml), so that should be this one you would add as a dependency to your module.

    You did set an XML version 1.6, but as you're on iTop 3.0 you should set a 3.0 XML version. Note this version adds a change in the AttributeEnum type (the one used for the Model.type field). IN your XML you are using the new 3.0 version structure, so this causes the error you're seeing.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.