XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Netbox Plugin: Error: ipaddr: the address has neither IPv6 nor IPv4 format

    Scheduled Pinned Locked Moved Solved Xen Orchestra
    bugsblocked
    33 Posts 5 Posters 8.1k Views 4 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • N Offline
      notscottsmith
      last edited by marcungeschikts

      xo-server 5.80.0
      xo-web 5.84.0
      

      Expected behavior:
      VMs to synchronise with the configured netbox instance
      Current behavior

      Error in logs saying that an IP doesn't fit the format expected (sync works otherwise, this is just to do with the IPs).

      xo-server | 2021-07-26T05:14:11.136Z xo:api WARN admin@admin.net | netbox.synchronize(...) [13s] =!> Error: ipaddr: the address has neither IPv6 nor IPv4 format
      

      This error log isn't sufficient to be able to troubleshoot the problem it's complaining about. More information is needed to figure out where the problem lies.

      Can a higher level of logging be enabled within XO? Has anyone else come across this? Am i able to run an individual VM for synchronisation or run it manually via CLI to try and debug the issue?

      1 Reply Last reply Reply Quote 0
      • pdoniasP Offline
        pdonias Vates 🪐 XO Team @pdonias
        last edited by

        @vilhelm That's fixed: https://github.com/vatesfr/xen-orchestra/pull/6328. Thanks again for the report 🙂

        pdonias opened this pull request in vatesfr/xen-orchestra

        closed fix(xo-server/xapi-object-to-xo): handle guest metrics reporting empty IP field #6328

        1 Reply Last reply Reply Quote 2
        • olivierlambertO Offline
          olivierlambert Vates 🪐 Co-Founder CEO
          last edited by

          And what have you entered in the netbox plugin text fields?

          N 1 Reply Last reply Reply Quote 0
          • N Offline
            notscottsmith @olivierlambert
            last edited by

            @olivierlambert Configuration info that works successfully. As said, the plugin works to synchronise the VMs and their details across. This is just for the IPs, it seems.

            1 Reply Last reply Reply Quote 0
            • olivierlambertO Offline
              olivierlambert Vates 🪐 Co-Founder CEO
              last edited by

              Okay so what are the IPs returned in your XO UI?

              N 1 Reply Last reply Reply Quote 0
              • N Offline
                notscottsmith @olivierlambert
                last edited by

                @olivierlambert Every IP that is visible to XO (there might be one or two which can't be seen purely because the guest tools aren't working, but they're not malformed) is formatted correctly.

                I've included a screen grab of part of it to show how XO is rendering it.

                11d69f50-7952-4768-bf3c-0dec17450c61-image.png

                Is there a way I can run this manually via cli to see some more data or pick out an individual VM to see which one is causing the hiccup?

                1 Reply Last reply Reply Quote 0
                • olivierlambertO Offline
                  olivierlambert Vates 🪐 Co-Founder CEO
                  last edited by

                  Yes, you can use xe, eg xe vm-param-get param-name=networks uuid=<VM UUID>. This would return all IPs known by Xen tools.

                  N 1 Reply Last reply Reply Quote 0
                  • N Offline
                    notscottsmith @olivierlambert
                    last edited by

                    @olivierlambert Yes but that's not going to tell me what the netbox plugin is erroring on. That command returns data which looks correctly formatted with no issue but there is something somewhere in it which is causing a problem.

                    I meant is there a way for me to run the netbox plugin sync by hand in cli or VM by VM to see where the problem occurs.

                    Or, barring that, a way to increase the logging level so that I can see with more detail what uuid at least, it's failing on and debug from there.

                    1 Reply Last reply Reply Quote 0
                    • olivierlambertO Offline
                      olivierlambert Vates 🪐 Co-Founder CEO
                      last edited by

                      I'm not sure we can get more, it might be the way some IP are parsed. Pinging @pdonias

                      N 1 Reply Last reply Reply Quote 0
                      • N Offline
                        notscottsmith @olivierlambert
                        last edited by

                        @olivierlambert I did some digging and just added some extra logging to the script file and found the culprit:

                        2021-07-27T09:03:46.545Z xo:netbox INFO Parsing IP: 10.44.254.253 10.44.254.254

                        It's in interface that's listing two IPs together with a space between.

                        I've tried a couple of things to get it to ignore any like those that it finds but haven't been successful yet. You have already closed/fixed an issue I raised about this about a month ago so I'm not sure why I'm seeing it in this one, now. It's the 5.80 server.

                        1 Reply Last reply Reply Quote 0
                        • olivierlambertO Offline
                          olivierlambert Vates 🪐 Co-Founder CEO
                          last edited by

                          @pdonias does it sound to be the problem?

                          pdoniasP 1 Reply Last reply Reply Quote 0
                          • pdoniasP Offline
                            pdonias Vates 🪐 XO Team @olivierlambert
                            last edited by

                            @olivierlambert Most likely, yes. But it shouldn't be an issue anymore after this change (XO 5.60) so I don't understand why the error is still happening.

                            @notscottsmith Do you see those space-delimited IPs in the UI too?

                            N 1 Reply Last reply Reply Quote 0
                            • N Offline
                              notscottsmith @pdonias
                              last edited by

                              @pdonias Yea, it shows up like this:

                              55cadee6-7a65-411d-b9a0-bc15dd9ae234-image.png

                              pdoniasP 1 Reply Last reply Reply Quote 0
                              • pdoniasP Offline
                                pdonias Vates 🪐 XO Team @notscottsmith
                                last edited by

                                @notscottsmith Ok, could you run this inside XO's directory with the VM's host and its password:

                                ./packages/xen-api/dist/cli.js --au <HOST> root <HOST ROOT PASSWORD>
                                

                                It should start a CLI. And then run this with the VM's UUID:

                                > find({ uuid: '<VM UUID>' }).$guest_metrics.networks
                                
                                N 1 Reply Last reply Reply Quote 0
                                • N Offline
                                  notscottsmith @pdonias
                                  last edited by

                                  @pdonias

                                  {
                                    '2/ip': '10.44.254.253 10.44.254.254',
                                    '2/ipv4/0': '10.44.254.253 10.44.254.254',
                                    '1/ip': '172.16.130.25',
                                    '1/ipv4/0': '172.16.130.25',
                                    '0/ip': '10.1.254.238',
                                    '0/ipv4/0': '10.1.254.238'
                                  }
                                  
                                  pdoniasP 1 Reply Last reply Reply Quote 0
                                  • pdoniasP Offline
                                    pdonias Vates 🪐 XO Team @notscottsmith
                                    last edited by

                                    @notscottsmith So apparently, the old protocol also adds x/ipv4/x fields with space-delimited IPs. That's what causing the issue, so we'll have to handle them too. Thanks!

                                    N 1 Reply Last reply Reply Quote 0
                                    • N Offline
                                      notscottsmith @pdonias
                                      last edited by

                                      @pdonias

                                      So I've dug into the issue and written a few workarounds which will tide me over until a fix comes out - appreciate your work on this.

                                      I've added a few features in, too. The plugin now:

                                      • Allows the choice of whether IPv4, IPv6 or Both types of IPs are synchronised
                                      • Allows you to enter in tags which will deem a VM to be "ignored" if they have one of these tags
                                      • Allows you to enter in text which if the name label contains it, it will also be ignored (we have a use case where we have several VMs which are decommissioned but are kept in XCP for various reasons as well as our backup process which maintains a series of VMs with the prefix XCP-BACKUP, which we don't want kept in Netbox)
                                      • Allows you to configure the ID of the configured VRF in Netbox (if needed) that the particular IP ranges relate to
                                      • Synchronises the platform that the VM is running
                                      • Brings across all the tags and puts them into Netbox (this is for our monitoring solution, OpenNMS, which uses Netbox to generate its requisitions and categories to automate the provisioning process)

                                      I will submit these changes back into the Git repo tomorrow when I'm back in the office and you can have a look and see what you want to use. 🙂

                                      theAeonT 1 Reply Last reply Reply Quote 3
                                      • theAeonT Offline
                                        theAeon @notscottsmith
                                        last edited by

                                        @notscottsmith @pdonias

                                        any updates on this? Currently running into this error myself.

                                        1 Reply Last reply Reply Quote 0
                                        • olivierlambertO Offline
                                          olivierlambert Vates 🪐 Co-Founder CEO
                                          last edited by

                                          Are you up to date? I think we fixed that already 🤔

                                          theAeonT 1 Reply Last reply Reply Quote 0
                                          • theAeonT Offline
                                            theAeon @olivierlambert
                                            last edited by theAeon

                                            5c8e37d9-f197-403f-85d3-3281ebe65afe-image.png 9791c84c-d46b-446b-a401-3ebb28a4efe5-image.png

                                            I think so? Unless my script isn't updating the plugins, which is totally possible.

                                            edit: quick look at github says my plugins are fine

                                            1 Reply Last reply Reply Quote 0
                                            • olivierlambertO Offline
                                              olivierlambert Vates 🪐 Co-Founder CEO
                                              last edited by

                                              Not the latest commit but I don't think it matters in your case. @pdonias any idea?

                                              theAeonT 1 Reply Last reply Reply Quote 1
                                              • First post
                                                Last post