getsentry / sentry-webpack-plugin

Repo moved to https://github.com/getsentry/sentry-javascript-bundler-plugins. Please open any issues/PRs there.
MIT License
662 stars 116 forks source link

Uploading source maps respond bad request (http 400) with no meaningful response #420

Closed leonimurilo closed 1 year ago

leonimurilo commented 1 year ago

Environment

NODE_ENV=production Error happening only in openshift build container. Does not happen on my local computer.

"@sentry/webpack-plugin": "^1.20.0"

Steps to Reproduce

webpack plugin config:

    new SentryCliPlugin({
      debug: true,
      cleanArtifacts: true,
      include: './www',
      ignore: ['node_modules', 'webpack.config.babel.js'],
      release: releaseVersionNumber,
      urlPrefix: debug ? '~/devel/app/' : '~/app/',
      project: 'myproject',
      org: 'myorg',
      authToken: 'hidden',
    }),

.sentryclirc: I tried true or false

[http]
keepalive=false

Expected Result

Actual Result

ERROR in Sentry CLI Plugin: Command failed: /opt/app-root/src/node_modules/@sentry/cli/sentry-cli releases new 4.0.83
  INFO    2023-01-13 12:30:30.367243490 +00:00 Loaded config from /opt/app-root/src/.sentryclirc
  DEBUG   2023-01-13 12:30:30.367334165 +00:00 sentry-cli version: 1.74.6, platform: "linux", architecture: "x86_64"
  INFO    2023-01-13 12:30:30.367344874 +00:00 sentry-cli was invoked with the following command line: "/opt/app-root/src/node_modules/@sentry/cli/sentry-cli" "releases" "new" "4.0.83"
  DEBUG   2023-01-13 12:30:30.367877786 +00:00 request POST https://sentry.io/api/0/projects/<myorg>/<myproject>/releases/
  DEBUG   2023-01-13 12:30:30.367896032 +00:00 pipeline: webpack-plugin/1.20.0
  DEBUG   2023-01-13 12:30:30.367907211 +00:00 using token authentication
  DEBUG   2023-01-13 12:30:30.367923550 +00:00 json body: {"version":"4.0.83","projects":["myproject"],"dateStarted":"2023-01-13T12:30:30.367841650Z"}
  DEBUG   2023-01-13 12:30:30.367934701 +00:00 retry number 0, max retries: 0
  DEBUG   2023-01-13 12:30:30.542422337 +00:00 > POST /api/0/projects/<myorg>/<myproject>/releases/ HTTP/1.1
  DEBUG   2023-01-13 12:30:30.542480959 +00:00 > Host: sentry.io
  DEBUG   2023-01-13 12:30:30.542496664 +00:00 > Accept: */*
  DEBUG   2023-01-13 12:30:30.542509462 +00:00 > Connection: TE
  DEBUG   2023-01-13 12:30:30.542543716 +00:00 > TE: gzip
  DEBUG   2023-01-13 12:30:30.542557469 +00:00 > User-Agent: sentry-cli/1.74.6 webpack-plugin/1.20.0
  DEBUG   2023-01-13 12:30:30.543158068 +00:00 > Authorization: <HIDDEN TOKEN>
  DEBUG   2023-01-13 12:30:30.543192684 +00:00 > Content-Type: application/json
  DEBUG   2023-01-13 12:30:30.543208731 +00:00 > Content-Length: 98
  DEBUG   2023-01-13 12:30:30.591189733 +00:00 < HTTP/1.1 400 Bad Request
  DEBUG   2023-01-13 12:30:30.591249387 +00:00 < Server: nginx
  DEBUG   2023-01-13 12:30:30.591270930 +00:00 < Date: Fri, 13 Jan 2023 12:30:30 GMT
  DEBUG   2023-01-13 12:30:30.591288913 +00:00 < Content-Type: text/plain
  DEBUG   2023-01-13 12:30:30.591305976 +00:00 < Content-Length: 11
  DEBUG   2023-01-13 12:30:30.591322230 +00:00 < Connection: keep-alive
  DEBUG   2023-01-13 12:30:30.591337183 +00:00 < Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
  DEBUG   2023-01-13 12:30:30.592918101 +00:00 response status: 400
  DEBUG   2023-01-13 12:30:30.592947454 +00:00 body: Bad Request
error: API request failed
  caused by: sentry reported an error: bad request (http status: 400)
  DEBUG   2023-01-13 12:30:30.593004541 +00:00 skipping update nagger because session is not attended

I would like some help to understand what is going on. The error message body is useless, so I don't know what may be causing the issue here.

leonimurilo commented 1 year ago

My mistake... My auth token was wrongly encoded. I am going to close this issue.

It could be worth it for Sentry team to add a check to make this encoding Bad request error clear.