Uploaded image for project: 'Red Hat OpenShift Dev Spaces (formerly CodeReady Workspaces) '
  1. Red Hat OpenShift Dev Spaces (formerly CodeReady Workspaces)
  2. CRW-1509

'crwctl auth:login' failed to login to CRW with OAuth support

XMLWordPrintable

    • False
    • False
    • Undefined

      https://main-jenkins-csb-crwqe.apps.ocp4.prod.psi.redhat.com/job/CodereadyWorkspaces/job/e2e/job/complex/job/crw-miscellaneous-tests/10/consoleFull

       + /mnt/hudson_workspace/workspace/CodereadyWorkspaces/e2e/complex/crw-miscellaneous-tests/crwctl/bin/crwctl auth:login -u admin -p admin --chenamespace=crw-miscellaneous-tests
       › Current Kubernetes context: 'default/api-ocp45-crw-qe-com:6443/admin'
       (node:10048) Warning: Setting the NODE_TLS_REJECT_UNAUTHORIZED environment variable to '0' makes TLS connections and HTTPS requests insecure by disabling certificate verification.
       Using https://codeready-crw-miscellaneous-tests.apps.ocp45.crw-qe.com/api server API URL to log in
        ›   Error: Error: Failed to get access token from  http://keycloak.crw-miscellaneous-tests.svc:8080/auth/realms/codeready/protocol/openid-connect/token. Cause: getaddrinfo ENOTFOUND   keycloak.crw-miscellaneous-tests.svc
        ›   Command auth:login failed. Error log: /home/hudson/.cache/crwctl/error.log 
        ›   CodeReady Workspaces logs: /tmp/crwctl-logs/1611306826460
      
      .cache/crwctl/error.log
      2021-01-22T12:20:14.215Z Error: Error: Failed to get access token from http://keycloak.crw-miscellaneous-tests.svc:8080/auth/realms/codeready/protocol/openid-connect/token. Cause: getaddrinfo ENOTFOUND keycloak.crw-miscellaneous-tests.svc
      2021-01-22T12:20:14.215Z Command auth:login failed. Error log: /home/ndp/.cache/crwctl/error.log CodeReady Workspaces logs: /tmp/crwctl-logs/1611318005715
      2021-01-22T12:20:14.215Z     at Object.error (~/tmp/crwctl-linux-x64/crwctl/node_modules/@oclif/errors/lib/index.js:22:17)
      2021-01-22T12:20:14.215Z     at Login.error (~/tmp/crwctl-linux-x64/crwctl/node_modules/@oclif/command/lib/command.js:57:23)
      2021-01-22T12:20:14.215Z     at Login.<anonymous> (~/tmp/crwctl-linux-x64/crwctl/lib/commands/auth/login.js:120:22)
      2021-01-22T12:20:14.215Z     at Generator.throw (<anonymous>)
      2021-01-22T12:20:14.215Z     at rejected (~/tmp/crwctl-linux-x64/crwctl/node_modules/tslib/tslib.js:108:69)
      

       

      Issue has been reproduced on QE OCP 3.11 and QE OCP 4.5.

      "crwctl auth:login" does work on QE OCP 4.6.

       
      crwctl/2.6.0-RC-01-21-quay.3d6c220 linux-x64 node-v12.18.2: https://main-jenkins-csb-crwqe.apps.ocp4.prod.psi.redhat.com/job/CRW_CI/job/crwctl_2.6/lastSuccessfulBuild/artifact/codeready-workspaces-chectl/dist/channels/quay/crwctl-linux-x64.tar.gz
       
      Update: "http" protocol were also used when communicate with plugin-registry pod:

      Setting up "useInternalClusterSVCNames: false" in Custom Resource fixes login.

            abazko Anatolii Bazko
            dnochevn Dmytro Nochevnov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: