-
Notifications
You must be signed in to change notification settings - Fork 642
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
[3.x]: Console methods called in web #11829
Comments
Thanks for reporting that! Just released Craft 3.7.53.1 and 4.2.3 with a fix for that. |
Seeing this error in Craft 4.5.14 The odd part is that if I run ./craft crm/registrations && ./craft queue/run it runs fine in the terminal, but if I only do ./craft crm/registrations and let the crontab for the QueueManager pick it up I see an error in Craft CP |
@dgrigg Can you search for the error in |
It only happens if the Queue runs from the CP panel. Executing ./craft queue/run from the CLI runs fine. I ended up creating a Console Trait that wrapped the functions with this |
Looks like it’s getting called from a module file:
So you’ll need to adjust that code yourself. Queue jobs should not assume that they will be run from a CLI request. |
Yes, I fixed the code. The issue is that it's throwing that error in the first place. I guess the Queue process does not define STDOUT anywhere? |
Your code is calling a method on the |
Got it. Makes sense. Thanks. |
What happened?
Description
Undefined constant "STDOUT"
See this Sentry log: https://sentry.io/share/issue/e795939f38dd4c4e858becf37dc14158/
Craft CMS version
Craft Pro 3.7.52
PHP version
8.1.9
Operating system and version
No response
Database type and version
No response
Image driver and version
No response
Installed plugins and versions
The text was updated successfully, but these errors were encountered: