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

All Amplify builds suddenly started failing (even past successful builds) #3943

Closed
3 tasks done
sgd2z opened this issue Jun 26, 2024 · 8 comments
Closed
3 tasks done
Labels
archived This issue has been locked. hosting question Further information is requested transferred This issue was transferred from another Amplify project

Comments

@sgd2z
Copy link

sgd2z commented Jun 26, 2024

Before opening, please confirm:

JavaScript Framework

React

Amplify APIs

REST API

Amplify Version

v6

Amplify Categories

function

Backend

Amplify CLI

Environment information

# Put output below this line
  System:
    OS: Windows 11 10.0.22631
    CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
    Memory: 631.20 MB / 15.72 GB
  Binaries:
    Node: 20.8.1 - C:\Program Files\nodejs\node.EXE  
    Yarn: 1.22.22 - C:\Program Files\nodejs\yarn.CMD 
    npm: 10.1.0 - C:\Program Files\nodejs\npm.CMD    
    pnpm: 8.15.5 - C:\Program Files\nodejs\pnpm.CMD  
  Browsers:
    Edge: Chromium (126.0.2592.68)
    Internet Explorer: 11.0.22621.3527
  npmPackages:
    @getbrevo/brevo: ^1.0.1 => 1.0.1
    @prisma/client: ^5.16.0 => 5.16.0
    @types/aws-lambda: ^8.10.92 => 8.10.137
    aws-sdk: ^2.1415.0 => 2.1605.0
    aws-serverless-express: ^3.3.5 => 3.4.0
    body-parser: ^1.20.2 => 1.20.2 (1.20.1)
    dotenv: ^16.3.1 => 16.4.1
    express: ^4.15.2 => 4.18.2
    fyers: https://x-access-token:[email protected]/BrokerBotics/fyers.git => 0.0.1
    jsencrypt: ^3.3.2 => 3.3.2
    multer: ^1.4.5-lts.1 => 1.4.5-lts.1
    node-rsa: ^1.1.1 => 1.1.1
    prisma: ^5.16.0 => 5.16.0
    rsa-key: ^0.0.6 => 0.0.6
    stripe: ^12.17.0 => 12.18.0
    tastytrade: https://x-access-token:[email protected]/BrokerBotics/tastytrade.git => 0.0.4
    tradestation: https://x-access-token:[email protected]/BrokerBotics/tradestation.git => 0.0.4
    tradier: https://x-access-token:[email protected]/BrokerBotics/tradier.git => 1.0.23
  npmGlobalPackages:
    @aws-amplify/cli: 12.10.1
    corepack: 0.20.0
    npm: 10.1.0
    pnpm: 8.15.5
    yarn: 1.22.22

I've removed tokens for security

Describe the bug

Backend build fails with this error:

42 2024-06-26T16:55:05.445Z [WARNING]: ✖ There was an error initializing your environment.

43 2024-06-26T16:55:05.451Z [INFO]: 🛑 Packaging lambda function failed with the error

44 Command failed with exit code 1: yarn amplify:brokerboticsapi

45 npm WARN exec The following package was not found and will be installed: [email protected]

When the build started failing, the version of prisma in yarn-lock was 5.15 (package.json had "^5.15.0"). So I was really confused to see 5.16. I changed package.json to have "5.15.0" exactly and got the same error. After that I updated my package.json to have "^5.16.0" to see if that fixes the problem. But I still got the same error. After that I tried running a build that was successful in the past to eliminate doubts that new code is causing the error. Past successful builds are also failing now.

Expected behavior

Builds in amplify should succeed and backend should get deployed.

Reproduction steps

I have amplify set up to build on pushes to certain branches. Expectation is that those builds should succeed in Amplify. The error stared happening yesterday. Last successful build was 6/21/2024. Same build fails today.

Code Snippet

// Put your code below this line.

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

@cwomack
Copy link

cwomack commented Jun 26, 2024

Hey, @sgd2z 👋. Can you share your full package.json so we can see your dependencies as well? And are you only using Amplify Hosting and nothing in terms of the client side libraries besides the aws-sdk?

@cwomack cwomack added question Further information is requested hosting and removed pending-triage labels Jun 26, 2024
@cwomack cwomack self-assigned this Jun 26, 2024
@sgd2z
Copy link
Author

