serverless-sentry-plugin: Serverless deployment fails with "fatal: No names found, cannot describe anything."

Since the latest minor version change (from 2.3.0 to 2.4.0) the serverless deployment process on the project I am working on is failing with the following error message:

Error: Sentry: No Git available - Error: Command failed: git describe --exact-match --tags HEAD fatal: No names found, cannot describe anything.

It appears that the cause is running git describe on a git repository that has no tags; the repo I’m working on has no tags.

And I can see from https://github.com/arabold/serverless-sentry-plugin/commit/612f76dc085ca5604a7cb6f806e1886d49cbd91e#diff-1bcdce6971f2549017c3a649865c9921b7e765fb368eb43e78fbc373a779ba31 that this package is no longer suppressing errors.

Can you suggest how to proceed?

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 2
  • Comments: 23 (9 by maintainers)

Most upvoted comments

v2.5.2 fixes the peer dependency now

I’m getting nuts here.

The same issue happens on my deployment (local dev machine to AWS). My current git branch does not have a tag yet. After I add one with git tag 'TEST' it’s working fine. I would like not to have to do that beforehand (though its a one time fix).

Finally! Yay! 🎉 Thank you for testing and verifying. I’m gonna close this issue then and go take a nap 😴

Seems 2.5.1 also has a bug. Damn it. I need a test project. I’m literally on a plane over the Atlantic right now 🙄

There’s a new serverless-sentry-lib v2.5.1 that I just published 5 minutes ago. @sentry/integrations should be a peer dependency now and needs to be installed in your project. Only that way I could handle compatibility with v7 for now.

So, one last ask (sorry): Please update serverless-sentry-lib to v2.5.1 and then run npm install @sentry/integrations to install the new peer dependency, just to be sure. Then the errors should be gone. Sorry for the trouble.

The webpack versions should be unrelated.

or maybe some of those devDependencies should be dependencies?

Ok, I’m back, and unfortunately we’re still getting an error:

{
    "errorType": "Runtime.ImportModuleError",
    "errorMessage": "Error: Cannot find module '@sentry/integrations'\nRequire stack:\n- /var/task/node_modules/serverless-sentry-lib/dist/index.js\n- /var/task/src/aws/index.js\n- /var/runtime/index.mjs",
    "stack": [
        "Runtime.ImportModuleError: Error: Cannot find module '@sentry/integrations'",
        "Require stack:",
        "- /var/task/node_modules/serverless-sentry-lib/dist/index.js",
        "- /var/task/src/aws/index.js",
        "- /var/runtime/index.mjs",
        "    at _loadUserApp (file:///var/runtime/index.mjs:726:17)",
        "    at Object.module.exports.load (file:///var/runtime/index.mjs:741:21)",
        "    at file:///var/runtime/index.mjs:781:15",
        "    at file:///var/runtime/index.mjs:4:1"
    ]
}

Here’s what is in the package.json, amongst other stuff of course:

  "dependencies": {
    "@sentry/integrations": "^7.2.0",
    "@sentry/node": "^7.2.0",
    "@sentry/serverless": "^7.2.0",
    "@sentry/types": "^7.2.0",
    "aws-lambda": "^1.0.7",
    "aws-xray-sdk": "^3.3.6",
    "serverless-sentry-lib": "^2.5.0",
    "source-map-support": "^0.5.21"
  },
  "devDependencies": {
    "@aws-sdk/types": "^3.110.0",
    "@babel/preset-env": "^7.18.2",
    "@babel/preset-typescript": "^7.17.12",
    "@types/aws-lambda": "^8.10.101",
    "aws-sdk": "^2.1158.0",
    "serverless": "^2.72.3",
    "serverless-appsync-plugin": "^1.13.0",
    "serverless-iam-roles-per-function": "^2.0.2",
    "serverless-offline": "^6.9.0",
    "serverless-plugin-log-subscription": "^1.4.0",
    "serverless-plugin-tracing": "^2.0.0",
    "serverless-prune-plugin": "^1.6.1",
    "serverless-pseudo-parameters": "^2.6.1",
    "serverless-sentry": "^2.5.0",
    "serverless-stage-manager": "^1.0.5",
    "serverless-webpack": "^5.7.1",
    "ts-loader": "^8.4.0",
    "ts-node": "^10.8.1",
    "typescript": "^4.7.4",
    "webpack": "^4.46.0",
    "webpack-node-externals": "^2.5.2"
  }

Have included a couple of other AWS-related packages, just in case they are significant.

Not missing anything obvious are we?

@arabold yep, just trying to repro now 😄

will post back here as soon as I’m done

Sorry about that. You should be able to install @sentry/integrations as a new dependency to your own project. It’s a peer dependency of serverless-sentry-lib now to allow the use with @sentry/node v7. I need to see if I can get rid of it completely 😦

I don’t believe this is a problem with 2.5.0 anymore. It’s not explicit in the changelog but this case should be properly handled now. Please let me know if not.