Giter VIP home page Giter VIP logo

Comments (8)

cleptric avatar cleptric commented on July 3, 2024

Can you please run composer upgrade -W sentry/sentry-laravel, so all sub dependencies are updated as well?

from sentry-laravel.

jshwhitlow avatar jshwhitlow commented on July 3, 2024

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:

  - Upgrading symfony/console (v5.4.36 => v5.4.39)
  - Upgrading symfony/error-handler (v5.4.38 => v5.4.39)
  - Upgrading symfony/event-dispatcher (v5.4.35 => v5.4.39)
  - Upgrading symfony/finder (v5.4.35 => v5.4.39)
  - Upgrading symfony/http-foundation (v5.4.38 => v5.4.39)
  - Upgrading symfony/http-kernel (v5.4.38 => v5.4.39)
  - Upgrading symfony/mime (v5.4.38 => v5.4.39)
  - Upgrading symfony/options-resolver (v5.4.21 => v5.4.39)
  - Upgrading symfony/process (v5.4.36 => v5.4.39)
  - Upgrading symfony/routing (v5.4.38 => v5.4.39)
  - Upgrading symfony/string (v5.4.36 => v5.4.39)
  - Upgrading symfony/translation (v5.4.35 => v5.4.39)
  - Upgrading symfony/var-dumper (v5.4.38 => v5.4.39)

However, the error undefined function Sentry\metrics() is still present.

from sentry-laravel.

cleptric avatar cleptric commented on July 3, 2024

What version does composer show output for sentry/sentry?

from sentry-laravel.

jshwhitlow avatar jshwhitlow commented on July 3, 2024

versions : * 4.7.0

from sentry-laravel.

cleptric avatar cleptric commented on July 3, 2024

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. ?

from sentry-laravel.

jshwhitlow avatar jshwhitlow commented on July 3, 2024

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. "sentry/sentry-laravel": "*",

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 php artisan sentry:publish command and stepped through the prompts, but the undefined metrics() issue will appear when you select 'no' to the javascript sdk step.

I did a composer dump-autoload and that did not fix it.

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 app/Exceptions/Handler.php to match Laravel 8.x instructions, but that obviously doesn't have anything to do with the actual error.

The original composer lock versions prior to me attempting to update were (at present the production site runs fine with these versions):

sentry/sentry: 3.12.0
sentry/sentry-laravel: 3.1.2

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.

from sentry-laravel.

cleptric avatar cleptric commented on July 3, 2024

I would advice against "sentry/sentry-laravel": "*", it's better to at least lock it to the latest major.

Running a small Laravel 8 sample app hails no such errors for me, the metrics are emitted correctly.

laravel/framework                  v8.83.27 The Laravel Framework.
sentry/sentry                      4.7.0    PHP SDK for Sentry (http://sentry.io)
sentry/sentry-laravel              4.5.1    Laravel SDK for Sentry (https://sentry.io)

Something that is odd:

[2024-04-16 13:10:05] production.ERROR: Call to undefined function Sentry\metrics() {"exception":"[object] (Error(code: 0): Call to undefined function Sentry\\metrics() at /vendor/sentry/sentry-laravel/src/Sentry/Laravel/Integration.php:128)

Line 128, whereas it should be 125 instead. https://github.com/getsentry/sentry-laravel/blob/master/src/Sentry/Laravel/Integration.php#L125

from sentry-laravel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.