sgd2z commented Jun 26, 2024

{
  "name": "brokerboticsapi",
  "version": "1.0.0",
  "description": "Lambda function generated by Amplify",
  "main": "index.js",
  "license": "Apache-2.0",
  "scripts": {
    "build": "prisma generate",
    "migrate": "prisma migrate dev",
    "seed": "node prisma/seed.js",
    "predev": "npm run build",
    "dev": "nodemon app.js",
    "dbpush": "prisma db push"
  },
  "dependencies": {
    "@getbrevo/brevo": "^1.0.1",
    "@prisma/client": "^5.16.0",
    "aws-sdk": "^2.1415.0",
    "aws-serverless-express": "^3.3.5",
    "body-parser": "^1.20.2",
    "dotenv": "^16.3.1",
    "express": "^4.15.2",
    "fyers": "https://x-access-token:@github.com/BrokerBotics/fyers.git",
    "jsencrypt": "^3.3.2",
    "multer": "^1.4.5-lts.1",
    "node-rsa": "^1.1.1",
    "rsa-key": "^0.0.6",
    "stripe": "^12.17.0",
    "tastytrade": "https://x-access-token:@github.com/BrokerBotics/tastytrade.git",
    "tradestation": "https://x-access-token:@github.com/BrokerBotics/tradestation.git",
    "tradier": "https://x-access-token:@github.com/BrokerBotics/tradier.git"
  },
  "devDependencies": {
    "@types/aws-lambda": "^8.10.92",
    "prisma": "^5.16.0"
  }
}

Yeah only using amplify hosting and nothing besides aws-sdk

@sgd2z
Copy link
Author

sgd2z commented Jun 26, 2024

Looking at the package.json, I realized, I don't need that build command and noticed that it was being called. So I removed it and now am running into a different issue:

43 Packaging lambda function failed with the error
44 Command failed with exit code 128: yarn --no-bin-links --production
45 error Command failed.
46 Exit code: 128
47 Command: git
48 Arguments: ls-remote --tags --heads https://x-access-token:[email protected]/BrokerBotics/fyers.git
49 Directory: /codebuild/output/src965929644/src/app/amplify/backend/function/brokerboticsapi/src
50 Output:
51 remote: Support for password authentication was removed on August 13, 2021.
52 remote: Please see https://docs.github.com/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
53 fatal: Authentication failed for 'https://github.com/BrokerBotics/fyers.git/'

@cwomack
Copy link

cwomack commented Jun 26, 2024

@sgd2z, thanks for the quick follow up. To better assist, I'm going to transfer this issue to our amplify-hosting repo.

@cwomack cwomack transferred this issue from aws-amplify/amplify-js Jun 26, 2024
@cwomack cwomack removed their assignment Jun 26, 2024
@cwomack cwomack added the transferred This issue was transferred from another Amplify project label Jun 26, 2024
@sgd2z
Copy link
Author

sgd2z commented Jun 26, 2024

@cwomack Thanks. After updating the token I'm back to the original error. But I read it in more detail and have narrowed down the real issue to this:

46 Error: Could not find Prisma Schema that is required for this command.
47 You can either provide it with `--schema` argument, set it as `prisma.schema` in your package.json or put it into the default location.
48 Checked following paths:
49 schema.prisma: file not found
50 prisma/schema.prisma: file not found
51 prisma/schema: directory not found

I suspect something has changed in the last few days with how the amplify backend deals with paths because the schema file is in the default location of prisma/schema.prisma and nothing has changed otherwise.

@sgd2z
Copy link
Author

sgd2z commented Jun 26, 2024

So, I figured out the issue. I had a script in the frontend package.json called "amplify:brokerboticsapi" where brokerboticsapi is the name of my function. That script has been there in the package.json for 12 months according to github but it was never run until recently. And that script errored out causing all my problems. I removed it and a deploy succeeded.

@sgd2z sgd2z closed this as completed Jun 26, 2024
Copy link

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

Copy link

This issue has been automatically locked.

@github-actions github-actions bot added the archived This issue has been locked. label Jun 26, 2024
@github-actions github-actions bot locked and limited conversation to collaborators Jun 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived This issue has been locked. hosting question Further information is requested transferred This issue was transferred from another Amplify project
Projects
None yet
Development

No branches or pull requests

2 participants