aws / aws-parallelcluster-ui

Apache License 2.0
31 stars 20 forks source link

Custom domain name doesn't work properly #322

Open salemgolemugoo opened 7 months ago

salemgolemugoo commented 7 months ago

Description

Setup the brand new version of ParallelCluster UI (3.8.0) Used this documentation to enable custom domain name (example.com) https://docs.aws.amazon.com/parallelcluster/latest/ug/install-pcui-v3.html#install-pcui-api-custom-domain-v3 When I try to load the main page via custom domain name, static resources don't load. Api gateway returns html page without css and js resources. I see a blank page.

Steps to reproduce the issue

curl -v https://[API-ID].execute-api.us-east-1.amazonaws.com/pcui/_next/static/chunks/pages/index-b93f8f1a19ba2629.js < content-type: application/javascript; charset=utf-8 < content-length: 239454 Response: proper js file

curl -v https://example.com/pcui/_next/static/chunks/pages/index-b93f8f1a19ba2629.js < content-type: text/html; charset=utf-8 < content-length: 2197 Response: dummy html page

<!DOCTYPE html><html lang="en">
<head>
<meta charSet="utf-8"/>
<meta name="viewport" content="width=device-width"/>
<meta name="next-head-count" content="2"/>
<meta charSet="utf-8"/>
<link rel="icon" href="/pcui/img/pcluster.svg"/>
<meta name="theme-color" content="#000000"/>
<meta name="description" content="AWS ParallelCluster UI"/>
<link rel="preload" href="/pcui/_next/static/css/17ff2d6695ebe7f1.css" as="style" crossorigin=""/>
<link rel="stylesheet" href="/pcui/_next/static/css/17ff2d6695ebe7f1.css" crossorigin="" data-n-g=""/>
<link rel="preload" href="/pcui/_next/static/css/a8dbdb3a2e8d5422.css" as="style" crossorigin=""/>
<link rel="stylesheet" href="/pcui/_next/static/css/a8dbdb3a2e8d5422.css" crossorigin="" data-n-p=""/>
<link rel="preload" href="/pcui/_next/static/css/c68f2021d9f598d6.css" as="style" crossorigin=""/>
<link rel="stylesheet" href="/pcui/_next/static/css/c68f2021d9f598d6.css" crossorigin="" data-n-p=""/>
<noscript data-n-css=""></noscript>
<script defer="" crossorigin="" nomodule="" src="/pcui/_next/static/chunks/polyfills-c67a75d1b6f99dc8.js"></script>
<script src="/pcui/_next/static/chunks/webpack-50c06624a7bdfb31.js" defer="" crossorigin=""></script>
<script src="/pcui/_next/static/chunks/framework-467b11a89995b152.js" defer="" crossorigin=""></script>
<script src="/pcui/_next/static/chunks/main-6cd0e2e10a4c98ae.js" defer="" crossorigin=""></script>
<script src="/pcui/_next/static/chunks/pages/_app-167f4445f7d7411c.js" defer="" crossorigin=""></script>
<script src="/pcui/_next/static/chunks/91-318f1c8a0f0a0f02.js" defer="" crossorigin=""></script>
<script src="/pcui/_next/static/chunks/pages/index-b93f8f1a19ba2629.js" defer="" crossorigin=""></script>
<script src="/pcui/_next/static/B1_jTO2ZUYTKUKEXSGt2E/_buildManifest.js" defer="" crossorigin=""></script>
<script src="/pcui/_next/static/B1_jTO2ZUYTKUKEXSGt2E/_ssgManifest.js" defer="" crossorigin=""></script>
</head>
<body>
<div id="__next"></div>
<script id="__NEXT_DATA__" type="application/json" crossorigin="">{"props":{"pageProps":{}},"page":"/","query":{},"buildId":"B1_jTO2ZUYTKUKEXSGt2E","assetPrefix":"/pcui","nextExport":true,"autoExport":true,"isFallback":false,"scriptLoader":[]}</script>
</body>
</html>

Expected behaviour

Resources should be loaded and login popup should appear.

Required info

In order to help us determine the root cause of the issue, please provide the following information:

Additional info

The following information is not required but helpful:

Without custom domain name:

