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

GCP Deployment Manager is running yarn again (instead of using packaged file from Serverless) #263

Open
Lusitaniae opened this issue Jun 8, 2021 · 2 comments
Labels

Comments

@Lusitaniae
Copy link

I'm deploying two functions from my CI/CD pipeline

One in AWS, one in GCP

Both of them are pulling repos from our private Gitlab besides all the other public dependencies from npm.

It seems that after serverless packages and uploads the packge to Google Cloud, GCP Deployment Manager is running Yarn again and failing at the yarn step because it's unable to authenticate to our private repos?

Is that expected?

I'd expect a consistent behavior with AWS deployments but GCP stands out?

Serverless: Invoke deploy
Serverless: Invoke package
Serverless: Packaging service...
Serverless: Excluding development dependencies...
Serverless: Compiling function "gcp-function-test"...
Serverless: Uploading artifacts...
Serverless: Artifacts successfully uploaded...
Serverless: Updating deployment...
Serverless: Checking deployment update progress...
................ 
  Error --------------------------------------------------
 
  Error: Deployment failed: RESOURCE_ERROR
  
       {"ResourceType":"gcp-types/cloudfunctions-v1:projects.locations.functions","ResourceErrorCode":"400","ResourceErrorMessage":"Build failed: yarn install v1.22.4\n[1/4] Resolving packages...\n[2/4] Fetching packages...\nerror Command failed.\nExit code: 128\nCommand: git\nArguments: ls-remote --tags --heads git@gitlab.com:my-team/my-project-1\nDirectory: /workspace\nOutput:\nHost key verification failed.\r\nfatal: Could not read from remote repository.\n\nPlease make sure you have the correct access rights\nand the repository exists.\ninfo Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.; Error ID: 98e389b6"}
      at throwErrorIfDeploymentFails (/home/user/workspace/org/app/app1/node_modules/serverless-google-cloudfunctions/shared/monitorDeployment.js:71:11)
      at /home/user/workspace/org/app/app1/node_modules/serverless-google-cloudfunctions/shared/monitorDeployment.js:42:17
      at processTicksAndRejections (internal/process/task_queues.js:97:5)
 
  Get Support --------------------------------------------
     Docs:          docs.serverless.com
     Bugs:          github.com/serverless/serverless/issues
     Issues:        forum.serverless.com
 
  Your Environment Information ---------------------------
     Operating System:          linux
     Node Version:              14.4.0
     Framework Version:         2.1.1 (standalone)
     Plugin Version:            4.0.4
     SDK Version:               2.3.2
     Components Version:        3.1.3

cat package.json 
{
  "name": "app1",
  "version": "1.0.0",
  "description": "",
  "main": "src/index.js",
  "author": "",
  "license": "ISC",
  "dependencies": {
    "app": "git+ssh://git@gitlab.com:my-team/my-project#branch-name"
  }
}

@Lusitaniae Lusitaniae changed the title GCP deployments are running yarn again (instead of using packaged file from Serverless) GCP Deployment Manager is running yarn again (instead of using packaged file from Serverless) Jun 8, 2021
@Lusitaniae
Copy link
Author

Including deployment tokens in package.json works around the problem, but it would be preferred not do it that way.

@pgrzesik
Copy link
Collaborator

pgrzesik commented Jun 8, 2021

Hello @Lusitaniae - I'm going to move this issue to Google plugin repository as it seems more fitting there. Also, please include reproducible steps and sample serverless.yml - it will help diagnosing the problem

@pgrzesik pgrzesik transferred this issue from serverless/serverless Jun 8, 2021
@pgrzesik pgrzesik added the bug label Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants