#Sentry Self hosted changes
34 messages · Page 1 of 1 (latest)
Hi @cosmic mirage. I'm happy to dig into this for you! I'll check my internal sources for answers to your question! :wave:
When migrating a project from Sentry SaaS to a self-hosted Sentry setup, the most critical change is updating the DSN in your application to point to your self-hosted instance. The DSN must reflect the correct domain and project ID for your self-hosted environment. For example, the DSN should use your self-hosted Sentry's URL, not the SaaS URL (e.g., <https://<key>@sentry.yourdomain.com/<project_id>>). If you see a DSN like @nginx/3, that's incorrect—the domain should be your actual Sentry instance's address, not an internal Docker service name like nginx How will my DSN change during the self-hosted migration?.
Other configuration changes to consider:
-
system.url-prefix:
In your self-hosted Sentry'sconfig.yml, setsystem.url-prefixto the public URL where your Sentry instance is accessible. This ensures that links and DSNs generated by Sentry are correct. For example:system.url-prefix: "<https://sentry.yourdomain.com">This is essential for proper operation and for generating valid DSNs Updating basic configuration.
-
SSL/TLS and Reverse Proxy:
If you are using HTTPS, ensure your reverse proxy or load balancer is configured correctly, and update the SSL/TLS section insentry/sentry.conf.pyas needed. This helps avoid CSRF errors and ensures secure communication Productionalizing.
-
CSRF Trusted Origins:
If your Sentry instance is behind a proxy or accessed via a custom domain, you may need to setCSRF_TRUSTED_ORIGINSinsentry.conf.pyto include your domain, especially if you encounter CSRF errors CSRF Token issue in aws ec2 server. -
Mail and Integrations:
If you use email notifications or integrations (Slack, GitHub, etc.), you will need to reconfigure these in your self-hosted instance, as integrations and API tokens do not migrate from SaaS to self-hosted Relocating to Cloud. -
Environment Variables:
If you need to override environment-specific settings, use a.env.customfile or set environment variables as needed for your deployment Updating basic configuration.
Summary:
- Update the DSN in your project to use your self-hosted Sentry URL.
- Set
system.url-prefixinconfig.yml. - Configure SSL/TLS and proxies as needed.
- Set
CSRF_TRUSTED_ORIGINSif required. - Reconfigure email and integrations.
- Adjust environment variables as needed.
If you follow these steps, your project should report errors to your self-hosted Sentry instance correctly. If you encounter issues, check your Sentry and proxy logs to ensure events are being received and processed.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@cosmic mirage Our robots are still learning and improving, please let us know if this response was correct by reacting below.
@stray plover will i still recoeve emails from sentry for the issues if i am on self hosted version
Let me check the knowledge base for you again. One moment! :books:
Yes, you can still receive email notifications for issues when using the self-hosted version of Sentry, provided that you have correctly configured your email (SMTP) settings in your self-hosted instance. Sentry self-hosted supports outbound email for alerts, workflow notifications, and other events, just like the SaaS version. You need to ensure your SMTP server is set up in config.yml and that your notification settings are configured as desired.
However, you must note:
- Email notifications will only work if your SMTP configuration is correct and the relevant alert rules or notification settings are enabled.
- Some users have reported issues where test emails work, but alert emails do not get sent. This is often due to alert rules not being set up, or specific user/project notification settings. Make sure you have created the necessary alert rules for your projects to trigger emails for new issues or events.
- If you update mail settings via the web interface, you may need to comment out the default
mail.host: 'smtp'in yourconfig.ymlfor your changes to take effect. - Sentry only supports SMTP for outbound email in self-hosted mode; API-based email delivery (like SendGrid API) is not supported, but you can use SMTP relays provided by those services.
For more details and troubleshooting, see the self-hosted email setup documentation and related issues:
If you encounter issues where test emails work but alert emails do not, double-check your alert rules and notification settings, as this is a common cause reported by other users in the community Sentry not sending email when a new issue happens or a new event of an existing issue happens.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@cosmic mirage Our robots are still learning and improving, please let us know if this response was correct by reacting below.
@stray plover how to get notifications on discord , how can i add integration to my discord channel to send alerts here ?currently geting this error {"client_id": ["Value "" is not snowflake."]}
Let me check the knowledge base for you again. One moment! :books:
To receive Sentry notifications in your Discord channel, you need to set up the Discord integration. The error you're seeing, {"client_id": ["Value \"\" is not snowflake."]}, typically occurs in self-hosted Sentry when the Discord integration is not properly configured with your own Discord application's credentials.
Here's how to set up the integration for self-hosted Sentry:
-
Create a Discord Bot:
- Go to the Discord Developer Portal and create a new application.
- In your application's settings, collect the following:
- Application ID and Public Key (under "General Information")
- Client Secret (under "OAuth2" > "General")
- Bot Token (under "Bot")
Step-by-step guide
-
Update your Sentry
config.yml:
Add the credentials you collected to your Sentry instance'sconfig.yml:discord.application-id: "<application id>" discord.public-key: "<public key>" discord.client-secret: "<client secret>" discord.bot-token: "<bot token>"Restart your Sentry server after making these changes.
-
Configure Discord Endpoints:
- In the Discord Developer Portal, set the Interactions Endpoint URL to:
<https://<your-sentry-domain>/extensions/discord/interactions/> - Set the OAuth2 Redirect URI to:
<https://<your-sentry-domain>/extensions/discord/setup/>
Save your changes in the Discord Developer Portal.
- In the Discord Developer Portal, set the Interactions Endpoint URL to:
-
Install the Integration:
- In Sentry, go to Settings > Integrations > Discord and click "Add Installation".
- Follow the prompts to authorize the bot in your Discord server (you need "Manage Server" permissions).
- Set Up Alerts:
- When creating or editing an alert rule in Sentry, select "Send a Discord notification" as the action.
- Enter the Discord channel ID (not the name) where you want to receive alerts. To get the channel ID, right-click the channel in Discord and select "Copy Link"—the last part of the URL is the channel ID.
Troubleshooting the "client_id is not snowflake" error:
This error means your discord.application-id is missing or empty in your config.yml. Double-check that you've added the correct Application ID and restarted Sentry after updating the config file Discord Integration Problem -- is not snowflake, Discord Integration Developer Docs.
For more details, see the official Sentry Discord integration documentation.
If you follow these steps, you should be able to receive Sentry alerts in your Discord channel.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@cosmic mirage Our robots are still learning and improving, please let us know if this response was correct by reacting below.
@stray plover
Let me check the knowledge base for you again. One moment! :books:
Sorry @cosmic mirage, I seem to be having a bit of trouble. Don't worry though, I've pinged my support and they will try to fix me up! :technologist:
Perhaps try again in 15mins?
@stray plover Auth token is required for this request. Please run sentry-cli login and try again!
Ask Gemini
i got this error on my Android Build
How to fix
Let me check the knowledge base for you again. One moment! :books:
The error message:
Auth token is required for this request. Please run `sentry-cli login` and try again!
means that the Sentry CLI is not authenticated and cannot perform the requested operation during your Android build.
How to fix:
-
Set the SENTRY_AUTH_TOKEN environment variable
The recommended way for CI/CD and build servers is to set theSENTRY_AUTH_TOKENenvironment variable with a valid Sentry auth token. For example, in your CI configuration or before running your build:export SENTRY_AUTH_TOKEN=sntrys_YOUR_TOKEN_HEREOr, in a GitHub Actions workflow:
steps: - name: Build run: ./gradlew assembleRelease env: SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN }}MSBuild Setup - Authentication, CLI Configuration and Authentication
-
Alternatively, run
sentry-cli loginlocally
If you are building locally, you can run:sentry-cli loginThis will prompt you to enter your auth token and will save it to your
~/.sentryclircfile for future use CLI Configuration and Authentication. -
Check your build configuration
If you are using the Sentry Gradle plugin, make sure yoursentryblock inbuild.gradlereferences the auth token correctly:sentry { authToken = System.getenv("SENTRY_AUTH_TOKEN") // other config... }
Summary:
Set the SENTRY_AUTH_TOKEN environment variable with a valid token, or run sentry-cli login to authenticate. This will resolve the error and allow your Android build to upload symbols or source maps to Sentry.
If you are running in CI, always use the environment variable method for security and automation.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@cosmic mirage Our robots are still learning and improving, please let us know if this response was correct by reacting below.
WARN 2025-07-17 01:32:39.034383 +05:30 Using organization sentry (embedded in token) rather than manually-configured organization xivtech. To use xivtech, please provide an auth token for this organization.
error: API request failed
Caused by:
[7] Could not connect to server (Failed to connect to localhost port 9000 after 0 ms: Could not connect to server)
what could be the issue
@stray plover WARN 2025-07-17 01:32:39.034383 +05:30 Using organization sentry (embedded in token) rather than manually-configured organization xivtech. To use xivtech, please provide an auth token for this organization.
error: API request failed
Caused by:
[7] Could not connect to server (Failed to connect to localhost port 9000 after 0 ms: Could not connect to server)
what could be the issue
Let me check the knowledge base for you again. One moment! :books:
The warning and error messages you are seeing indicate two separate issues:
-
Organization Mismatch Warning:
WARN ... Using organization sentry (embedded in token) rather than manually-configured organization xivtech. To use xivtech, please provide an auth token for this organization.This means your auth token is tied to the
sentryorganization, but your configuration or command is specifyingxivtech. Sentry CLI will use the organization embedded in the token, not the one you manually provide, unless you generate and use a token for the correct organization. This behavior is confirmed in the knowledge sources, and the CLI will warn you and use the token's organization, ignoring the manually supplied one error: Two different org values supplied. -
Connection Error:
error: API request failed Caused by: [7] Could not connect to server (Failed to connect to localhost port 9000 after 0 ms: Could not connect to server)This error means that Sentry CLI is trying to connect to
localhost:9000but cannot reach a Sentry server there. This usually happens if your Sentry instance is not running onlocalhost:9000, or if thesystem.url-prefixor related configuration is set incorrectly. The CLI uses the root URL configured in your Sentry instance, and if that is set to<http://localhost:9000,> it will try to connect there—even if your actual Sentry server is running elsewhere. You need to update your Sentry configuration (specificallysystem.url-prefix) to the correct public URL of your Sentry instance, and restart Sentry after making this change. This is a common cause for this error in self-hosted setups API request failed - wrong address.
Summary of what to check:
- Make sure your auth token matches the organization you want to use.
- Update your Sentry instance's
system.url-prefixto the correct URL (notlocalhostif accessed remotely). - Ensure your Sentry server is running and accessible at the configured address.
If you fix the organization token and the URL configuration, these errors should be resolved.
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@cosmic mirage Our robots are still learning and improving, please let us know if this response was correct by reacting below.
@stray plover i changed the organization slug to xivtech from the dashboard what do i ened to change now on app side ?
do i need to add sentry.proeprties file in the project roo t
Let me check the knowledge base for you again. One moment! :books:
When you change your organization slug in Sentry (for example, to xivtech), you need to update all configurations in your app and related tooling that reference the old organization slug. Specifically:
-
Update Sentry CLI and Build Configurations:
If you use Sentry CLI (for example, for uploading source maps or symbols), update the organization slug in your configuration. This can be done in a.sentryclircorsentry.propertiesfile, or via theSENTRY_ORGenvironment variable. The new slug should bexivtechinstead of the old value.Example
.sentryclirc:[defaults] org=xivtech project=<your-project-slug> [auth] token=<your-auth-token>Example
sentry.properties:defaults.org=xivtech defaults.project=<your-project-slug> auth.token=<your-auth-token>You only need one of these files, not both. Place it in your project root if your build tools or Sentry CLI expect it there. If you already have a configuration file, just update the
orgvalue.
Can I update my Sentry Organisation slug?
Troubleshooting Integrations -
Update Environment Variables:
If you use theSENTRY_ORGenvironment variable in your CI/CD or build scripts, update its value toxivtech. -
Update Integrations and API URLs:
If you have integrations (e.g., GitHub Actions, Bitbucket Pipelines, Netlify, Vercel, etc.) or scripts that reference the old organization slug in API URLs, update them to usexivtechas well.
- No Need to Update DSN:
The DSN is not based on the organization slug, so you do not need to update your project's DSN after changing the org slug Can I update my Sentry Organisation slug?.
Summary:
- Update the organization slug in your Sentry CLI config (
.sentryclircorsentry.properties) or environment variables. - Update any integrations or scripts that reference the old slug.
- You do not need to update the DSN.
If you already have a sentry.properties or .sentryclirc file, just update the org value. If you don't have one and your build process requires it, you can add it to your project root.
For more details, see the official guidance: Can I update my Sentry Organisation slug?
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
@cosmic mirage Our robots are still learning and improving, please let us know if this response was correct by reacting below.