openshiftio / openshift.io

Red Hat OpenShift.io is an end-to-end development environment for planning, building and deploying modern applications.
https://openshift.io
97 stars 66 forks source link

Cannot create application: GitHub account not linked #4743

Open ppitonak opened 5 years ago

ppitonak commented 5 years ago
Issue Overview

It's not possible to create a new application in new space because UI looks like GitHub account is not linked

Expected Behaviour

User with linked GitHub account sees his account in Launcher's step "Authorize Git Provider'

Current Behaviour

crt_create_app

Steps To Reproduce
  1. create space
  2. create new SpringBoot HTTP application
Additional Information

Observed in these three jobs https://ci.centos.org/job/devtools-test-e2e-openshift.io-smoketest-us-east-1b-released/1506/console https://ci.centos.org/job/devtools-test-e2e-openshift.io-smoketest-us-east-1a-beta/2378/console https://ci.centos.org/job/devtools-test-e2e-openshift.io-smoketest-us-east-2a-released/1505/console

Although one job contains slightly different screenshot, all failed on the same line in test.

Browser logs contain this:

[15:08:47.186] SEVERE https://forge.api.openshift.io/api/services/git/user - Failed to load resource: the server responded with a status of 504 (Gateway Time-out)
[15:08:47.187] SEVERE https://forge.api.openshift.io/api/services/git/user - Failed to load resource: the server responded with a status of 504 (Gateway Time-out)
[15:08:47.187] SEVERE https://openshift.io/osio-ci-e2e-007/e2e-0129-1507-4295/applauncher/createapp/e2e-0129-1507-4295 - Access to XMLHttpRequest at 'https://forge.api.openshift.io/api/services/git/user' from origin 'https://openshift.io' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.

In all three cases the GitHub account was linked to the OSIO account because the following Jenkins jobs passed this point.

ppitonak commented 5 years ago

@gastaldi please have a look

https://ci.centos.org/job/devtools-test-e2e-openshift.io-smoketest-us-east-1a-released/1511/console https://ci.centos.org/job/devtools-test-e2e-openshift.io-smoketest-us-east-1a-beta/2390/console

gastaldi commented 5 years ago

@ppitonak seems to have been caused by instabilities in the cluster? Can you tell if this is still happening ?

ppitonak commented 5 years ago
  1. It doesn't matter if it was caused by instabilities of the cluster. You need to find the root cause and handle errors in your code properly. UX is not good enough right now.
  2. Yes, it's still happening
gastaldi commented 5 years ago

There is not much we can do when a Gateway Timeout happens since in this case the Backend is never reached. The UI must handle and fail properly when this happens

ppitonak commented 5 years ago

I understand, please sync with UI team.

gastaldi commented 5 years ago

@ppitonak issue https://github.com/fabric8-launcher/ngx-launcher/issues/566 created. @sbose78 can you please assign to someone in the UI team to work on it?

ppitonak commented 5 years ago

https://ci.centos.org/job/devtools-test-e2e-openshift.io-smoketest-us-east-1a-released/1517/console

ppitonak commented 5 years ago

https://ci.centos.org/job/devtools-test-e2e-openshift.io-smoketest-us-east-2a-released/1523/console

ppitonak commented 5 years ago

http://artifacts.ci.centos.org/devtools/e2e/devtools-test-e2e-prod-preview.openshift.io-smoketest-pr-us-east-2a-released/5855 http://artifacts.ci.centos.org/devtools/e2e/devtools-test-e2e-openshift.io-smoketest-us-east-2a-released/1581 http://artifacts.ci.centos.org/devtools/e2e/devtools-test-e2e-openshift.io-smoketest-us-east-2-released/1581 http://artifacts.ci.centos.org/devtools/e2e/devtools-test-e2e-openshift.io-smoketest-us-east-2-released/1573

christianvogt commented 5 years ago

@vikram-raj what changes did you do here? The latest screenshot failure looks the same as the original screenshot in the description.

vikram-raj commented 5 years ago

@christianvogt Initially it was failing because of the timeout error from the backend and error was not handled in the UI. The changes that I did was handle the error in the UI and added a loader which would be shown up while fetching the user data. My changes were verified by @gastaldi here https://github.com/fabric8-launcher/ngx-launcher/issues/566. I added a loader as per the UX recommendation here https://github.com/openshiftio/openshift.io/issues/4640

ppitonak commented 5 years ago

@vikram-raj actually, it's not implemented according to the design... it was supposed to show username and loader when account is linked but I see this:

crt_github

ppitonak commented 5 years ago

Still reproducible in http://artifacts.ci.centos.org/devtools/e2e/devtools-test-e2e-prod-preview.openshift.io-smoketest-pr-us-east-2a-beta/6043/

vikram-raj commented 5 years ago

It is because request is still failing with 504 Gateway Time-out [14:32:30.169] req_id:1000000477.244 [RESPONSE] 504 Gateway Time-out https://forge.api.prod-preview.openshift.io/api/services/git/user.

gastaldi commented 5 years ago

@vikram-raj since this request delegates the call to GitHub (which may occasionally fail), what happens if you retry the request for a limited number of times before failing completely?

gastaldi commented 5 years ago

Also is there any way to reproduce this issue? What was the user used in this request?

gastaldi commented 5 years ago

Perhaps https://github.com/fabric8-launcher/launcher-backend/commit/a2eb145933e1044956aa96fac4945be37970ed19 may be a hint of what's causing this.

vikram-raj commented 5 years ago

Also is there any way to reproduce this issue?

@gastaldi I am not able to reproduce this issue loacally or on prod-preview or on prod. It is only failling on e2e tests.

vikram-raj commented 5 years ago

What was the user used in this request?

This is request used to fetch only user detail and their GitHub orgs and repositories.

vikram-raj commented 5 years ago

@gastaldi I raised a PR with retry implementation https://github.com/fabric8-ui/fabric8-ui/pull/3520. Let's see if it fix work.

ppitonak commented 5 years ago

@vikram-raj happened again http://artifacts.ci.centos.org/devtools/e2e/devtools-test-e2e-prod-preview.openshift.io-smoketest-pr-us-east-2a-released/6094/