Sentry-laravel: 2.2 upgrade: UndefinedOptionsException : The options "controllers_base_namespace", "traces_sample_rate"

Created on 18 Nov 2020  路  7Comments  路  Source: getsentry/sentry-laravel

Hi

Just upgraded to ^2.2 for Laravel 6 and we get this error message when composer updating:

   Symfony\Component\OptionsResolver\Exception\UndefinedOptionsException  : The options "controllers_base_namespace", "traces_sample_rate" do not exist. Defined options are: "attach_stacktrace", "before_breadcrumb", "before_send", "capture_silenced_errors", "class_serializers", "context_lines", "default_integrations", "dsn", "enable_compression", "environment", "error_types", "excluded_exceptions", "http_proxy", "in_app_exclude", "in_app_include", "integrations", "logger", "max_breadcrumbs", "max_request_body_size", "max_value_length", "prefixes", "project_root", "release", "sample_rate", "send_attempts", "send_default_pii", "server_name", "tags".

We also get this trace (we deleted the whole path below):

  at .../vendor/symfony/options-resolver/OptionsResolver.php:871
    867|         if (\count($diff) > 0) {
    868|             ksort($clone->defined);
    869|             ksort($diff);
    870|
  > 871|             throw new UndefinedOptionsException(sprintf((\count($diff) > 1 ? 'The options "%s" do not exist.' : 'The option "%s" does not exist.').' Defined options are: "%s".', $this->formatOptions(array_keys($diff)), implode('", "', array_keys($clone->defined))));
    872|         }
    873|
    874|         // Override options set by the user
    875|         foreach ($options as $option => $value) {

  Exception trace:

  1   Symfony\Component\OptionsResolver\OptionsResolver::resolve()
      .../vendor/sentry/sentry/src/Options.php:56

  2   Sentry\Options::__construct()
      .../vendor/sentry/sentry/src/ClientBuilder.php:115

We tried to revert to 1.8 but the same error is displayed and the whole app is in 404.

Any idea?

Thanx

support

All 7 comments

Hi @dixens, this usually happens if you upgrade while config caching is enabled.

Try php artisan config:clear and if that doesn't help try to run composer install (or update) with the --no-scripts flag first.

Try and inspect the error message well, because if you upgrade to 2.2 the error might say something different, the one you pasted tells you "controllers_base_namespace", "traces_sample_rate" do not exist which are 2.2 specific configurations so I guess that that is the error you got while downgrading.

If you get the error while upgrading see which options are mentioned and if they are in you config/sentry.php and remove them if needed.

Hi @stayallive

First, thank you so much for your quick reply.

We tried to revert to 1.8 + to upgrade to 1.9 + to pugrade to 2.2 (with --no-scriptsflag) and in every case we get back to the original 2.2 specific "controllers_base_namespace", "traces_sample_rate" do not exist" error message.

artisan config:clearis prevented by this very error message.

Only one option is present in config/sentry.php": 'breadcrumbs.sql_bindings' => true,

Thank you

Never upgrade packages while config caching is active 馃憤

But you can clear it manually by deleting boostrap/cache/config.php file.

You can re-create it later if you want with php artisan config:cache.

Thank you again for your quick reply.

In the meantime we deleted the whole boostrap/cache and vendor folders and upgraded to 1.9 with the --no-scriptsflag and that did the trick.

Awesome! You should be able to upgrade to 2.2 too if you want as long as the config cache is not enabled 馃憤

Let me know if that works or if you are staying on 1.x for now (also fine of course)!

For the time being, we'll just enjoy our stable App again :-)

We never had any issue with upgrading sentry-laravel until today.

So we'll surely upgrade to 2.2 soon :-)

Thanx again for your help.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

acidjazz picture acidjazz  路  4Comments

IMM9O picture IMM9O  路  5Comments

vladislavtkachenko picture vladislavtkachenko  路  4Comments

borealsmith picture borealsmith  路  6Comments

masoudjahromi picture masoudjahromi  路  4Comments