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

ERR_TOO_MANY_REDIRECTS #4

Closed
bbarthel opened this issue Jun 17, 2020 · 8 comments
Closed

ERR_TOO_MANY_REDIRECTS #4

bbarthel opened this issue Jun 17, 2020 · 8 comments

Comments

@bbarthel
Copy link

bbarthel commented Jun 17, 2020

When I try viewing the production site, I get the following error:

image

I have tried using my local code that works and commited to CodeCommit and also using Github. Any ideas/suggestions?

@jbesw
Copy link
Contributor

jbesw commented Jun 17, 2020

I would recommend checking https://community.auth0.com/t/redirect-too-many-times/35606/9 and verifying the callback URLs are all exactly correct (check trailing slashes, etc.) Auth0 handles the redirects between the auth and the app, so it's difficult to debug.

@bbarthel
Copy link
Author

What should be the build settings be in amplify.yml? This is what mine look like:

version: 1
frontend:
phases:
# IMPORTANT - Please verify your build commands
build:
commands: []
artifacts:
# IMPORTANT - Please verify your build output directory
baseDirectory: /
files:
- '**/*'
cache:
paths: []

@jbesw
Copy link
Contributor

jbesw commented Jun 17, 2020

Mine looks like this:

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

@bbarthel
Copy link
Author

