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

Command schedule:run not working after build #424

Open
amikron opened this issue Aug 24, 2022 · 0 comments
Open

Command schedule:run not working after build #424

amikron opened this issue Aug 24, 2022 · 0 comments

Comments

@amikron
Copy link

amikron commented Aug 24, 2022

Description

After building application with app:build running command php application schedule:run on PHAR runs commands, but they are not executed correctly,

Steps to reproduce

  1. Create new application with composer create-project --prefer-dist laravel-zero/laravel-zero application.
  2. Install logging support with php application app:install log.
  3. Set default logging channel in config\logging.php to single.
  4. Set path of single channel in config\logging.php so it works after build too:
    'single' => [ 'driver' => 'single', 'path' => getcwd() . '/logs/laravel.log', 'level' => env('LOG_LEVEL', 'debug'), ],
  5. Uncomment line 50 od app\Commands\InspireCommand.php activating scheduling option of this command.
  6. Build application (php application app:build).
  7. Run php application schedule:run from app directory, it works fine, takes half a second, produces no log entries.
  8. Now run same command from builds directory, it shows same output (command is scheduled and tries to run), but runs only like 17 ms and produces error in application\builds\logs\laravel.log

Error

[2022-08-24 08:22:27] production.ERROR: Unable to launch a new process. {"exception":"[object] (Symfony\\Component\\Process\\Exception\\RuntimeException(code: 0): Unable to launch a new process. at phar://D:/Projects/application/builds/application/vendor/symfony/process/Process.php:350) [stacktrace] #0 phar://D:/Projects/application/builds/application/vendor/symfony/process/Process.php(247): Symfony\\Component\\Process\\Process->start(NULL, Array) #1 phar://D:/Projects/application/builds/application/vendor/illuminate/console/Scheduling/Event.php(248): Symfony\\Component\\Process\\Process->run() #2 phar://D:/Projects/application/builds/application/vendor/illuminate/console/Scheduling/Event.php(230): Illuminate\\Console\\Scheduling\\Event->execute(Object(LaravelZero\\Framework\\Application)) #3 phar://D:/Projects/application/builds/application/vendor/illuminate/console/Scheduling/Event.php(200): Illuminate\\Console\\Scheduling\\Event->start(Object(LaravelZero\\Framework\\Application)) #4 phar://D:/Projects/application/builds/application/vendor/illuminate/console/Scheduling/ScheduleRunCommand.php(184): Illuminate\\Console\\Scheduling\\Event->run(Object(LaravelZero\\Framework\\Application)) #5 phar://D:/Projects/application/builds/application/vendor/illuminate/console/View/Components/Task.php(36): Illuminate\\Console\\Scheduling\\ScheduleRunCommand->Illuminate\\Console\\Scheduling\\{closure}() #6 phar://D:/Projects/application/builds/application/vendor/illuminate/console/View/Components/Factory.php(56): Illuminate\\Console\\View\\Components\\Task->render('<fg=gray>2022-0...', Object(Closure)) #7 phar://D:/Projects/application/builds/application/vendor/illuminate/console/Scheduling/ScheduleRunCommand.php(199): Illuminate\\Console\\View\\Components\\Factory->__call('task', Array) #8 phar://D:/Projects/application/builds/application/vendor/illuminate/console/Scheduling/ScheduleRunCommand.php(127): Illuminate\\Console\\Scheduling\\ScheduleRunCommand->runEvent(Object(Illuminate\\Console\\Scheduling\\Event)) #9 phar://D:/Projects/application/builds/application/vendor/illuminate/container/BoundMethod.php(36): Illuminate\\Console\\Scheduling\\ScheduleRunCommand->handle(Object(Illuminate\\Console\\Scheduling\\Schedule), Object(Illuminate\\Events\\Dispatcher), Object(Illuminate\\Foundation\\Exceptions\\Handler)) #10 phar://D:/Projects/application/builds/application/vendor/illuminate/container/Util.php(41): Illuminate\\Container\\BoundMethod::Illuminate\\Container\\{closure}() #11 phar://D:/Projects/application/builds/application/vendor/illuminate/container/BoundMethod.php(93): Illuminate\\Container\\Util::unwrapIfClosure(Object(Closure)) #12 phar://D:/Projects/application/builds/application/vendor/illuminate/container/BoundMethod.php(37): Illuminate\\Container\\BoundMethod::callBoundMethod(Object(LaravelZero\\Framework\\Application), Array, Object(Closure)) #13 phar://D:/Projects/application/builds/application/vendor/illuminate/container/Container.php(651): Illuminate\\Container\\BoundMethod::call(Object(LaravelZero\\Framework\\Application), Array, Array, NULL) #14 phar://D:/Projects/application/builds/application/vendor/illuminate/console/Command.php(139): Illuminate\\Container\\Container->call(Array) #15 phar://D:/Projects/application/builds/application/vendor/symfony/console/Command/Command.php(291): Illuminate\\Console\\Command->execute(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Illuminate\\Console\\OutputStyle)) #16 phar://D:/Projects/application/builds/application/vendor/illuminate/console/Command.php(124): Symfony\\Component\\Console\\Command\\Command->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Illuminate\\Console\\OutputStyle)) #17 phar://D:/Projects/application/builds/application/vendor/symfony/console/Application.php(998): Illuminate\\Console\\Command->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput)) #18 phar://D:/Projects/application/builds/application/vendor/symfony/console/Application.php(299): Symfony\\Component\\Console\\Application->doRunCommand(Object(Illuminate\\Console\\Scheduling\\ScheduleRunCommand), Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput)) #19 phar://D:/Projects/application/builds/application/vendor/symfony/console/Application.php(171): Symfony\\Component\\Console\\Application->doRun(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput)) #20 phar://D:/Projects/application/builds/application/vendor/illuminate/console/Application.php(102): Symfony\\Component\\Console\\Application->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput)) #21 phar://D:/Projects/application/builds/application/vendor/laravel-zero/foundation/src/Illuminate/Foundation/Console/Kernel.php(129): Illuminate\\Console\\Application->run(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput)) #22 phar://D:/Projects/application/builds/application/vendor/laravel-zero/framework/src/Kernel.php(96): Illuminate\\Foundation\\Console\\Kernel->handle(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput)) #23 phar://D:/Projects/application/builds/application/application(36): LaravelZero\\Framework\\Kernel->handle(Object(Symfony\\Component\\Console\\Input\\ArgvInput), Object(Symfony\\Component\\Console\\Output\\ConsoleOutput)) #24 D:\\Projects\\application\\builds\\application(14): require('phar://D:/Proje...') #25 {main} "}

Actual behavior

Commands ran by schedule:run try to run, but get an error like above. If those commands are run from PHAR normally via signature, not via schedule, they work as expected.

Expected behavior

Running schedule:run option should run command like normal without error.

Additional info

Great tool guys, I like it a lot.

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

No branches or pull requests

1 participant