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

503 ERROR on paths with parameters inside #2083

Closed
AustinDidierTran opened this issue Jul 23, 2021 · 10 comments
Closed

503 ERROR on paths with parameters inside #2083

AustinDidierTran opened this issue Jul 23, 2021 · 10 comments
Labels
archived This issue has been locked. pending-investigation question Further information is requested ssr Server Side Rendering feature

Comments

@AustinDidierTran
Copy link

AustinDidierTran commented Jul 23, 2021

Please describe which feature you have a question about?

I am using a custom domain with amplify (https://dev.sportfolios.app/), and all my routes that are well specified in my router works well. However, whenever there is a param inside, it seems to break. For example, https://dev.sportfolios.app/:id, or with this actual route: https://dev.sportfolios.app/7f2cfa7e-d561-4b95-be13-0c37c3623bc5.

This leads me to this view.

Screen Shot 2021-07-23 at 9 54 55 AM

From the logs, I see two options:

  1. Too many traffic, which I doubt since I'm the only one testing for now
  2. Configuration error, which may be possible. I've tried this solution: https://stackoverflow.com/questions/57449853/react-router-dom-not-working-correctly-on-amplify-console-aws, but it didn't work

Provide additional details

This is a next.js project, using React + react-router. My application is SSR.

My amplify.yml.

version: 1
frontend:
  phases:
    preBuild:
      commands:
        - npm ci
    build:
      commands:
        - npm run build
  artifacts:
    baseDirectory: .next
    files:
      - '**/*'
  cache:
    paths:
      - node_modules/**/*

This is my current redirect configuration

Screen Shot 2021-07-23 at 10 02 55 AM

I've also tried this redirect configuration

Screen Shot 2021-07-23 at 10 04 24 AM

Which leads me to this view instead

Screen Shot 2021-07-23 at 10 03 58 AM

What AWS Services are you utilizing?

I am using Amazon Amplify, which should be the only thing necessary here. I also have a working environment on EC2 (which I am trying to migrate from) and it all works well there.

Provide additional details e.g. code snippets

Let me know if there are additional details needed here!

@AustinDidierTran AustinDidierTran added the question Further information is requested label Jul 23, 2021
@AustinDidierTran AustinDidierTran changed the title My routing seems to be broken 503 ERROR on paths with parameters inside Jul 23, 2021
@AustinDidierTran
Copy link
Author

App ARN: arn:aws:amplify:us-east-2:982491399392:apps/dxnw0u02v229l

@ferdingler ferdingler added the ssr Server Side Rendering feature label Oct 6, 2021
@victorccccc
Copy link
Contributor

Hi, thanks for your information. Could you check Lambda@Edge logs in your account? For SSR app, we'll rewrite the request to the distribution in your account (You can get details from logs in Deploy phase). Specifically, for https://dev.sportfolios.app/7f2cfa7e-d561-4b95-be13-0c37c3623bc5, your ssr distribution will receive the request with uri: /7f2cfa7e-d561-4b95-be13-0c37c3623bc5. You might need to handle this request on server side.

@AustinDidierTran
Copy link
Author

Hi,

Thanks for the reply. You want the logs from cloudfront? From what I see, I only have one log group that has lambda edge inside its name, and it is /aws/cloudfront/LambdaEdge/ENMHD6YIDVVRS that has only one log stream: 2021/08/16/56cede518f914c02a7de9ed76cd99573.

I may be completly off track here. If so, could you provide me some steps to reproduce to see the logs? Thanks!

@AustinDidierTran
Copy link
Author

In the deploy phase, here are my logs:

2021-10-16T18:37:00 [INFO]: Beginning deployment for application dxnw0u02v229l, branch:develop, buildId 0000000134
2021-10-16T18:37:01 [INFO]: Deploying SSR Resources. Distribution ID: ENMHD6YIDVVRS. This may take a few minutes...
2021-10-16T18:40:02 [INFO]: Deployed the following resources to your account:
2021-10-16T18:40:02 [INFO]: - CloudFront Domain ID: dsuzil3bvpszb
2021-10-16T18:40:02 [INFO]: - SSR Lambda@Edge: hjjn92r-vktnxti
2021-10-16T18:40:02 [INFO]: - S3 Bucket: hjjn92r-n023e8g
2021-10-16T18:40:02 [INFO]: Deployment complete

@victorccccc
Copy link
Contributor

victorccccc commented Oct 20, 2021

Hi, I think you might need to go to region us-east-2 and the log group is /aws/lambda/us-east-1.hjjn92r-vktnxti (Logs for your SSR Lambda@Edge function )

@jtmthf
Copy link

jtmthf commented Oct 21, 2021

I'm getting this same error as well, I checked cloudwatch logs and this is the error I see

2021-10-21T15:58:37.541Z	80fc8412-784b-46e6-81ec-2decd25f0a1d	ERROR	Invoke Error 	{
    "errorType": "NotImplemented",
    "errorMessage": "A header you provided implies functionality that is not implemented",
    "Code": "NotImplemented",
    "Header": "Transfer-Encoding",
    "RequestId": "H983EVC2NAHQ91RC",
    "HostId": "2hQY6y5SW+/FLqmiujxfsilfnvT5CycMIfGxe0Kh7HI0McwChxGgQCH4TYDFYQzH8QJLboo1t3s=",
    "name": "NotImplemented",
    "$fault": "client",
    "$metadata": {
        "httpStatusCode": 501,
        "extendedRequestId": "2hQY6y5SW+/FLqmiujxfsilfnvT5CycMIfGxe0Kh7HI0McwChxGgQCH4TYDFYQzH8QJLboo1t3s=",
        "attempts": 1,
        "totalRetryDelay": 0
    },
    "stack": [
        "NotImplemented: A header you provided implies functionality that is not implemented",
        "    at deserializeAws_restXmlPutObjectCommandError (/var/task/index-73bc7b63.js:3255:41)",
        "    at processTicksAndRejections (internal/process/task_queues.js:97:5)"
    ]
}

@AustinDidierTran
Copy link
Author

@victorccccc I don't have logs since august 😞 I'm not sure if these are the right logs though

Screen Shot 2021-10-21 at 3 58 20 PM

@ghost
Copy link

ghost commented May 26, 2023

For customers with deployed Amplify apps that are using Next.js 11 and earlier, we have an FAQ guide for how to find the Lambda Edge logs: https://github.com/aws-amplify/amplify-hosting/blob/main/FAQ.md#access-lambda-edge-logs

We've since launched support for Next.js 12 and 13: https://aws.amazon.com/about-aws/whats-new/2022/11/aws-amplify-hosting-support-next-js-12-13/

If you are using later versions of Next.js, please take advantage of our new launched support by migrating your application: https://docs.aws.amazon.com/amplify/latest/userguide/update-app-nextjs-version.html

@ghost ghost closed this as not planned Won't fix, can't repro, duplicate, stale May 26, 2023
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot added the archived This issue has been locked. label May 26, 2023
@github-actions github-actions bot locked and limited conversation to collaborators May 26, 2023
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived This issue has been locked. pending-investigation question Further information is requested ssr Server Side Rendering feature
Projects
None yet
Development

No branches or pull requests

4 participants