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

Access token is required even if handler configuration parameter is set #469

Closed
SimonFoskolos opened this issue Sep 26, 2019 · 0 comments
Closed
Assignees
Labels
Type: Bug Fix a component so that its behavior aligns with its documentation.
Milestone

Comments

@SimonFoskolos
Copy link

  • rollbar/rollbar-php-symfony-bundle v3.1.2
  • rollbar/rollbar v1.7.4

We recently changed our Rollbar configuration so that it uses fluentd td-agent for logging errors. So we added :

handler: fluent
fluent_tag: identifier_for_component_logging_to_rollbar

to the configuration file and of course removed the access_token variable as it is no longer needed since this is now added to the configuration file of the td-agent daemon. However running composer install fails with:

In Utilities.php line 25:                                                                                                                                            
                                                                                                                                                                       
    $config['access_token'] must not be null                                                                                                                           
                                                                                                                                                                       
  In Utilities.php line 25:                                                                                                                                            
                                                                                                                                                                       
    $config['access_token'] must not be null                                                                                                                           
                                                                                                                                                                       

Adding a false access token resolves this issue, and of course Rollbar works as expected.

Wouldn't it make more sense to check if fluent handler is used and if so, to not call the

private function setAccessToken($config)
    {
        if (isset($_ENV['ROLLBAR_ACCESS_TOKEN']) && !isset($config['access_token'])) {
            $config['access_token'] = $_ENV['ROLLBAR_ACCESS_TOKEN'];
        }
        $this->utilities->validateString($config['access_token'], "config['access_token']", 32, false);
        $this->accessToken = $config['access_token'];
    }

method which in turn calls the validateString method that generates this error ?

@danielmorell danielmorell self-assigned this Dec 20, 2022
@danielmorell danielmorell added this to the v4.0.0 milestone Dec 20, 2022
@danielmorell danielmorell added the Type: Bug Fix a component so that its behavior aligns with its documentation. label Jan 12, 2023
danielmorell added a commit that referenced this issue Jan 17, 2023
Fixed #469 Added `requireAccessToken()` method to senders
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Fix a component so that its behavior aligns with its documentation.
Projects
None yet
Development

No branches or pull requests

2 participants