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

Valet status returns "Uncaught TypeError: Valet\Status::isBrewServiceRunningGivenServiceList(): Argument #1 ($serviceList) must be of type array, null given" #1372

Closed
mattstauffer opened this issue Feb 22, 2023 · 4 comments
Labels

Comments

@mattstauffer
Copy link
Collaborator

Error reported by @laytan in #1318.

@laytan reported running valet status in the Laravel Valet v4 beta returned this:

atal error: Uncaught TypeError: Valet\Status::isBrewServiceRunningGivenServiceList(): Argument #1 ($serviceList) must be of type array, null given, called in /Users/laytan/.composer/vendor/laravel/valet/cli/Valet/Status.php on line 178 and defined in /Users/laytan/.composer/vendor/laravel/valet/cli/Valet/Status.php:181
Stack trace:
#0 /Users/laytan/.composer/vendor/laravel/valet/cli/Valet/Status.php(178): Valet\Status->isBrewServiceRunningGivenServiceList(NULL, 'dnsmasq', true)
#1 /Users/laytan/.composer/vendor/laravel/valet/cli/Valet/Status.php(159): Valet\Status->isBrewServiceRunningAsUser('dnsmasq', true)
#2 /Users/laytan/.composer/vendor/laravel/valet/cli/Valet/Status.php(94): Valet\Status->isBrewServiceRunning('dnsmasq')
#3 /Users/laytan/.composer/vendor/laravel/valet/cli/Valet/Status.php(26): Valet\Status->Valet\{closure}()
#4 [internal function]: Valet\Status->Valet\{closure}(Array, 4)
#5 /Users/laytan/.composer/vendor/illuminate/collections/Arr.php(558): array_map(Object(Closure), Array, Array)
#6 /Users/laytan/.composer/vendor/illuminate/collections/Collection.php(768): Illuminate\Support\Arr::map(Array, Object(Closure))
#7 /Users/laytan/.composer/vendor/laravel/valet/cli/Valet/Status.php(25): Illuminate\Support\Collection->map(Object(Closure))
#8 /Users/laytan/.composer/vendor/laravel/valet/cli/includes/facades.php(22): Valet\Status->check()
#9 /Users/laytan/.composer/vendor/laravel/valet/cli/app.php(78): Facade::__callStatic('check', Array)
#10 [internal function]: Silly\Application->{closure}(Object(Symfony\Component\Console\Output\ConsoleOutput))
#11 /Users/laytan/.composer/vendor/php-di/invoker/src/Invoker.php(74): call_user_func_array(Object(Closure), Array)
#12 /Users/laytan/.composer/vendor/mnapoli/silly/src/Application.php(96): Invoker\Invoker->call(Object(Closure), Array)
#13 /Users/laytan/.composer/vendor/symfony/console/Command/Command.php(310): Silly\Application->Silly\{closure}(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#14 /Users/laytan/.composer/vendor/symfony/console/Application.php(1040): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#15 /Users/laytan/.composer/vendor/symfony/console/Application.php(314): Symfony\Component\Console\Application->doRunCommand(Object(Silly\Command\Command), Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#16 /Users/laytan/.composer/vendor/symfony/console/Application.php(168): Symfony\Component\Console\Application->doRun(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
#17 /Users/laytan/.composer/vendor/laravel/valet/cli/valet.php(9): Symfony\Component\Console\Application->run()
#18 {main}
  thrown in /Users/laytan/.composer/vendor/laravel/valet/cli/Valet/Status.php on line 181

This requires this line to have returned null:

$this->brewServicesUserOutput = json_decode($this->cli->runAsUser('brew services info --all --json'), false);

Which means I'll need to do some error handling.

@laytan, would you mind running brew services info --all --json in your terminal and letting me know the output of that command? Thanks!

@laytan
Copy link

laytan commented Feb 22, 2023

I see, I am getting these warnings before the JSON output:

$ brew services info --all --json
Warning: Calling plist_options is deprecated! Use service.require_root instead.
Please report this issue to the koekeishiya/formulae tap (not Homebrew/brew or Homebrew/homebrew-core), or even better, submit a PR to fix it:
  /opt/homebrew/Library/Taps/koekeishiya/homebrew-formulae/skhd.rb:26

Warning: Calling plist_options is deprecated! Use service.require_root instead.
Please report this issue to the koekeishiya/formulae tap (not Homebrew/brew or Homebrew/homebrew-core), or even better, submit a PR to fix it:
  /opt/homebrew/Library/Taps/koekeishiya/homebrew-formulae/yabai.rb:42

[
# The services....
]

Even with --quiet it happens, otherwise I would have suggested running that in valet instead.

@mattstauffer
Copy link
Collaborator Author

Thanks! I'll work on making it handle that error better, but FYI, that's an error with one of your formulae; you can see a response to a different formula from that same author/tap here: Homebrew/brew#14526 (comment)

@laytan
Copy link

laytan commented Feb 23, 2023

Yep, I know, there is already a PR with a fix to that formulae here: koekeishiya/homebrew-formulae#25

@driesvints driesvints added the bug label Feb 23, 2023
@mattstauffer
Copy link
Collaborator Author

Closed: 866bc7e

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

No branches or pull requests

3 participants