Now the build fails ...
2020-06-17T19:37:59.346Z [INFO]: # Cloning repository: https://git-codecommit.us-east-1.amazonaws.com/v1/repos/ask-around-me
2020-06-17T19:37:59.816Z [INFO]: Cloning into 'ask-around-me'...
2020-06-17T19:38:06.097Z [INFO]: remote:
2020-06-17T19:38:07.760Z [INFO]: remote: Counting objects: 0
2020-06-17T19:38:07.845Z [INFO]: remote: Counting objects: 154
2020-06-17T19:38:08.106Z [INFO]: remote: Counting objects: 154
remote: Counting objects: 154, done.
2020-06-17T19:38:09.917Z [INFO]: Receiving objects: 0% (1/154)
Receiving objects: 1% (2/154)
2020-06-17T19:38:09.920Z [INFO]: Receiving objects: 2% (4/154)
Receiving objects: 3% (5/154)
Receiving objects: 4% (7/154)
Receiving objects: 5% (8/154)
Receiving objects: 6% (10/154)
Receiving objects: 7% (11/154)
Receiving objects: 8% (13/154)
Receiving objects: 9% (14/154)
Receiving objects: 10% (16/154)
Receiving objects: 11% (17/154)
Receiving objects: 12% (19/154)
Receiving objects: 13% (21/154)
Receiving objects: 14% (22/154)
Receiving objects: 15% (24/154)
Receiving objects: 16% (25/154)
Receiving objects: 17% (27/154)
Receiving objects: 18% (28/154)
Receiving objects: 19% (30/154)
Receiving objects: 20% (31/154)
Receiving objects: 21% (33/154)
Receiving objects: 22% (34/154)
Receiving objects: 23% (36/154)
Receiving objects: 24% (37/154)
Receiving objects: 25% (39/154)
Receiving objects: 26% (41/154)
Receiving objects: 27% (42/154)
Receiving objects: 28% (44/154)
Receiving objects: 29% (45/154)
Receiving objects: 30% (47/154)
Receiving objects: 31% (48/154)
Receiving objects: 32% (50/154)
Receiving objects: 33% (51/154)
Receiving objects: 34% (53/154)
Receiving objects: 35% (54/154)
Receiving objects: 36% (56/154)
Receiving objects: 37% (57/154)
Receiving objects: 38% (59/154)
Receiving objects: 39% (61/154)
Receiving objects: 40% (62/154)
2020-06-17T19:38:09.927Z [INFO]: Receiving objects: 41% (64/154)
Receiving objects: 42% (65/154)
Receiving objects: 43% (67/154)
Receiving objects: 44% (68/154)
Receiving objects: 45% (70/154)
Receiving objects: 46% (71/154)
Receiving objects: 47% (73/154)
Receiving objects: 48% (74/154)
Receiving objects: 49% (76/154)
Receiving objects: 50% (77/154)
Receiving objects: 51% (79/154)
Receiving objects: 52% (81/154)
Receiving objects: 53% (82/154)
Receiving objects: 54% (84/154)
Receiving objects: 55% (85/154)
Receiving objects: 56% (87/154)
Receiving objects: 57% (88/154)
2020-06-17T19:38:09.931Z [INFO]: Receiving objects: 58% (90/154)
Receiving objects: 59% (91/154)
2020-06-17T19:38:09.932Z [INFO]: Receiving objects: 60% (93/154)
Receiving objects: 61% (94/154)
Receiving objects: 62% (96/154)
2020-06-17T19:38:09.936Z [INFO]: Receiving objects: 63% (98/154)
Receiving objects: 64% (99/154)
Receiving objects: 65% (101/154)
Receiving objects: 66% (102/154)
Receiving objects: 67% (104/154)
Receiving objects: 68% (105/154)
Receiving objects: 69% (107/154)
Receiving objects: 70% (108/154)
Receiving objects: 71% (110/154)
Receiving objects: 72% (111/154)
Receiving objects: 73% (113/154)
Receiving objects: 74% (114/154)
Receiving objects: 75% (116/154)
Receiving objects: 76% (118/154)
2020-06-17T19:38:09.941Z [INFO]: Receiving objects: 77% (119/154)
Receiving objects: 78% (121/154)
2020-06-17T19:38:09.957Z [INFO]: Receiving objects: 79% (122/154)
2020-06-17T19:38:09.958Z [INFO]: Receiving objects: 80% (124/154)
Receiving objects: 81% (125/154)
Receiving objects: 82% (127/154)
Receiving objects: 83% (128/154)
Receiving objects: 84% (130/154)
Receiving objects: 85% (131/154)
Receiving objects: 86% (133/154)
Receiving objects: 87% (134/154)
Receiving objects: 88% (136/154)
Receiving objects: 89% (138/154)
Receiving objects: 90% (139/154)
2020-06-17T19:38:09.974Z [INFO]: Receiving objects: 91% (141/154)
2020-06-17T19:38:09.975Z [INFO]: Receiving objects: 92% (142/154)
2020-06-17T19:38:09.977Z [INFO]: Receiving objects: 93% (144/154)
2020-06-17T19:38:09.978Z [INFO]: Receiving objects: 94% (145/154)
2020-06-17T19:38:10.008Z [INFO]: Receiving objects: 95% (147/154)
Receiving objects: 96% (148/154)
Receiving objects: 97% (150/154)
Receiving objects: 98% (151/154)
2020-06-17T19:38:10.009Z [INFO]: Receiving objects: 99% (153/154)
2020-06-17T19:38:10.057Z [INFO]: Receiving objects: 100% (154/154)
Receiving objects: 100% (154/154), 2.60 MiB | 18.64 MiB/s, done.
2020-06-17T19:38:10.057Z [INFO]: Resolving deltas: 0% (0/62)
Resolving deltas: 1% (1/62)
Resolving deltas: 9% (6/62)
Resolving deltas: 12% (8/62)
Resolving deltas: 14% (9/62)
Resolving deltas: 16% (10/62)
Resolving deltas: 17% (11/62)
2020-06-17T19:38:10.057Z [INFO]: Resolving deltas: 19% (12/62)
Resolving deltas: 20% (13/62)
Resolving deltas: 25% (16/62)
Resolving deltas: 29% (18/62)
Resolving deltas: 43% (27/62)
Resolving deltas: 45% (28/62)
Resolving deltas: 46% (29/62)
Resolving deltas: 51% (32/62)
Resolving deltas: 54% (34/62)
Resolving deltas: 56% (35/62)
2020-06-17T19:38:10.057Z [INFO]: Resolving deltas: 67% (42/62)
Resolving deltas: 72% (45/62)
Resolving deltas: 77% (48/62)
2020-06-17T19:38:10.058Z [INFO]: Resolving deltas: 90% (56/62)
Resolving deltas: 95% (59/62)
2020-06-17T19:38:10.058Z [INFO]: Resolving deltas: 98% (61/62)
2020-06-17T19:38:10.060Z [INFO]: Resolving deltas: 100% (62/62)
2020-06-17T19:38:10.060Z [INFO]: Resolving deltas: 100% (62/62), done.
2020-06-17T19:38:10.364Z [INFO]: # Switching to commit: a1753814d6d3f8d3c61ce0bba5f498584b1140ac
2020-06-17T19:38:10.401Z [INFO]: Note: checking out 'a1753814d6d3f8d3c61ce0bba5f498584b1140ac'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b
HEAD is now at a175381 2nd commit
2020-06-17T19:38:10.401Z [INFO]: # Checking for Git submodules at: /codebuild/output/src782302208/src/ask-around-me/.gitmodules
2020-06-17T19:38:10.433Z [INFO]: # Retrieving cache...
2020-06-17T19:38:10.616Z [INFO]: # Extracting cache...
2020-06-17T19:38:10.624Z [INFO]: # Extraction completed
2020-06-17T19:38:10.625Z [INFO]: # Retrieving environment cache...
2020-06-17T19:38:10.645Z [INFO]: # Retrieved environment cache
2020-06-17T19:38:43.440Z [INFO]: ## Starting Frontend Build
# Starting phase: preBuild
# Executing command: npm ci
2020-06-17T19:38:44.490Z [WARNING]: npm
2020-06-17T19:38:44.490Z [WARNING]: ERR! path /codebuild/output/src782302208/src/ask-around-me/package.json
npm ERR! code ENOENT
npm
2020-06-17T19:38:44.490Z [WARNING]: ERR! errno -2
npm ERR! syscall open
2020-06-17T19:38:44.491Z [WARNING]: npm
2020-06-17T19:38:44.491Z [WARNING]: ERR! enoent ENOENT: no such file or directory, open '/codebuild/output/src782302208/src/ask-around-me/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
2020-06-17T19:38:44.636Z [WARNING]:
2020-06-17T19:38:44.637Z [WARNING]: npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-06-17T19_38_44_492Z-debug.log
2020-06-17T19:38:44.637Z [HELP]: Outputting the npm debug log
0 info it worked if it ends with ok
1 verbose cli [ '/root/.nvm/versions/node/v10.16.0/bin/node',
1 verbose cli '/root/.nvm/versions/node/v10.16.0/bin/npm',
1 verbose cli 'ci' ]
2 info using npm@6.9.0
3 info using node@v10.16.0
4 verbose npm-session 6b9ea1a0dcfd61b1
5 info prepare initializing installer
6 verbose prepare starting workers
7 verbose prepare installation prefix: /codebuild/output/src782302208/src/ask-around-me
8 verbose teardown shutting down workers.
9 info teardown Done in 0s
10 verbose stack Error: ENOENT: no such file or directory, open '/codebuild/output/src782302208/src/ask-around-me/package.json'
11 verbose cwd /codebuild/output/src782302208/src/ask-around-me
12 verbose Linux 4.14.173-106.229.amzn1.x86_64
13 verbose argv "/root/.nvm/versions/node/v10.16.0/bin/node" "/root/.nvm/versions/node/v10.16.0/bin/npm" "ci"
14 verbose node v10.16.0
15 verbose npm v6.9.0
16 error path /codebuild/output/src782302208/src/ask-around-me/package.json
17 error code ENOENT
18 error errno -2
19 error syscall open
20 error enoent ENOENT: no such file or directory, open '/codebuild/output/src782302208/src/ask-around-me/package.json'
21 error enoent This is related to npm not being able to find a file.
22 verbose exit [ -2, true ]
2020-06-17T19:38:44.639Z [ERROR]: !!! Build failed
2020-06-17T19:38:44.729Z [ERROR]: !!! Non-Zero Exit Code detected
2020-06-17T19:38:44.730Z [INFO]: # Starting environment caching...
2020-06-17T19:38:44.730Z [INFO]: # Environment caching completed
Terminating logging...

@jbesw
Copy link
Contributor

jbesw commented Jun 17, 2020

You shouldn't have to change anything in Amplify to make this work. I am 99% sure this is Auth.0 configuration issue. When I produce the video, I'll dig into this to go through all the settings.

@bbarthel
Copy link
Author

When I connect Amplify to CodeCommit it get the following:
image

I'm thinking something else is going on ...

@bbarthel
Copy link
Author

... Figured out the problem, my repository also included the backend, oops.

@jbesw
Copy link
Contributor

jbesw commented Jun 17, 2020

Bill, thanks for reporting this - it's easy to make this mistake, so I'll flag it in the walkthrough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants