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

cli exiting with code 1 without logs #90

Closed
felipearomani opened this issue Dec 20, 2023 · 3 comments
Closed

cli exiting with code 1 without logs #90

felipearomani opened this issue Dec 20, 2023 · 3 comments

Comments

@felipearomani
Copy link

Hi everyone.

I have been facing an issue with the CLI that exits with code 1 without showing any log to help me debug.

I'm running the following command:

First, I build my nodeJS app, and it creates the build folder with my source maps because my tsconfig file has the option sourceMaps: true

yarn build

After that I run the following command:

 bugsnag-source-maps upload-node --api-key my-key --app-version 1328.0.0 --directory build --overwrite

So, I received the following output in my terminal.

Preparing upload of node source maps for "build"                                                                                                                                                                                  
› Searching for source maps "build"  

After that, it exits with code 1 without logs to help me debug.

My Node version is: v18.18.2
My Yarn version is: 3.6.1
bugsnag cli version: v2.3.1

Any idea?

@mclack
Copy link

mclack commented Dec 21, 2023

Hi @felipearomani

I'm currently unable to reproduce the behaviour you are seeing. It would suggest to me that there is possibly an issue with finding the source maps, seeing as that's the step the bugsnag-source-maps CLI is failing at, but we would usually expect an error message of No source maps found. to be logged if this were the case. We're keen to gather some more information to reproduce this for ourselves and investigate the issue further.

  • Can you first confirm that there are definitely no source maps appearing in the BugSnag dashboard for the project in question after the CLI is run?
  • Can you also please confirm what command yarn build points to in your package.json? Is this running tsc?
  • Are you running the bugsnag-source-maps CLI from the directory where build is located? Can you also please confirm that a source map ending with .map definitely exists in this build directory when you are running the CLI?
  • When you refer to bugsnag cli version, I'm presuming this is specifically the bugsnag-source-maps CLI. Are you able to try reinstalling this to your machine globally, and ensure that no version of this package is available locally in your NodeJS project? Then can you please attempt the CLI command again in a fresh terminal window.
  • Is this NodeJS app using any type of framework? Like Koa, Express etc.
  • When providing my-key for the --api-key option, I presume this is a placeholder, and you are actually passing in a valid API key when running the CLI?
  • Please provide any other additional information that you think might be relevant or useful.

As this is a public thread, if there is any information you would prefer to share with us directly, then please feel free to open a support ticket with us by contacting [email protected], and referencing this issue: #90

@mclack mclack added the awaiting feedback Awaiting a response from a customer. Will be automatically closed after approximately 2 weeks. label Dec 21, 2023
@felipearomani
Copy link
Author

Hi @mclack

Can you first confirm that there are definitely no source maps appearing in the BugSnag dashboard for the project in question after the CLI is run?

Yes, no source maps were sent to Bugsnag, I followed the path: Project > Project Settings > Upload mapping files > Source maps and got the message "no source maps uploaded"


Can you also please confirm what command yarn build points to in your package.json? Is this running tsc?

Yes, it's there, and yes here we use tsc.

A fragment of out package.json file:

"scripts":{
    "build": "tsc",
}

our tsconfig.json

{
  "compilerOptions": {
    "sourceMap": true,
    "removeComments": true,
    "module": "CommonJS",
    "moduleResolution": "node",
    "target": "es2019",
    "types": ["node", "jest"],
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "noEmit": false,
    "skipLibCheck": true,
    "preserveWatchOutput": true,
    "assumeChangesOnlyAffectDirectDependencies": true,
    "strict": true,
    "noUnusedLocals": false,
    "noUnusedParameters": false,
    "noImplicitReturns": true,
    "noFallthroughCasesInSwitch": true,
    "forceConsistentCasingInFileNames": true,
    "baseUrl": "src",
    "rootDir": "src",
    "outDir": "build",
    "isolatedModules": true
  },
  "exclude": ["node_modules", "scripts"],
  "include": ["./src"]
}

Are you running the bugsnag-source-maps CLI from the directory where build is located? Can you also please confirm that a source map ending with .map definitely exists in this build directory when you are running the CLI?

Yes, I've been running on the project root, and when I build the project, it creates the build folder at the same level. I tried running the command without the folder or passing the wrong folder to test and got the same error.

The .map files are there.


When you refer to bugsnag cli version, I'm presuming this is specifically the bugsnag-source-maps CLI.

Yes! You are correct!


Are you able to try reinstalling this to your machine globally, and ensure that no version of this package is available locally in your NodeJS project? Then can you please attempt the CLI command again in a fresh terminal window.

Yes, I tried, and another thing that I did was run it in my local machine and on our Kubernetes cluster using a Job deployment and got the same error result.


Is this NodeJS app using any type of framework? Like Koa, Express etc.

Yes, we use express and GraphQL, following a fragment of our package.json:

 "dependencies": {
    "@apollo/server": "4.9.3",
    "@apollo/server-plugin-landing-page-graphql-playground": "4.0.1",
    "@apollo/subgraph": "2.5.4",
    "@bugsnag/js": "7.21.0",
    "@bugsnag/plugin-express": "7.19.0",
    "@bugsnag/source-maps": "2.3.1",
    "express": "4.18.2",
    "graphql": "16.8.1",
    "graphql-parse-resolve-info": "4.13.0",
    "graphql-relay": "0.10.0",
    "graphql-sequelize": "9.5.1",
    "graphql-tag": "2.12.6",
    "graphql-voyager": "2.0.0",
    "ts-node": "10.9.1",
    "tsconfig-paths": "4.2.0",
    "typescript": "5.2.2",
    "utility-types": "3.10.0",
    
     ... other dependencies
  },

When providing my-key for the --api-key option, I presume this is a placeholder, and you are actually passing in a valid API key when running the CLI?

Yes, it's a placeholder, I got my key in Project > Settings > Notifier API Key and tried with my personal token in My Account Settings > Personal Auth Token and got the same issue.

@mclack
Copy link

mclack commented Dec 22, 2023

Hi @felipearomani

Thanks for the additional information.

We're aware that you have also opened a ticket with us regarding this issue by contacting [email protected]. As such, we will close the current issue on GitHub, and will continue to investigate this and provide support to you on the support ticket.

@mclack mclack closed this as completed Dec 22, 2023
@mclack mclack removed the awaiting feedback Awaiting a response from a customer. Will be automatically closed after approximately 2 weeks. label Dec 22, 2023
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