Skip to content
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

[Bug] Exception when try to run Concurrency::defer function #52790

Closed
devajmeireles opened this issue Sep 14, 2024 · 2 comments · Fixed by #52807
Closed

[Bug] Exception when try to run Concurrency::defer function #52790

devajmeireles opened this issue Sep 14, 2024 · 2 comments · Fixed by #52807

Comments

@devajmeireles
Copy link
Contributor

Laravel Version

11.23.5

PHP Version

PHP 8.3.11 (cli) (built: Sep 10 2024 15:12:42) (NTS)

Database Driver & Version

N/A

Description

Operational System: macOS Sonoma 14.6.1 (23G93)


The output of this code is generating the reported error below:

use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Concurrency;

Artisan::command('testing', function (): void {
    Concurrency::defer(fn () => info('a'));
});
[2024-09-13 22:13:11] local.ERROR: Command "invoke-serialized-closure 2>&1 &" is not defined.

Did you mean one of these?
     {"exception":"[object] (Symfony\\Component\\Console\\Exception\\CommandNotFoundException(code: 0): Command \"invoke-serialized-closure 2>&1 &\" is not defined.

Did you mean one of these?
     at /Users/aj/Workspace/z/app/vendor/symfony/console/Application.php:702)
[stacktrace]
#0 /Users/aj/Workspace/z/app/vendor/symfony/console/Application.php(258): Symfony\\Component\\Console\\Application->find('invoke-serializ...')
#1 /Users/aj/Workspace/z/app/vendor/symfony/console/Application.php(167): Symfony\\Component\\Console\\Application->doRun(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#2 /Users/aj/Workspace/z/app/vendor/laravel/framework/src/Illuminate/Foundation/Console/Kernel.php(197): Symfony\\Component\\Console\\Application->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#3 /Users/aj/Workspace/z/app/vendor/laravel/framework/src/Illuminate/Foundation/Application.php(1203): Illuminate\\Foundation\\Console\\Kernel->handle(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput))
#4 /Users/aj/Workspace/z/app/artisan(13): Illuminate\\Foundation\\Application->handleCommand(Object(Symfony\\Component\\Console\\Input\\ArgvInput))
#5 {main}
"} 

Steps To Reproduce

  1. Open the routes/console.php
  2. Create a command mentioned above
  3. Try to run the command via terminal
@LiamSystems
Copy link

Looks like the issue still remains on the latest update that "fixed this".

Laravel Version:
11.23.5

PHP Version:
PHP 8.2

Database Driver & Version:
N/A

Operational System:
Linux Ubuntu / Ploi

Description:
local.ERROR: Command "invoke-serialized-closure 2>&1 &" is not defined.

use Illuminate\Support\Facades\Concurrency; Concurrency::defer([ function () { sleep(5); }, ]);

@devajmeireles
Copy link
Contributor Author

Looks like the issue still remains on the latest update that "fixed this".

Laravel Version: 11.23.5

PHP Version: PHP 8.2

Database Driver & Version: N/A

Operational System: Linux Ubuntu / Ploi

Description: local.ERROR: Command "invoke-serialized-closure 2>&1 &" is not defined.

use Illuminate\Support\Facades\Concurrency; Concurrency::defer([ function () { sleep(5); }, ]);

We have not yet had a new release after this issue was fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants