-
-
Notifications
You must be signed in to change notification settings - Fork 189
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
Call to undefined function Sentry\metrics() #885
Comments
Can you please run |
Sorry for late reply, I attempted to revert my composer change and ran command as you suggested. It updated to 4.5.1 and also updated numerous sub dependencies:
However, the error |
What version does |
|
Can you tell us a bit more about how you setup the SDK? "By the book" https://docs.sentry.io/platforms/php/guides/laravel/ or something custom? Is this error happening on one machine or multiple? Did you dump the composer autoloader, etc. ? |
I wasn't the original developer who created the repo, but I explored to see how things are done and checked your guide. This install is on Laravel 8.83.27 at the moment. Its being composer required like normal. So seems like a normal install for the most part. Most of our laravel installs don't seem to have the config/sentry.php file, but the required .env entries are present. (and this plugin works on all of them so seems like the file must not be required) I attempted to run I did a After checking the install instructions of different laravel versions and comparing them to what I see in the code, seems like we followed instructions for Laravel 5.x for original install back in 2018. I updated our The original composer lock versions prior to me attempting to update were (at present the production site runs fine with these versions):
I can reproduce this issue both on the live production server and our development server in multiple different repos. My next steps will probably be to load an empty Laravel 8.x project and just try to composer install this project and see if it still happens. |
I would advice against Running a small Laravel 8 sample app hails no such errors for me, the metrics are emitted correctly.
Something that is odd:
Line |
Hey @jshwhitlow, did you manage to get any further with investigating? We have not had any other reports of this occurring for others. |
How do you use Sentry?
Sentry SaaS (sentry.io)
SDK version
4.4.1
Steps to reproduce
Whenever we do php artisan or composer update/install with
sentry-laravel
4.2 through 4.4.1 we get the errorCall to undefined function Sentry\metrics()
Downgrading to 4.1.2 resolves this error for us. Attempted to use php artisan/composer update with both php 7.4 and 8.2 on CentOS 7, both produce the same error.
Those versions have this commit which is relevant:
7b19858
Expected result
php artisan / composer update does not produce this error
Actual result
The text was updated successfully, but these errors were encountered: