Closed (fixed)
Project:
Raven: Sentry Integration
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
19 Mar 2018 at 16:48 UTC
Updated:
20 Jan 2019 at 01:36 UTC
Jump to comment: Most recent
Comments
Comment #2
mfbShould be at sites/all/libraries/sentry-php/lib/Raven/Client.php
If you put it there does it work? And if documentation is giving you the wrong path, let me know where that is.
Comment #3
mfbAssuming you worked this out, if not please re-open
Comment #5
morphosis7 commentedI'm not sure whether this comment will re-open the issue, but I had the same issue that the original poster did - I didn't see any instructions for installing the Sentry PHP library without using Composer, so I took a guess that I could put it at sites/all/libraries/sentry/ - and that didn't work.
Checking the issue queue, I saw this ticket, and noted that I got the library name wrong. Once I changed it to sentry-php (making the path to Client.php "/sites/all/libraries/sentry-php/lib/Raven" ), the message on the status report went away.
If I missed the advice on where the library needed to be put, I apologize. What I saw on the status report said only
"The Sentry PHP library could not be loaded. Please install Sentry PHP library." with a link to GitHub.
I didn't see a path on the configuration screen either.
At any rate, your clarification about the path got me up and running. Thanks!
Comment #6
mfbThe documentation in the dev branch is:
I guess I can tweak it to mention that actual directory you should install it into, for those who aren't reading the README.
It's tricky because I try to put everything in the README, but then folks don't read the README, so I end up having documentation all over the place... :p
Comment #7
dasumin commentedHi! I'm having an issue as well. I've put the sentry-php library:
But it is not detected. I see the following in admin/reports/status:
I've tried also to put Monolog and PSR Log to sites/all/libraries with no effect.
Comment #8
mfb@dasumin What version of this module are you using? Monolog and PSR Log have not been required in quite some time - you should try using the current version.
Comment #9
dasumin commented@mfb thank you and sorry, my fault. Copied the plugin some time ago, setup it only these days and forgot to update it. Now resolved.
Comment #10
bfuzze9898 commentedI am experiencing this issue too. The class_exists function in raven_libraries_load function is failing.
If I clear the cache and add a check inside this if condition, it does respond correctly, but after that the condition fails.
Changing the class_exists autoload parameter to TRUE, has no effect.
Initially, I installed sentry via composer, which is the recommended way I believe, in sites/all/libraries. The resulting path to the Client being: sites/all/libraries/vendor/sentry/sentry/lib/Raven/Client.php. Then I tried the manual installation, as the original poster did, in sites/all/libraries/raven/lib/Raven/Client.php. This did not work either.
I did not try xautoload, but maybe I should.
The only solution, which is not a solution, was to hack the module and add an explicit require before the class_exists call
(e.g. require_once DRUPAL_ROOT . '/sites/all/libraries/vendor/autoload.php';). I'm sure I can come up with a more elegant solution by adjusting module weights and/or doing this call in my own module, but there is clearly some issue with resolving the path to the sentry library.
Would it be possible to add a config variable to specify/override path to sentry-lib, or do you have another solution?
Thanks.
UPDATE: I can confirm that adding the above require to a custom module and then setting the your custom module weight to anything less than the Raven module corrects this issue (require path will vary based on your sentry installation method).
Comment #11
mfbThe README.md lays out your two installation options.
Option 1): Install via composer, along with a module which takes care of autoloading your composer dependencies. The README.md recommends https://www.drupal.org/project/composer_autoloader as a good option for this.
Option 2): Install to sites/all/libraries/sentry-php along with https://www.drupal.org/project/libraries and https://www.drupal.org/project/xautoload
If you have any recommendations for clarifying the README.md, please update this issue as I'd appreciate it :)
Comment #12
mfbI went ahead and made some updates to the README which /might/ help a little(?)
Comment #13
Paul_T commentedI recently had the same issue as the original post and the fix was to ensure file ownership was set properly (using CHOWN). I was using a different SSH user when I pulled in the PHP library.