Menu

#1963 Circular Reference failures when creating Configuration items.

3.0.0
closed
nobody
None
User Interface
High
3.0.0
defect
2021-07-06
2021-04-19
R Panton
No

Hi, After upgrading from 2.7.1 to 3.0.0 Beta I note the following:
In trying to create most infrastructure items the following error occurs:
Error: Error: Circular dependencies between the fields!
Array
(
[managementip_id] => Array
(
[1] => managementip_id
)

)

Discussion

  • Edward

    Edward - 2021-04-22

    Me too, i have error it.
    When i try to create ticket request, system show error:
    Error: Error: Circular dependencies between the fields!
    Array
    (
    [reporter_id] => Array
    (
    [0] => reporter_id
    )

    )

     
  • Jeffrey Bostoen

    Jeffrey Bostoen - 2021-04-22

    With my geometry extension, I have this error in 3.0.0 when I try to add a layer source to a map (AttributeLinkedSetIndirect)

    `Fatal error: Uncaught Error: Call to a member function add() on null in C:\xampp\htdocs\itop-3.0.0-beta\web\application\uiwizard.class.inc.php:321 Stack trace: #0 C:\xampp\htdocs\itop-3.0.0-beta\web\application\uiwizard.class.inc.php(43): UIWizard->ComputeWizardStructure() #1 C:\xampp\htdocs\itop-3.0.0-beta\web\application\wizardhelper.class.inc.php(283): UIWizard->__construct(NULL, 'lnkOLSourceToOL...') #2 C:\xampp\htdocs\itop-3.0.0-beta\web\application\wizardhelper.class.inc.php(65): WizardHelper->GetLinkedWizardStructure(Object(AttributeLinkedSetIndirect)) #3 c:\xampp\htdocs\itop-3.0.0-beta\web\pages\ajax.render.php(174): WizardHelper->GetTargetObject() #4 {main} thrown in C:\xampp\htdocs\itop-3.0.0-beta\web\application\uiwizard.class.inc.php on line 321`
    
    iTop: An error occurred, check server error log for more information.
    

    Is this a known issue somehow? Not sure what makes it different from other AttributeLinkedSetIndirect attributes.

    Sorry: I realized too late it's in the wrong forum and I can't move the post.

    The UIWizard gets constructed with a NULL value for page. Currently as far as I have seen, the wizard helper always calls UIWizard with a NULL value for $oPage.
    https://github.com/Combodo/iTop/blob/8dd96ea636a8f9b8045de31e76c53459f69d1c5f/application/wizardhelper.class.inc.php#L283

    Perhaps there's something wrong with my custom linked class (working in 2.7 though), but this error can certainly not popup since the page object is always null:

    $this->m_oPage->add(Dict::S('UI:Error:WizardCircularReferenceInDependencies'));
    

    Anyhow, if I uncomment that line about circular reference, my remaining "bad" fields is the friendlyname, which uses the two names of the object:

    Array ( [friendlyname] => Array ( [olsource_name] => [olmap_name] => ) )
    

    Relevant XML parts of this linked class:

                    <naming>
                        <attributes>
                            <attribute id="olsource_name"/>
                            <attribute id="olmap_name"/>
                        </attributes>
                    </naming>
    
    
                    <field id="olsource_id" xsi:type="AttributeExternalKey">
                        <sql>olsource_id</sql>
                        <on_target_delete>DEL_AUTO</on_target_delete>
                        <target_class>OLSource</target_class>
                        <is_null_allowed>false</is_null_allowed>
                    </field>
                    <field id="olsource_name" xsi:type="AttributeExternalField">
                        <extkey_attcode>olsource_id</extkey_attcode>
                        <target_attcode>name</target_attcode>
                    </field>
                    <field id="olmap_id" xsi:type="AttributeExternalKey">
                        <sql>olmap_id</sql>
                        <on_target_delete>DEL_AUTO</on_target_delete>
                        <target_class>OLMap</target_class>
                        <is_null_allowed>false</is_null_allowed>
                    </field>
                    <field id="olmap_name" xsi:type="AttributeExternalField">
                        <extkey_attcode>olmap_id</extkey_attcode>
                        <target_attcode>name</target_attcode>
                    </field>
    
     

    Last edit: Jeffrey Bostoen 2021-04-22
    • Jeffrey Bostoen

      Jeffrey Bostoen - 2021-04-28

      For me, this works as soon as I change the naming to use olsource_id and olmap_id
      However, in iTop 2.7 it works fine with olsource_name and olmap_name
      In this case, it seems to be related to using external fields in the naming

      I don't see significant differences in iTop 2.7.4 and iTop 3.0.0 beta in uiwizard.class.inc.php and wizardhelper.class.inc.php . Perhaps it occurs in another method?

      Anyhow, the UI Wizard still seems buggy, as I don't see where the "page" object would not be null.

      For me, the issue seems to be with the "friendlyname".
      With iTop 2.7.4, right above the while(count($aFields) > 0), if I output $aFields: it has no dependencies to olmap_name and olmap_source.
      With iTop 3.0.0 beta, it still has those two fields as a dependency.

       

      Last edit: Jeffrey Bostoen 2021-04-28
      • Jeffrey Bostoen

        Jeffrey Bostoen - 2021-04-29

        Further debugging: the result of $oAttDef->GetPrerequisiteAttributes() in the "now computes the steps to fill the optional fields" loop seems to give different results in iTop 2.7.4 vs iTop 3.0.0 for the "friendlyname" attribute.

        In iTop 2.7.4, it's empty.
        In iTop 3.0.0, it lists the olsource_name and olmap_name.

        In attributedef, there do not seem to be changes to this method for AttributeFriendlyName. Have things changed on "depends on"?

         

        Last edit: Jeffrey Bostoen 2021-04-29
  • Guillaume Lajarige

    Hi, can you give us a step by step procedure to reproduce this? I couldn't on my 3.0 instance when creating a user request or a cluster.

    Also can you give us your webserver (eg. Apache, nginx) and your PHP version?

    Thanks!
    Guillaume

     

    Last edit: Guillaume Lajarige 2021-04-22
    • R Panton

      R Panton - 2021-04-22

      HI Guillaume,
      These are the steps.
      1. Upgrade to version 3 from 2.7.1
      2. Try to create an infrastructure item such as a network device or server, or San Switch
      If this is done we get Array

      Array
      (
      [managementip_id] => Array
      (
      [1] =>managementip_id
      )

      )

       

      Last edit: R Panton 2021-04-22
      • Guillaume Lajarige

        Thanks for the steps, unfortunately I still cannot reproduce... 😕

         
        • Jeffrey Bostoen

          Jeffrey Bostoen - 2021-04-25

          I'm assuming this is used in combination with (latest version?) of TeemIP

           
  • Jeffrey Bostoen

    Jeffrey Bostoen - 2021-04-22

    I assume it happens when for naming an ID field is used.

    The actual error is because it tries to render the error message on a non-existing (always NULL for now) page object.

     

    Last edit: Jeffrey Bostoen 2021-04-22
    • R Panton

      R Panton - 2021-04-23

      How can we correct this then?

       
    • Guillaume Lajarige

      Hello Jeffrey, I saw your comment but how can it not happen on our instances, I don't get it. I didn't checked the value of $oPage yet, but I can't make it crash.

       
  • Jeffrey Bostoen

    Jeffrey Bostoen - 2021-04-23

    Is there a way to verify if we're even using the exact same beta version?

    I think it happens on certain classes with certain ID fields in the naming (possible AttributeExternalKey or perhaps AttributeExternalField)

     
    • R Panton

      R Panton - 2021-04-26

      I am using beta 3.0.0 - 7312

       
  • Guillaume Lajarige

    You can get your iTop version in the backoffice by clicking the user icon at the bottom of the navigation menu, then "About iTop".

     
  • Guillaume Lajarige

    • status: new --> accepted
     
  • Guillaume Lajarige

    Hello everyone,

    This has been tracked in our bug tracker (no fix yet) for it to be fixed before the 3.0 RC.
    Thank you very much for your feedbacks!

    Cheers,
    Guillaume

     
  • Romain Quetiez

    Romain Quetiez - 2021-04-30

    Hi Jeffrey.
    Thanks to your investigations, I found out that I could reproduce with a minimal customization.
    In my case, I have changed the friendly name of the class lnkContactToTeam so that it relies on contact_id_friendlyname + team_id_friendlyname, rather than contact_id + team_id.
    The associated use case is : edit or create a person, change the organization... the location attribute is being reloaded... nothing happens and error.log exhibits the exact same error as the one you encountered:

    Uncaught Error: Call to a member function add() on null in C:\wamp64\www\tests\iTop-3.0.0-beta-7312\web\application\uiwizard.class.inc.php:321
    
     
  • Guillaume Lajarige

    Hello everybody,

    We committed a fix for the minimal custo Romain talked about. If one of you is confortable enough with GitHub and cloning the latest code base, could you try again and tell us if the issue is still there ?

    Thanks!
    Guillaume

     
    🎉
    1
  • Guillaume Lajarige

    Hello everyone,

    This should be resolved and part of the beta2 that just rolled out!

    Cheers,
    Guillaume

     
  • Guillaume Lajarige

    • status: accepted --> closed
     

Log in to post a comment.