Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OCPBUGS-19743: Fix Invalid URL crash #13192

Merged
merged 1 commit into from Sep 26, 2023

Conversation

jerolimov
Copy link
Member

@jerolimov jerolimov commented Sep 26, 2023

Fixes:
https://issues.redhat.com/browse/OCPBUGS-19743

Analysis / Root cause:
After #13102 got merged, it wasn't possible to start the local console bridge anymore.

The UI crashes with this error:

Uncaught TypeError: Failed to construct 'URL': Invalid URL
    at ./public/module/auth.js (main-c115e44b78283c32bc69.js:81514:7)
    at __webpack_require__ (runtime~main-bundle.js:90:30)

The loginErrorURL is a string that couldn't get parsed with new URL:

window.SERVER_FLAGS.loginErrorURL
'/auth/error'

new URL(window.SERVER_FLAGS.loginErrorURL)
VM55:1 Uncaught TypeError: Failed to construct 'URL': Invalid URL

Solution Description:

  1. Added the current URL as base URL as second parameter to the URL constructor.
  2. Updated isLoginErrorPath because LOGIN_ERROR_PATH is a string, no an URL object.

To be honest, I didn't retested #13102 yet.

Test setup:

  1. Start a local console with ./bin/bridge

Browser conformance:

  • Chrome
  • Firefox
  • Safari
  • Edge

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Sep 26, 2023
@openshift-ci-robot
Copy link
Contributor

@jerolimov: This pull request references Jira Issue OCPBUGS-19743, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.15.0) matches configured target version for branch (4.15.0)
  • bug is in the state New, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @sanketpathak

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci-robot openshift-ci-robot added the jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. label Sep 26, 2023
@openshift-ci openshift-ci bot added component/core Related to console core functionality approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Sep 26, 2023
@openshift-ci-robot
Copy link
Contributor

@jerolimov: This pull request references Jira Issue OCPBUGS-19743, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.15.0) matches configured target version for branch (4.15.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @sanketpathak

In response to this:

Fixes:
https://issues.redhat.com/browse/OCPBUGS-19743

Analysis / Root cause:
After #13102 got merged, it wasn't possible to start the local console bridge anymore.

The UI crashes with this error:

Uncaught TypeError: Failed to construct 'URL': Invalid URL
   at ./public/module/auth.js (main-c115e44b78283c32bc69.js:81514:7)
   at __webpack_require__ (runtime~main-bundle.js:90:30)

The loginErrorURL is a string that couldn't get parsed with new URL:

window.SERVER_FLAGS.loginErrorURL
'/auth/error'

new URL(window.SERVER_FLAGS.loginErrorURL)
VM55:1 Uncaught TypeError: Failed to construct 'URL': Invalid URL

Solution Description:

  1. Added the current URL as base URL as second parameter to the URL constructor.
  2. Updated isLoginErrorPath because LOGIN_ERROR_PATH is a string, no an URL object.

To be honest, I didn't retested #13102 yet.

Test setup:

  1. Start a local console with ./bin/bridge

Browser conformance:

  • Chrome
  • Firefox
  • Safari
  • Edge

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@jerolimov
Copy link
Member Author

/cc @vikram-raj @TheRealJon @jhadvig @spadgett
/uncc kyoto rhamilto

@openshift-ci openshift-ci bot requested review from jhadvig, spadgett, TheRealJon and vikram-raj and removed request for kyoto and rhamilto September 26, 2023 07:09
Copy link
Member

@vikram-raj vikram-raj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified it locally, not seeing any error and it works as expected.

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 26, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 26, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jerolimov, vikram-raj

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 26, 2023

@jerolimov: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@openshift-merge-robot openshift-merge-robot merged commit c0c9a4d into openshift:master Sep 26, 2023
6 checks passed
@openshift-ci-robot
Copy link
Contributor

@jerolimov: Jira Issue OCPBUGS-19743: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-19743 has been moved to the MODIFIED state.

In response to this:

Fixes:
https://issues.redhat.com/browse/OCPBUGS-19743

Analysis / Root cause:
After #13102 got merged, it wasn't possible to start the local console bridge anymore.

The UI crashes with this error:

Uncaught TypeError: Failed to construct 'URL': Invalid URL
   at ./public/module/auth.js (main-c115e44b78283c32bc69.js:81514:7)
   at __webpack_require__ (runtime~main-bundle.js:90:30)

The loginErrorURL is a string that couldn't get parsed with new URL:

window.SERVER_FLAGS.loginErrorURL
'/auth/error'

new URL(window.SERVER_FLAGS.loginErrorURL)
VM55:1 Uncaught TypeError: Failed to construct 'URL': Invalid URL

Solution Description:

  1. Added the current URL as base URL as second parameter to the URL constructor.
  2. Updated isLoginErrorPath because LOGIN_ERROR_PATH is a string, no an URL object.

To be honest, I didn't retested #13102 yet.

Test setup:

  1. Start a local console with ./bin/bridge

Browser conformance:

  • Chrome
  • Firefox
  • Safari
  • Edge

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@jerolimov jerolimov deleted the OCPBUGS-19743 branch September 26, 2023 11:17
@openshift-merge-robot
Copy link
Contributor

Fix included in accepted release 4.15.0-0.nightly-2023-09-27-073353

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. component/core Related to console core functionality jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants