question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Upgrade of Amplify and Migration of REST API

See original GitHub issue

Before opening, please confirm:

JavaScript Framework

React

Amplify APIs

Authentication, REST API

Amplify Categories

auth, function, api

Environment information

System:
    OS: Linux 5.13 Ubuntu 21.10 21.10 (Impish Indri)
    CPU: (8) x64 AMD Ryzen 5 2400G with Radeon Vega Graphics
    Memory: 500.36 MB / 13.60 GB
    Container: Yes
    Shell: 5.1.8 - /bin/bash
  Binaries:
    Node: 12.22.7 - ~/.nvm/versions/node/v12.22.7/bin/node
    npm: 6.14.15 - ~/.nvm/versions/node/v12.22.7/bin/npm
  Browsers:
    Chrome: 96.0.4664.93
    Firefox: 95.0
  npmPackages:
    @aws-amplify/auth: ^4.3.12 => 4.3.16 
    @aws-amplify/ui-components: ^1.9.2 => 1.9.6 
    @aws-amplify/ui-react: ^1.2.22 => 1.2.26 
    @emotion/react: ^11.5.0 => 11.7.0 
    @emotion/styled: ^11.3.0 => 11.6.0 
    @mui/icons-material: ^5.0.5 => 5.2.0 
    @mui/material: ^5.0.6 => 5.2.1 
    @mui/styles: ^5.0.2 => 5.2.1 
    @react-pdf-viewer/core: ^2.11.0 => 2.11.0 
    @react-pdf-viewer/page-navigation: ^2.11.0 => 2.11.0 
    @react-pdf-viewer/search: ^2.11.0 => 2.11.0 
    @testing-library/jest-dom: ^5.15.0 => 5.15.1 
    @testing-library/react: ^12.1.2 => 12.1.2 
    @testing-library/user-event: ^13.5.0 => 13.5.0 
    @types/enzyme: ^3.10.10 => 3.10.10 
    @types/jest: ^27.0.2 => 27.0.3 
    @types/node: ^16.11.6 => 16.11.10 
    @types/react: ^17.0.33 => 17.0.37 
    @types/react-dom: ^17.0.10 => 17.0.11 
    @types/react-tag-input: ^6.1.3 => 6.1.3 
    @types/uuid: ^8.3.1 => 8.3.3 
    @wojtekmaj/enzyme-adapter-react-17: ^0.6.5 => 0.6.5 
    amplify-ui-components-loader:  undefined ()
    aws-amplify: ^4.3.4 => 4.3.8 
    classnames: ^2.3.1 => 2.3.1 
    enzyme: ^3.11.0 => 3.11.0 
    jszip: ^3.7.1 => 3.7.1 
    pdfjs-dist: 2.6.347 => 2.6.347 
    react: ^17.0.2 => 17.0.2 
    react-dom: ^17.0.2 => 17.0.2 
    react-hook-form: ^7.19.1 => 7.20.4 
    react-scripts: 4.0.3 => 4.0.3 
    typescript: ^4.4.4 => 4.5.2 
    uuid: ^8.3.2 => 8.3.2 (3.4.0, 3.3.2)
  npmGlobalPackages:
    npm: 6.14.15


Describe the bug

When I upgraded the CLI to the latest and migrated the REST API. It removed my parameters.json and search-cloudformation-template.json. It added cli-inputs.json. When I ran amplify push it updated the API successfully.

Any API call to the REST API now returns 403: IncompleteSignatureException. When I test the API through the API Gateway console it works fine.

In the API Gateway I had previously had a Cognito authorizer; but after the update it was removed. I added it back but still get the same 403 error. See the screenshot for what it looks like after I add it back. cognito

Expected behavior

When upgrading the REST API I would like it to not break . If it does break, I’d like to have a process to fix (I currently don’t know how to resolve this).

Reproduction steps

amplify upgrade amplify update api amplify push

Code Snippet

// Put your code below this line.
API.post('search', `/search`, {
    body: {
      search_id: searchId,
      keywords,
      searched_pdfs: fileKeys,
    },
    headers: {
      Authorization: `Bearer ${(await Auth.currentSession())
        .getIdToken()
        .getJwtToken()}`,
    },
  });

Log output

// Put your logs below this line


aws-exports.js

No response

Manual configuration

No response

Additional configuration

No response

Mobile Device

No response

Mobile Operating System

No response

Mobile Browser

No response

Mobile Browser Version

No response

Additional information and screenshots

No response

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:27 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
jhockettcommented, Jan 27, 2022

@biddster @kiran-psi sorry to hear about these issues, I’ll investigate.

2reactions
schorficommented, Dec 9, 2021

I found this, and it helped me, to find the issue why my API was not deployed in the full extend anymore the update of amplify and redeployment of my API had a major change. As the OP reported, the original cloudformation-template was removed. A template under build appeared. But it was missing stuff. It didnt deploy my custom authorizers, it missed some paths, it removed some extra settings of the path (like GET method became any, special response headers (CORS), or integration values (like VPC linking))

it would have been cool to be notified about the changes and a good guide how to actually override the api gateway in a smart way - I now ended up to have the old path cf-template content in the override

I dont actually want to override default values…to default values but…you know overriden…

Read more comments on GitHub >

github_iconTop Results From Across the Web

Migrating a Next.js 11 SSR app to Amplify Hosting compute
Before you migrate an app in the Amplify console, you must first update the app's package.json file to use Next.js version 12 or...
Read more >
AWS re:Invent 2019: Upgrade your APIs from ... - YouTube
Learn how to migrate or upgrade your existing REST APIs to GraphQL with AWS AppSync and AWS Amplify. In this session, we go...
Read more >
Migrate an existing application RESTful API's to GraphQL ...
Migrate an existing application RESTful API's to GraphQL using AWS Amplify and AWS AppSync. 1. © 2019, Amazon Web Services, Inc. or its...
Read more >
GraphQL Transformer v1 to v2 migration - AWS Amplify Docs
To help you migrate to the GraphQL transformer v2, amplify migrate api has been added to Amplify CLI. This tool will automatically migrate...
Read more >
Migrating REST APIs to AWS Serverless - Brett Andrews
In this article we'll cover how to migrate your existing REST APIs to ... First, let's update our API Gateway endpoints in serverless.yaml...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found