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

sentry.properties ignored #231

Closed
dickermoshe opened this issue Apr 22, 2024 · 10 comments
Closed

sentry.properties ignored #231

dickermoshe opened this issue Apr 22, 2024 · 10 comments
Assignees

Comments

@dickermoshe
Copy link

Environment

Dart 3.3.3 (stable) (Tue Mar 26 14:21:33 2024 +0000) on "windows_x64"
sentry_dart_plugin: ^1.6.0

Steps to Reproduce

  1. Place sentry config in sentry.properties instead of pubspec.yaml

Expected Result

Work

Actual Result

[❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚] 0% reading config values..        
Downloaded Sentry CLI binary checksum verification passed successfully (hash: 1e91fbdd81dceb372855f59d2526c1f2de4ea5a51157670e5070a914efd1f09c).
☑ reading config values
[❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚] 9% validating config values..
Project is empty, check 'project' at pubspec.yaml or SENTRY_PROJECT env. var.

Organization is empty, check 'org' at pubspec.yaml or SENTRY_ORG env. var.

Auth Token is empty, check 'auth_token' at pubspec.yaml or SENTRY_AUTH_TOKEN env. var.
@buenaflor
Copy link
Contributor

hey currently you need to have the required fields still in the pubspec field. we'll see to it so we can change this

@buenaflor buenaflor moved this from Needs Discussion to Backlog in Mobile & Cross Platform SDK Apr 24, 2024
@ospaarmann
Copy link

hey currently you need to have the required fields still in the pubspec field. we'll see to it so we can change this

Hey,

Could you clarify your previous message? Specifically, is it necessary to place the configuration solely in the pubspec file, or does sentry.properties still function? If both are needed, is it possible to include placeholder data in the pubspec?

I'm also concerned about the security implications of storing the authentication token in pubspec.yaml, as it would require including sensitive information in version control. Is there an alternative approach that I might be overlooking?

Thank you!

@buenaflor
Copy link
Contributor

buenaflor commented May 28, 2024

There's a mistake in our readme and should be updated, sentry.properties does not yet support the project, org, and auth token field.

I'm also concerned about the security implications of storing the authentication token in pubspec.yaml

You can also use an environment variable SENTRY_AUTH_TOKEN in that case

@buenaflor
Copy link
Contributor

We will provide a fix soon for this so sentry.properties can be a standalone piece of configuration

@denrase
Copy link
Collaborator

denrase commented Jun 3, 2024

@dickermoshe This sould work with the most recent version. Please upgrade and male sure you completley remove sentry config in pubspec and move it to the properties file, mixing both is not supported. Just confirmed this with our flutter example app.

Built sentry_dart_plugin:sentry_dart_plugin.
[❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚] 0% reading config values..        
Downloading sentry-cli from https://downloads.sentry-cdn.com/sentry-cli/2.27.0/sentry-cli-Darwin-universal to .dart_tool/pub/bin/sentry_dart_plugin/sentry-cli

Downloaded Sentry CLI binary checksum verification passed successfully (hash: 8693527282890285f55d9b55414905e8621dd788ad3ae4c85175b84e8eeb6a04).

Sentry CLI downloaded successfully.

sentry config not found in pubspec.yaml

retrieving config from sentry.properties
☑ reading config values                                                             
☑ validating config values                                                             
[❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚] 18% uploading debug symbols..    

@ospaarmann
Copy link

I just upgraded to the latest version (2.0.0) and moved all configuration to sentry.properties. It does not work:

dart run sentry_dart_plugin
Building package executable... 
Built sentry_dart_plugin:sentry_dart_plugin.
[❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚] 0% reading config values..        
sentry config not found in pubspec.yaml

retrieving config from sentry.properties

Downloading Sentry CLI 2.31.0 from https://downloads.sentry-cdn.com/sentry-cli/2.31.0/sentry-cli-Darwin-universal to .dart_tool/pub/bin/sentry_dart_plugin/sentry-cli

Sentry CLI binary checksum verification passed successfully (hash: 5d12bee428d18ca49657f2573b130a0c5990a665e0cbe6fad583e72a2fd1e3cc).

Sentry CLI downloaded successfully.
☑ reading config values                                                             
[❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚❚] 9% validating config values..                             
Project is empty, check 'project' at pubspec.yaml or SENTRY_PROJECT env. var.

Organization is empty, check 'org' at pubspec.yaml or SENTRY_ORG env. var.

Auth Token is empty, check 'auth_token' at pubspec.yaml or SENTRY_AUTH_TOKEN env. var.

@denrase
Copy link
Collaborator

denrase commented Jun 3, 2024

@ospaarmann Could you share the contents of the properties file? You can redact the values.

@ospaarmann
Copy link

Sure thing

./sentry.properties

# This is not used atm, see: https://github.com/getsentry/sentry-dart-plugin/issues/231

upload_debug_symbols: true
upload_source_maps: true
upload_sources: true
project: my_project
org: my-org
auth_token: REDACTED
# url: ...
wait_for_processing: false
log_level: error
# release: ...
# web_build_path: ...
commits: auto
ignore_missing: true

And the relevant part of ./pubspec.lock

sentry:
    dependency: transitive
    description:
      name: sentry
      sha256: "961630a4dba41cebd692612421fd3805a991ebd8ef4a8d84a6c179e6b89eaf22"
      url: "https://pub.dev"
    source: hosted
    version: "8.0.0"
  sentry_dart_plugin:
    dependency: "direct dev"
    description:
      name: sentry_dart_plugin
      sha256: "2ad5ef14bf99776fa3fea09c53d275732a23c963e68f20c2facea379cce5e7c6"
      url: "https://pub.dev"
    source: hosted
    version: "2.0.0"
  sentry_flutter:
    dependency: "direct main"
    description:
      name: sentry_flutter
      sha256: "705da7adfcd1fb23fc8720b6e222f5e03d53f1d020cd635586c319ee323366b4"
      url: "https://pub.dev"
    source: hosted
    version: "8.0.0"

@denrase
Copy link
Collaborator

denrase commented Jun 3, 2024

@ospaarmann The syntax for .properties files is different. You have to use = instead of ": "

upload_debug_symbols=true
upload_source_maps=true
upload_sources=true
project=my_project
org=my-org
auth_token=REDACTED
# url=...
wait_for_processing=false
log_level=error
# release=...
# web_build_path=...
commits=auto
ignore_missing=true

This should do the trick. I will close this issue for now.

@denrase denrase closed this as completed Jun 3, 2024
@github-project-automation github-project-automation bot moved this from Backlog to Done in Mobile & Cross Platform SDK Jun 3, 2024
@ospaarmann
Copy link

That did indeed do the trick. Thanks @denrase ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

4 participants