START RequestId: 9bf4793c-04cf-4195-b57d-6eb0b0ce3d1a Version: $LATEST
--
[INFO]  2024-03-01T18:34:08.737Z    9bf4793c-04cf-4195-b57d-6eb0b0ce3d1a    {'message': {'headers': {'Content-Length': '0', 'Accept': '*/*', 'Host': 'API-ID.execute-api.us-east-1.amazonaws.com', 'User-Agent': 'curl/8.4.0', 'X-Amzn-Trace-Id': 'Root=1-65e21fa0-34314aa230c8b2c4573dfd67', 'X-Forwarded-For': 'XXX', 'X-Forwarded-Port': '443', 'X-Forwarded-Proto': 'https'}, 'path': '/_next/static/chunks/pages/index-b93f8f1a19ba2629.js', 'apigw-request-id': '73233fd5-05bb-4c29-a50b-f245eb680b0c'}}
[INFO]  2024-03-01T18:34:08.738Z    9bf4793c-04cf-4195-b57d-6eb0b0ce3d1a    {'message': {'headers': {'Content-Disposition': 'inline; filename=index-b93f8f1a19ba2629.js', 'Content-Type': 'application/javascript; charset=utf-8', 'Content-Length': '239454', 'Last-Modified': 'Thu, 21 Dec 2023 12:09:22 GMT', 'Cache-Control': 'no-cache', 'Date': 'Fri, 01 Mar 2024 18:34:08 GMT'}}}
END RequestId: 9bf4793c-04cf-4195-b57d-6eb0b0ce3d1a
REPORT RequestId: 9bf4793c-04cf-4195-b57d-6eb0b0ce3d1a  Duration: 35.95 ms  Billed Duration: 36 ms  Memory Size: 512 MB Max Memory Used: 88 MB  XRAY TraceId: 1-65e21fa0-34314aa230c8b2c4573dfd67   SegmentId: 3c75b4770b27bba7 Sampled: true

With custom domain name:

START RequestId: 8fb846a3-b812-4401-8d66-3ccfebbe37fa Version: $LATEST
--
[INFO]  2024-03-01T18:34:33.873Z    8fb846a3-b812-4401-8d66-3ccfebbe37fa    {'message': {'headers': {'Content-Length': '0', 'Accept': '*/*', 'Host': 'example.com', 'User-Agent': 'curl/8.4.0', 'X-Amzn-Trace-Id': 'Root=1-65e21fb9-36223d926cd0312853bdc717', 'X-Forwarded-For': 'XXX, 'X-Forwarded-Port': '443', 'X-Forwarded-Proto': 'https'}, 'path': '/pcui/_next/static/chunks/pages/index-b93f8f1a19ba2629.js', 'apigw-request-id': 'bdfa09ed-686a-4ca1-a12e-b4ea955f7299'}}
[INFO]  2024-03-01T18:34:33.873Z    8fb846a3-b812-4401-8d66-3ccfebbe37fa    {'message': {'headers': {'Content-Disposition': 'inline; filename=index.html', 'Content-Type': 'text/html; charset=utf-8', 'Content-Length': '2197', 'Last-Modified': 'Thu, 21 Dec 2023 12:09:23 GMT', 'Cache-Control': 'no-cache', 'Date': 'Fri, 01 Mar 2024 18:34:33 GMT'}}}
END RequestId: 8fb846a3-b812-4401-8d66-3ccfebbe37fa
REPORT RequestId: 8fb846a3-b812-4401-8d66-3ccfebbe37fa  Duration: 3.92 ms   Billed Duration: 4 ms   Memory Size: 512 MB Max Memory Used: 88 MB  XRAY TraceId: 1-65e21fb9-36223d926cd0312853bdc717   SegmentId: 0bbf604e63d2054b Sampled: true
salemgolemugoo commented 7 months ago

It doesn't matter if you use https://example.com or https://example.com/pcui for the SITE_URL. Application generates urls for the static resources in html with a prefix /pcui/. But static resources are available only like that https://example.com/_next/static/chunks/main-6cd0e2e10a4c98ae.js (without the prefix)

salemgolemugoo commented 7 months ago

When I change https://github.com/aws/aws-parallelcluster-ui/blob/main/api/utils.py#L95 static_url_path="/pcui", the UI starts to load with the custom domain, but then I get 405 error on POST to https://example.com/pcui/logs

pmorkert commented 5 months ago

I am seeing the same issue with a brand new install. Image: 2024.04.0 PC Version: 3.9.1 Region: us-east-1

gmarciani commented 4 months ago

Hi all, thanks for raising the attention on this bug. We will investigate the issue internally and post here an update on the fix.

Thank you!

avib-odditylabs commented 4 months ago

Hi all!

Curious if there is an update on this? Thanks!

dreambeyondorange commented 4 months ago

Hi, thanks for reaching out! We are still investigating. We will post an update once we have confirmation of our next steps!

pietervincken commented 3 months ago

What is the status on this issue? This issue currently prevents us from upgrading our deployment of parallel-cluster.

avib-odditylabs commented 1 month ago

Hi all :) Just checking in to see if there is an update here!

dreambeyondorange commented 1 month ago

Hi all :) Just checking in to see if there is an update here!

Thanks for checking in! We are actively working on this issue! Hopefully it will be fixed in the next release

gmarciani commented 4 days ago

Hi all,

we just opened a PR with the fix, which will be part of the next release. https://github.com/aws/aws-parallelcluster-ui/pull/364.

gmarciani commented 1 day ago

Hi all,

with https://github.com/aws/aws-parallelcluster-ui/pull/365, that will be part of the next release, we will simplify the user experience in setting up the custom domain in both PCUI and the Cognito authentication page.