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

    sdn certs module

    Scheduled Pinned Locked Moved Xen Orchestra
    30 Posts 5 Posters 2.1k Views 2 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.
    • A Offline
      adriangabura
      last edited by

      Well the autogenerator dosn't work when you build from source. Apparently it lacks the said module. So how do I install the node-openssl-cert module so it works in yarn?

      1 Reply Last reply Reply Quote 0
      • BenjiReisB Offline
        BenjiReis Vates 🪐 XCP-ng Team
        last edited by

        That's strange, did you follow the official guide to build xen-orchestra from sources?
        All dependencies should be installed.

        1 Reply Last reply Reply Quote 0
        • BenjiReisB Offline
          BenjiReis Vates 🪐 XCP-ng Team
          last edited by

          I've just tried locally from sources and everything went fine.

          Can you try to call yarn and then yarn build at the root of xen-orchestra repository?

          Thanks

          1 Reply Last reply Reply Quote 0
          • A Offline
            adriangabura
            last edited by

            Ok, I'll try later today, thanks for the answers!

            1 Reply Last reply Reply Quote 0
            • A Offline
              adriangabura
              last edited by adriangabura

              Ok, I tried again, same thing. So I run sudo yarn start in xo-server directory. And I watch the logs while I try to use the certs autogenerator. This is what I get:

              2019-07-29T18:20:46.778Z - xo:xo-server:sdn-controller - [DEBUG] No cert-dir provided, using default self-signed certificates
              2019-07-29T18:20:46.780Z - xo:xo-server:sdn-controller - [DEBUG] No default self-signed certificates exists, creating them
              2019-07-29T18:20:47.611Z - xo:xo-server:sdn-controller - [ERROR] Error while generating CA private key
              { error: false }
              
              

              As I said it's not a problem per se, I'm just trying to figure out out of curiosity why it doesn't work.

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

                It could be something linked to your environment because it works on our side 😕

                But why? Hard to tell. That's exactly the main reason why we do pro support only on a controlled environment (XOA, Xen Orchestra virtual Appliance), because otherwise you could have tons of external factors that make it fails.

                Double check you are on latest master commit, ideally clone it from scratch and rebuild everything. Check your Node and npm version.

                1 Reply Last reply Reply Quote 0
                • BenjiReisB Offline
                  BenjiReis Vates 🪐 XCP-ng Team
                  last edited by

                  Hi,

                  I've managed to reproduce you're error. It's not a build issue.
                  A fix is coming right away, I'll post it here once it's merged into master so you can get it. 🙂

                  Thanks for the report.
                  Regards

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

                    @BenjiReis do you know the problematic commit in question?

                    1 Reply Last reply Reply Quote 0
                    • BenjiReisB Offline
                      BenjiReis Vates 🪐 XCP-ng Team
                      last edited by

                      Yes it's 5396b90695fbe2c7a5f56d72a94a208517b2d517 but its not its only modification so it can't just be reverted.
                      This is a really quick fix I can push a branch today and it can be used waiting for the merge.

                      E 1 Reply Last reply Reply Quote 1
                      • BenjiReisB Offline
                        BenjiReis Vates 🪐 XCP-ng Team
                        last edited by

                        Hi!

                        The fix is available on master. 🙂
                        You should be able to generate certificate now.

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

                          Well done 🙂

                          1 Reply Last reply Reply Quote 0
                          • A Offline
                            adriangabura
                            last edited by

                            Great! Your team proves just how legendary it is once again! Thank you!

                            1 Reply Last reply Reply Quote 0
                            • E Offline
                              eeldivad @BenjiReis
                              last edited by

                              @BenjiReis I'm having the same problem. When I leave cert-dir empty and turn on override-certs and click "Save Configuration" then it gives me this error. This is a fresh build from ronivay's github with nothing but the basics installed. See screenshots.

                              ENOENT: no such file or directory, open '/var/lib/xo-server/data/sdn-controller/client-cert.pem'

                              sdn.png

                              DanpD 1 Reply Last reply Reply Quote 0
                              • DanpD Offline
                                Danp Pro Support Team @eeldivad
                                last edited by

                                @eeldivad I suggest that you run this in an ssh session to monitor the logs and then retry saving the plugin settings --

                                journalctl -u xo-server -f -n 50

                                My guess would be some type of rights issue, but I don't see this same behavior on my XO from sources VM.

                                E 1 Reply Last reply Reply Quote 0
                                • E Offline
                                  eeldivad @Danp
                                  last edited by eeldivad

                                  @Danp I just checked the logs and it's the same I listed above. I installed this as non-root user with sudo rights and then i rebuilt the vm with root permissions. This is a fresh install on a fresh OS so must be a bug somewhere. The problem is it doesn't auto-generate the keys as it said it would if I don't specify a path. If I create those 3 key files in a folder and specify the path then it will save properly. But these are blank files I created as I'm not sure how to generate them myself with openssl. Does anyone happen to have the command to use? This is just a test lab so I don't want to deal with letsencrypt or external certificate authorities.
                                  Error: ENOENT: no such file or directory, open '/var/lib/xo-server/data/sdn-controller/client-cert.pem'

                                  DanpD 1 Reply Last reply Reply Quote 0
                                  • DanpD Offline
                                    Danp Pro Support Team @eeldivad
                                    last edited by

                                    @eeldivad Does the directory /var/lib/xo-server/data/sdn-controller/ exist on your VM? This directory is created for me if it doesn't already exist, and the three PEM files are stored there when I click Save Configuration.

                                    I still suspect that you are dealing with a rights issue.

                                    E 1 Reply Last reply Reply Quote 0
                                    • E Offline
                                      eeldivad @Danp
                                      last edited by

                                      @Danp the folder exists. I see 2 pem files there but client-cert.pem is missing. So it looks like it tried to create the 3 pem files but failed to create the client-cert.pem. Any suggestion?

                                      ls /var/lib/xo-server/data/sdn-controller
                                      ca-cert.pem client-key.pem

                                      DanpD 1 Reply Last reply Reply Quote 0
                                      • DanpD Offline
                                        Danp Pro Support Team @eeldivad
                                        last edited by

                                        @eeldivad It's possible that it won't recreate the missing file because the other two are present. I would remove them and then retry to process.

                                        E 1 Reply Last reply Reply Quote 0
                                        • E Offline
                                          eeldivad @Danp
                                          last edited by eeldivad

                                          @Danp i removed those 2 files and tried again. Now it hangs when I clicked on "Save configuration"
                                          I see this in the log when it's hanging. I waited at least 5 minutes during the hang. I also noticed those 2 files were recreated in the same folder /var/lib/xo-server/data/sdn-controller so my guess is it's hanging trying to create the 3rd file client-cert.pem

                                          Feb 16 19:59:25 xo-server[12428]: 2025-02-16T19:59:25.434Z xo:xo-server ERROR uncaught exception {
                                          Feb 16 19:59:25 xo-server[12428]: error: TypeError: Cannot read properties of undefined (reading 'toString')
                                          Feb 16 19:59:25 xo-server[12428]: at ReadFileContext.callback (/opt/xo/xo-builds/xen-orchestra-202502160214/node_modules/node-openssl-cert/index.js:3032:35)
                                          Feb 16 19:59:25 xo-server[12428]: at FSReqCallback.readFileAfterOpen [as oncomplete] (node:fs:300:13)
                                          Feb 16 19:59:25 xo-server[12428]: at FSReqCallback.callbackTrampoline (node:internal/async_hooks:130:17)
                                          Feb 16 19:59:25 xo-server[12428]: }

                                          E 1 Reply Last reply Reply Quote 0
                                          • E Offline
                                            eeldivad @eeldivad
                                            last edited by olivierlambert

                                            I restarted the service and see this error during start up

                                            Feb 16 20:14:25 systemd[1]: Started XO Server.
                                            Feb 16 20:14:26 xo-server[40452]: 2025-02-16T20:14:26.851Z xo:main INFO Configuration loaded.
                                            Feb 16 20:14:26 xo-server[40452]: 2025-02-16T20:14:26.871Z xo:main INFO Web server listening on https://[::]:80
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.276Z xo:main INFO Setting up /robots.txt → /opt/xo/xo-builds/xen-orchestra-202502160214/packages/xo-server/robots.txt
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.342Z xo:main INFO Setting up / → /opt/xo/xo-web/dist/
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.342Z xo:main INFO Setting up /v6 → /opt/xo/xo-builds/xen-orchestra-202502160214/@xen-orchestra/web/dist
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.418Z xo:plugin INFO register audit
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.419Z xo:plugin INFO register auth-github
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.419Z xo:plugin INFO register auth-google
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.420Z xo:plugin INFO register auth-ldap
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.420Z xo:plugin INFO register auth-oidc
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.420Z xo:plugin INFO register auth-saml
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.421Z xo:plugin INFO register backup-reports
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.421Z xo:plugin INFO register load-balancer
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.421Z xo:plugin INFO register netbox
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.421Z xo:plugin INFO register perf-alert
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.422Z xo:plugin INFO register sdn-controller
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.422Z xo:plugin INFO register transport-email
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.422Z xo:plugin INFO register transport-icinga2
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.423Z xo:plugin INFO register transport-nagios
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.423Z xo:plugin INFO register transport-slack
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.423Z xo:plugin INFO register transport-xmpp
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.424Z xo:plugin INFO register usage-report
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.424Z xo:plugin INFO register web-hooks
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.424Z xo:plugin INFO register test
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.425Z xo:plugin INFO register test-plugin
                                            Feb 16 20:14:27 xo-server[40452]: foobar
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.783Z xo:plugin INFO failed register test
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.783Z xo:plugin INFO Cannot read properties of undefined (reading 'default') {
                                            Feb 16 20:14:27 xo-server[40452]:   error: TypeError: Cannot read properties of undefined (reading 'default')
                                            Feb 16 20:14:27 xo-server[40452]:       at Xo.registerPlugin (file:///opt/xo/xo-builds/xen-orchestra-202502160214/packages/xo-server/src/index.mjs:369:18)
                                            Feb 16 20:14:27 xo-server[40452]:       at runNextTicks (node:internal/process/task_queues:60:5)
                                            Feb 16 20:14:27 xo-server[40452]:       at processImmediate (node:internal/timers:454:9)
                                            Feb 16 20:14:27 xo-server[40452]:       at process.callbackTrampoline (node:internal/async_hooks:130:17)
                                            Feb 16 20:14:27 xo-server[40452]: }
                                            Feb 16 20:14:27 xo-server[40452]: strict mode: required property "discoveryURL" is not defined at "#/anyOf/0" (strictRequired)
                                            Feb 16 20:14:27 xo-server[40452]: strict mode: missing type "object" for keyword "required" at "#/anyOf/1/properties/advanced" (strictTypes)
                                            Feb 16 20:14:27 xo-server[40452]: strict mode: required property "authorizationURL" is not defined at "#/anyOf/1/properties/advanced" (strictRequired)
                                            Feb 16 20:14:27 xo-server[40452]: strict mode: required property "issuer" is not defined at "#/anyOf/1/properties/advanced" (strictRequired)
                                            Feb 16 20:14:27 xo-server[40452]: strict mode: required property "userInfoURL" is not defined at "#/anyOf/1/properties/advanced" (strictRequired)
                                            Feb 16 20:14:27 xo-server[40452]: strict mode: required property "tokenURL" is not defined at "#/anyOf/1/properties/advanced" (strictRequired)
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.883Z xo:plugin INFO successfully register auth-google
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.883Z xo:plugin INFO successfully register auth-ldap
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.883Z xo:plugin INFO successfully register auth-oidc
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.883Z xo:plugin INFO successfully register auth-saml
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.883Z xo:plugin INFO successfully register netbox
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.883Z xo:plugin INFO successfully register transport-email
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.883Z xo:plugin INFO successfully register transport-icinga2
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.883Z xo:plugin INFO successfully register transport-nagios
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.883Z xo:plugin INFO successfully register transport-slack
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.883Z xo:plugin INFO successfully register transport-xmpp
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.883Z xo:plugin INFO successfully register usage-report
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.883Z xo:plugin INFO successfully register web-hooks
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.883Z xo:plugin INFO successfully register test-plugin
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.883Z xo:plugin INFO successfully register backup-reports
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.883Z xo:plugin INFO successfully register load-balancer
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.895Z xo:plugin INFO successfully register auth-github
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.895Z xo:plugin INFO successfully register audit
                                            Feb 16 20:14:27 xo-server[40452]: 2025-02-16T20:14:27.896Z xo:plugin INFO successfully register perf-alert
                                            Feb 16 20:14:28 xo-server[40452]: 2025-02-16T20:14:28.133Z xo:plugin INFO successfully register sdn-controller
                                            
                                            DanpD 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post