Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Support
  3. Cloudron CLI & 2FA

Cloudron CLI & 2FA

Scheduled Pinned Locked Moved Solved Support
clinodejs
8 Posts 3 Posters 1.5k Views 3 Watching
  • 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.
  • ghodgeonG Offline
    ghodgeonG Offline
    ghodgeon
    wrote on last edited by girish
    #1

    Hi, if I try to login locally to cloudron via the CLI with 2FA enabled, I only get the option to login with user/pass. Then it fails.

    The docs at cloudron login -h don't show how to proceed

    Failed to login: Cannot destructure property 'rejectUnauthorized' of 'options' as it is undefined.
    
    girishG 1 Reply Last reply
    0
    • ghodgeonG ghodgeon

      Hi, if I try to login locally to cloudron via the CLI with 2FA enabled, I only get the option to login with user/pass. Then it fails.

      The docs at cloudron login -h don't show how to proceed

      Failed to login: Cannot destructure property 'rejectUnauthorized' of 'options' as it is undefined.
      
      girishG Offline
      girishG Offline
      girish
      Staff
      wrote on last edited by girish
      #2

      @ghodgeon this is most likely a node version issue. You need atleast node 14 for the CLI. You can check your current version using node --version.

      ghodgeonG 1 Reply Last reply
      0
      • girishG girish

        @ghodgeon this is most likely a node version issue. You need atleast node 14 for the CLI. You can check your current version using node --version.

        ghodgeonG Offline
        ghodgeonG Offline
        ghodgeon
        wrote on last edited by
        #3

        @girish

        I do believe I'm on v16.9.1 -- I installed Node based on the instructions as I followed.

        1 Reply Last reply
        0
        • fbartelsF Offline
          fbartelsF Offline
          fbartels
          App Dev
          wrote on last edited by
          #4

          We have run into the same issue this morning. But running node 16.13.0-deb-1nodesource1 (which is current version from their repo).

          After a downgrade of the cloudron cli to 4.11.0 the login succeeded.

          girishG 1 Reply Last reply
          0
          • fbartelsF fbartels

            We have run into the same issue this morning. But running node 16.13.0-deb-1nodesource1 (which is current version from their repo).

            After a downgrade of the cloudron cli to 4.11.0 the login succeeded.

            girishG Offline
            girishG Offline
            girish
            Staff
            wrote on last edited by
            #5

            @fbartels What version of CLI did you downgrade from?

            The error message is coming from https://git.cloudron.io/cloudron/cloudron-cli/-/blob/master/src/actions.js#L310 . I think the actual exception is caused by the de-structuring in
            https://git.cloudron.io/cloudron/cloudron-cli/-/blob/master/src/actions.js#L255 . Strange, I don't see how options can ever be undefined.

                    const [error, result] = await safe(authenticate(adminFqdn, username, password, { rejectUnauthorized, askForTotpToken: false }));
                    if (error) return exit(`Failed to login: ${error.message}`);
            
            1 Reply Last reply
            0
            • girishG Offline
              girishG Offline
              girish
              Staff
              wrote on last edited by girish
              #6

              Oh found it, https://git.cloudron.io/cloudron/cloudron-cli/-/blob/master/src/actions.js#L267 is obviously wrong since it's missing an argument.

              1 Reply Last reply
              0
              • girishG Offline
                girishG Offline
                girish
                Staff
                wrote on last edited by girish
                #7

                @fbartels @ghodgeon I guess you have 2FA enabled? I can reproduce it with 2FA. (er, doh, i didn't see the title of this post).

                $ cloudron login my.cloudron.domain
                Existing token possibly expired: Invalid token. Use cloudron login again.
                Username: girish
                Password: *********
                Failed to login: Cannot destructure property 'rejectUnauthorized' of 'options' as it is undefined.
                
                1 Reply Last reply
                0
                • girishG Offline
                  girishG Offline
                  girish
                  Staff
                  wrote on last edited by
                  #8

                  I have pushed a new CLI version v4.12.7 that fixes this.

                  1 Reply Last reply
                  3
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Bookmarks
                  • Search