#Invalid org token

11 messages · Page 1 of 1 (latest)

rancid sun
#

Heyo!

I keep getting sentry reported an error: Invalid org token (http status: 401) and it's really annoying me. What do I do to fix it?

This is my next config:

const sentryOptions: SentryBuildOptions = {
  // For all available options, see:
  // https://docs.sentry.io/platforms/javascript/guides/nextjs/manual-setup/

  // Only print logs for uploading source maps in CI
  silent: !process.env.CI,
  org: 'Headpat',
  project: 'headpat-space',
  sentryUrl: 'https://sentry.example.com/',

  // Upload a larger set of source maps for prettier stack traces (increases build time)
  widenClientFileUpload: true,

  sourcemaps: {
    deleteSourcemapsAfterUpload: true,
  },

  // Automatically annotate React components to show their full name in breadcrumbs and session replay
  reactComponentAnnotation: {
    enabled: true,
  },

  // Routes browser requests to Sentry through a Next.js rewrite to circumvent ad-blockers. (increases server load)
  // Note: Check that the configured route will not match with your Next.js middleware, otherwise reporting of
  // client-side errors will fail.
  tunnelRoute: '/api/monitoring',

  // Automatically tree-shake Sentry logger statements to reduce bundle size
  disableLogger: true,

  // Enables automatic instrumentation of Vercel Cron Monitors.
  // See the following for more information:
  // https://docs.sentry.io/product/crons/
  // https://vercel.com/docs/cron-jobs
  automaticVercelMonitors: false,
}
#

Org not found

#

Invalid org token

terse wind
#

Hi faye, are you on saas or self-hosted?
The line sentryUrl: 'https://sentry.example.com/', doesn't look right, you should probably remove this. Also make sure there's a valid auth token inside .env.sentry-build-plugin or if you supply the auth token via the SENTRY_AUTH_TOKEN env variable.

rancid sun
prisma loom
#

It's possible that you just need to delete the trailing slash from the url

rancid sun
# prisma loom It's possible that you just need to delete the trailing slash from the url

Yeah that also doesn't work. I keep getting this error:

#21 4.603    Creating an optimized production build ...
#21 68.19 unhandledRejection Error: Command failed: /app/node_modules/@sentry/cli-linux-x64/bin/sentry-cli releases new uP4TV8_eAZAesMbeVEr6i
#21 68.19 error: API request failed
#21 68.19
#21 68.19 Caused by:
#21 68.19     sentry reported an error: Invalid org token (http status: 401)
#21 68.19
#21 68.19 Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output.
#21 68.19 Please attach the full debug log to all bug reports.
#21 68.19
#21 68.19     at processTicksAndRejections (null) {
#21 68.19   code: 1,
#21 68.19   killed: false,
#21 68.19   signal: null,
#21 68.19   cmd: '/app/node_modules/@sentry/cli-linux-x64/bin/sentry-cli releases new uP4TV8_eAZAesMbeVEr6i'
#21 68.19 }
#21 68.66 error: script "build" exited with code 1
#21 ERROR: process "bun run build" did not complete successfully: exit code: 1
------
> bun run build:
68.19 Add --log-level=[info|debug] or export SENTRY_LOG_LEVEL=[info|debug] to see more output.
68.19 Please attach the full debug log to all bug reports.
68.19
68.19     at processTicksAndRejections (null) {
68.19   code: 1,
68.19   killed: false,
68.19   signal: null,
68.19   cmd: '/app/node_modules/@sentry/cli-linux-x64/bin/sentry-cli releases new uP4TV8_eAZAesMbeVEr6i'
68.19 }
68.66 error: script "build" exited with code 1
------
ERROR: failed to solve: process "bun run build" did not complete successfully: exit code: 1
❌ Railpack build failed
#

Also willing to share the repo, if you want to take a look at it

rancid sun
#

I just noticed.. the auth token contains a "=" in there, this could be an issue regarding .env files

Is that correct?

sntrys_eyJpYXQiOjE3NDIxNjEwNTUuOSOMEMORETOKENSHERE=_eRU/W1BryaSOMEHERETOO+5Ys14/PgX2ANDHERENg

terse wind
#

yea the = is fine. Happy to take a look at your repo.

rancid sun
#

Sent a DM!