You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you are using sentry.io, please post a link to your issue so we can take a look:
N/A
Configuration:
(@sentry/react-native)
My issue pertains to the native iOS/Android build phase, so I doubt the JS configuration is relevant.
I have following issue:
When Sentry fails to load configuration values from a .env file, it does so silently, then noisily fails to load from a sentry.properties if not present. I spent several hours troubleshooting this and reading through the documentation that confirms that loading from a .env is supported before I decided to test a potential workaround that would involve loading the .env into the environment with source .env, which revealed that my .env file could not be loaded due to a value containing unquoted whitespace. Removing the unquoted whitespace solved the problem, allowing me to load the properties from the .env, but Sentry should have said something in the build logs about it trying and failing to load from .env.
Steps to reproduce:
Initialize Sentry with the Sentry wizard: npx @sentry/wizard -s -i reactNative
Remove the sentry.properties files in favor of providing the required values through an .env file placed at the root directory of your project. Also add a property with some whitespace:
SPOOKY_WHITESPACE=s p o o k y w h i t e s p a c e
SENTRY_AUTH_TOKEN=...
SENTRY_DSN=...
SENTRY_ORG=...
SENTRY_PROJECT=...
SENTRY_URL=...
Run a release build on Android or iOS.
Actual result:
...
Failed to find file referenced by SENTRY_PROPERTIES
error: An organization slug is required (provide with --org)
Expected result:
Failed to load Sentry properties from `some/path/.env`: (perhaps some more details about the failure).
Falling back to `file/referenced/by/SENTRY_PROPERTIES`.
Failed to find file referenced by SENTRY_PROPERTIES .
The text was updated successfully, but these errors were encountered:
cjshearer
changed the title
Sentry _silently_ fails to load properties from a .env file.
Sentry silently fails to load properties from a .env file.
May 22, 2023
If there is an error loading a .env file, we now print a warning message. There is no warning when the .env was not found because users might not have set up a .env; we only warn when the .env was found but there was some error reading it.
FixesGH-1624
OS:
Platform:
SDK:
@sentry/react-native
(>= 1.0.0)react-native-sentry
(<= 0.43.2)@sentry/react-native
version: 5.5.0react-native
version: 0.71.7Are you using Expo?
Are you using sentry.io or on-premise?
If you are using sentry.io, please post a link to your issue so we can take a look:
N/A
Configuration:
(
@sentry/react-native
)My issue pertains to the native iOS/Android build phase, so I doubt the JS configuration is relevant.
I have following issue:
When Sentry fails to load configuration values from a .env file, it does so silently, then noisily fails to load from a
sentry.properties
if not present. I spent several hours troubleshooting this and reading through the documentation that confirms that loading from a .env is supported before I decided to test a potential workaround that would involve loading the .env into the environment withsource .env
, which revealed that my .env file could not be loaded due to a value containing unquoted whitespace. Removing the unquoted whitespace solved the problem, allowing me to load the properties from the .env, but Sentry should have said something in the build logs about it trying and failing to load from .env.Steps to reproduce:
npx @sentry/wizard -s -i reactNative
sentry.properties
files in favor of providing the required values through an.env
file placed at the root directory of your project. Also add a property with some whitespace:Actual result:
Expected result:
The text was updated successfully, but these errors were encountered: