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 @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
                  • theAeonT Offline
                    theAeon @olivierlambert
                    last edited by

                    Its the 5.66.1 release commit-so its damn close.

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

                      Hi @theaeon, this should already be fixed, could you check the full log for that error in Settings > Logs? It should give you more details.

                      theAeonT 1 Reply Last reply Reply Quote 2
                      • theAeonT Offline
                        theAeon @pdonias
                        last edited by

                        Same as the OP.

                        netbox.synchronize
                        {
                          "pools": [
                            "582481e9-4e61-a060-6c09-530e35606504"
                          ]
                        }
                        {
                          "message": "ipaddr: the address has neither IPv6 nor IPv4 format",
                          "name": "Error",
                          "stack": "Error: ipaddr: the address has neither IPv6 nor IPv4 format
                            at Object.parse (/opt/xo/xo-builds/xen-orchestra-202112260451/packages/xo-server-netbox/node_modules/ipaddr.js/lib/ipaddr.js:929:19)
                            at Netbox.#synchronize (/opt/xo/xo-builds/xen-orchestra-202112260451/packages/xo-server-netbox/src/index.js:560:35)
                            at Api.callApiMethod (file:///opt/xo/xo-builds/xen-orchestra-202112260451/packages/xo-server/src/xo-mixins/api.mjs:307:20)"
                        }
                        pdoniasP 1 Reply Last reply Reply Quote 0
                        • pdoniasP Offline
                          pdonias Vates 🪐 XO Team @theAeon
                          last edited by

                          Thanks @theaeon. Could you check if some of your VMs on that pool have invalid IP addresses? You can do that from the home page by filtering only the VMs on that pool (Pools selector at the top of the page) and expanding the details for all the VMs to show the IP addresses (hamburger button at the top right hand corner). Each IP address must be in its own blue rectangle and with the correct format for either IPv4 or IPv6. Let me know if this is too hard to check, we'll find another way.

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

                            @pdonias One of my VMs isn't reporting an IP address. Do you think that could do it?

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

                              @theaeon No, that's a normal case and it's handled properly. The issue would be if one of the IPs has 2 IPs in the same field separated by a white space like: "x.x.x.x y.y.y.y", or if the field is just empty or anything else that doesn't look like a proper IP address.

                              If you want to check the addresses more thoroughly, you can install xo-cli with npm i -g xo-cli, log into your XO with xo-cli --register <XO-Server URL> <username> <password> and then run xo-cli --list-objects --addresses type=VM \$pool=<pool ID>.

                              1 Reply Last reply Reply Quote 0
                              • vilhelmV Offline
                                vilhelm
                                last edited by

                                Sorry for bringing up such an old topic, but I have ran into the same issue (when syncing a certain pool to Netbox). I've used xo-cli --list-objects --addresses type=VM \$pool=<uuid of pool with problems> to get an idea of the data it's trying to import. There are no instances where there are two IP-addresses seperated by a space (like x.x.x.x y.y.y.ythe ) but there is one instance with an empty value.

                                  {
                                    "addresses": {
                                      "0/ipv4/0": "x.x.x.x",
                                      "1/ipv4/0": "y.y.y.y",
                                      "2/ipv4/0": ""
                                    }
                                  },
                                

                                I'm running Xen Orchestra commit 667d0 (xo-server 5.96.0 and xo-web 5.97.2).

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

                                  Hi!

                                  Thanks for the report 🙂 Please update to the latest commit available, and confirm you still have the issue. I'm adding @pdonias in the loop 🙂

                                  vilhelmV 1 Reply Last reply Reply Quote 0
                                  • vilhelmV Offline
                                    vilhelm @olivierlambert
                                    last edited by

                                    @olivierlambert Alright, I upgraded to Xen Orchestra commit 82452 but I am still experiencing the same issue.

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

                                      Hi @vilhelm, could you try on the branch empty-ip and let us know if you still have the issue please?

                                      vilhelmV 1 Reply Last reply Reply Quote 0
                                      • vilhelmV Offline
                                        vilhelm @pdonias
                                        last edited by

                                        @pdonias Thanks a lot, this solved the problem!

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

                                          @vilhelm Thanks for testing, we'll fix it in master 🙂

                                          pdoniasP 1 Reply Last reply Reply Quote 1
                                          • 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 olivierlambert marked this topic as a question on
                                            • olivierlambertO olivierlambert has marked this topic as solved on
                                            • T ThasianXi referenced this topic on
                                            • First post
                                              Last post