-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
Class "Spatie\Ray\Payloads\ApplicationLogPayload" not found #237
Comments
Same issue here using:
|
Same issue here using:
|
I'm getting the same:
|
I'm having a hard time reproducing this. How can I trigger this error in a vanilla Laravel app? |
I haven't tried with a brand-new Laravel app, but I think I've experienced it on two different apps that I'm working on. I'm pretty sure I've seen it off and on over the last several weeks and it seemed to have something to do with when I'd try to log something using the standard Laravel log facade. (Take that with a grain of salt because my memory's a little blurry...but I remember being frustrated that I couldn't use the log for troubleshooting.) Anyway, I'll try to take some time next time it happens to see if I can let you know more. In one case, it's a L8 project that is pushing two years old with all sorts of stuff going on. In the other, it's another L8 app that is only a month or two old which uses Jetstream...not much else. But, both use Filament Admin...which may or may not be related. I'd love to hear if any of the others are also using that package. |
Back on the "new" project and I can replicate it very easy. There's a bit of code that I'm trying to troubleshoot. I was enabling and then dumping the query log around a search query and I get the error. When I have this, I get the \Illuminate\Support\Facades\Log::debug('test'); (Of course, I was trying to dump the query log, but I dropped that to see if it made any difference.) When I comment that line out, then it works fine: // \Illuminate\Support\Facades\Log::debug('test'); The app, as mentioned earlier, is a Laravel 8 app with Jetstream (livewire, no teams), and Filament Admin. It's basically a Filament Admin app. The other app that I work on where I've observed this also uses Filament Admin and it's only a recent addition. I don't think I noticed this error before Filament Admin was introduced...which leads me to believe that it's somehow related to that package. I'm not sure if this helps or not. Please let me know what else I can help with. In the meantime, if I have time to dig a little and/or come across something, I'll come back here to post/share. 🤓 |
@telkins thanks for the research, I don't think it's really something with Filament alone as I don't use that in any of my projects, but do get the error. I had to remove ray from 4 projects already as developing became a bit of a pain. I'm searching for examples too. When I find something, I'll definitely post it here. |
Thx. Nice to know it doesn't have anything to do with Filament Admin. 😅 How do you get rid of ray, though? I'm not requiring it explicitly. I'll add that it seems to occur whenever there's an error/exception. This might help me going forward....at least until the issues are resolved or I figure out how to remove it. 🤓 |
@telkins run |
One thing I noticed is that I was using a really old config file, as I was not really aware of its existence because of the unusual config file location. I don't know wether or not this was causing the issue, but I'm installing the package to my projects again to see if I run into some trouble the next couple of days. |
@voicecode-bv Thanks, being able to reproduce this error would greatly help us to fix it. |
Hi, We've noticed the issue ourselves on a couple of production boxes over a couple of versions, in both cases the laravel-ray package was included in require-dev if it helps narrow anything done. Versions were/are
In our case the only difference between our local config file and the current one in this package are we are missing the following three keys, send_duplicate_queries_to_ray, send_slow_queries_to_ray and send_http_client_requests_to_ray and our host default is falling back to the default homestead ip as that's how we published it. Thanks, |
@freekmurze Just got one in a form request. Stripped it down a bit to narrow things down. Good to know:
|
This seems to line up with some of the experiences I described earlier in this thread, which was that it would seem to happen when I was simply trying to log something...at least some of the time. But, I don't think that it's always happening when I try to log something. 😕 |
Some findings:
Edit: Ok I got something else interesting: I am using Valet and it does not give this error when I run through Edit: restarting Valet solves it. Edit: It does not only occur on Valet, because I got this error on prod where I accidentally also included dev dependencies. P.S. I am on: "spatie/laravel-ray": "1.29.0" |
Laravel Framework 8.80.0 same problem
|
I wonder if it has something to do with composer. If you report further errors, do mention the composer version number as well. |
Composer 2.0.13 on my side |
2.1.3 here locally |
2.2.4 for me. |
Happening to me too... Versions :
Hope it helps fixing it |
We're running into the same issue when using the array_merge function within our Controller without providing array parameter.
|
Having the same issue. We don't use ray but it is used by one of the dependencies seems like.
The issue started after upgrading Composer to v2 & PHP to 8.1. Update |
We are having the same issue after upgrading to PHP 8.1 |
I believe that it is a problem, but I still can't reproduce it. I'd be grateful if anyone here can make a small Laravel app that demonstrates the problem. |
@freekmurze I have been trying to recreate it locally without success. In my case, the error only occurs on our staging server. For local env, I use Laravel Sail but with the same PHP 8.1.1 version, composer 2.2 and so on. So I think it is not necessarily the PHP version that breaks it.
At the end of debug stack I have debug level log message: PDOException: SQLSTATE[23000]: Integrity constraint violation: 1452 Cannot add or update a child row: a foreign key constraint fails And a warning level message: Return type of Opis\Closure\ReflectionClosure::isStatic() should either be compatible with ReflectionFunctionAbstract::isStatic(): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in /var/www/releases/.../vendor/opis/closure/src/ReflectionClosure.php on line 49 Not sure if any of this is helpful. |
We had the same issue. We've upgraded to PHP8.1 and our Laravel Sail docker runtime was outdated. |
I had same issue. In my case I created PHP8.1 Enums in 'App/Enums' directory. When I call the issue occurs didn't test with fresh laravel installation |
It throws that error in all exceptions |
Same issue here. For instance, I don't have JIT enabled. I'm using PHP 8.1.
|
Any progress on this? I had to remove |
This PR is a workaround. It isn't a real solution, but it solves the issue. And many of us are struggling with this for over six weeks. |
I agree that this has been going on too long. Thanks for the temporary fix. I do hope we'll find the real problem and proper solution in the future. |
Using Laravel 8.83, started for us moving from PHP 8.0 to 8.1.1 Fixed by updating the How the old config can create what looks like a |
@thejager Do you perhaps have an idea on how to reproduce this? |
I had the same issue, solved with updating spatie/ray to version 1.34 |
which composer version are you using? |
Composer version 2.0.11 2021-02-24 14:57:23 EDIT: I forgot to mention this also happened in production where we use different composer version |
Got another one, Class "Spatie\LaravelRay\OriginFactory" not found. Sorry to say so, but as much as I love this tool, it's getting useless. |
@voicecode-bv Please try to keep comments constructive. I'm using Ray myself extensively, and I've come across this problem only once. I believe that there is indeed a problem somewhere. The hard part is getting it reproducible. Still welcoming any tips and help for this. |
Back to this, updating I noticed that issue |
Also getting this in a personal project. In our situation, the issue was solved by disabling OPCache. The data is a bit preliminary - I have yet to see if the issue actually stays away. Imo it would really explain some of the issues other users have reported: it happening occasionally or disappearing after renaming the file. When the issue occurred I tried to manually let OPCache compile the file by using this line of code: opcache_compile_file(__DIR__.'/../vendor/spatie/ray/src/Payloads/ColorPayload.php'); And that throws the following error: Yet with another random file it does not throw that same error: opcache_compile_file(__DIR__.'/../vendor/laravel/framework/src/Illuminate/Database/ClassMorphViolationException.php'); Wondering if other people can confirm or disprove this? Anyway, I cannot reproduce this in a new Laravel app, but can do it in the personal project and don't mind having a small debug session though video call if that helps find the issue. |
Sorry if my response was a bit harsh, I was not my intention, probably the Dutch direct mentality ;-) I was just a bit frustrated because I had to remove this tool from 8 projects already in the last couple of months, because it was causing all kinds of trouble. I think sometimes we should all be a bit critical, only with good intentions. Especially when it comes to a a paid tool. (Yes I know it's still good value for money). To be more constructive, the Class "Spatie\LaravelRay\OriginFactory" not found was thrown after an Exact api call throwing a 400 error. |
Hi @freekmurze posting my situation, hopefully may help narrow this down:
EDIT:
|
Am experiencing this as well, but am curious if OPCache has anything to do with it. Have migrated a project off of Laravel Vapor (AWS Lamba) to Laravel Forge with OPCache enabled, and only now have I seen these errors. The Vapor dockerfiles I was basing my environment off have OPCache enabled too, so I don't know why this issue would now present itself running on Forge (with all the same PHP versions) but not Vapor / Lamba. |
I had the issue in my development environment and the OPCache was off. |
I don't know if this will help anyone, but every time I've had this problem, restarting php and nginx resolves the issue. I tend to get this error when I update the laravel-ray package via composer. |
Definitely a problem with OPCache. I am having the same problem with
I added |
I've not seen this exception now for quite some time. Maybe it was fixed in Composer? Do any of you get this exception still? |
Nothing for while now. Stable for me in L8 & L9 projects @freekmurze |
Yeah seems OK for me too, hasn't happened in a long while.
|
We're good here 👍 🙏 Thanks @freekmurze! |
I've not had it show up recently either..! |
Going to close this for now. If you are experiencing this error try upgrading composer to the latest version. |
Describe the bug
The class "Spatie\Ray\Payloads\ApplicationLogPayload" not found
PHP version: 8.1.0
Laravel version: 8.78.1
NB : I see this site, but ..... https://php-download.com/package/spatie/laravel-ray/file/src/Watchers/ApplicationLogWatcher.php
The text was updated successfully, but these errors were encountered: