Httpd error 256 root library launchagents homebrew mxcl httpd plist

Httpd error 256 root library launchagents homebrew mxcl httpd plist Техника

При попытке запустить postgresql

➜  ~ brew services start postgresql
Warning: Use postgresql@14 instead of deprecated postgresql
Bootstrap failed: 5: Input/output error
Try re-running the command as root for richer errors.
Error: Failure while executing; `/bin/launchctl bootstrap gui/501 /Users/josh/Library/LaunchAgents/homebrew.mxcl.postgresql@14.plist` exited with 5.

Получение «ошибки» в качестве статуса при запуске списка служб brew

➜  ~ brew services list
Name          Status     User File
postgresql@14 error  256 root ~/Library/LaunchAgents/homebrew.mxcl.postgresql@14.plist

PSQL работал отлично, выключил свой ноутбук (не обновлял), и когда я включил его на следующий день, psql не работал. Я использую OSX версии 12.6 (Монтерей).

Services not started when brew services start <service_name> is run.

Bootstrap failed: 5: Input/output error
Try re-running the command as root for richer errors.
Error: Failure while executing; `/bin/launchctl bootstrap gui/501 /Users/prasadchinwal/Library/LaunchAgents/homebrew.mxcl.php.plist` exited with 5.

When I run this as sudo the message changes to:

  • Valet Version: 3.1.1
  • PHP Version: 7.4.28
  • Description:

    I got stuck with an error where Nginx was not loading for me. When I ran brew services list this is what I’d see:

    brew services list
    Name    Status     User File
    dnsmasq none       root
    nginx   error  256 root ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
    php     none
    php@7.4 none       root

    There are a fair amount of answers on stackoverflow about restarting nginx using sudo, changing the permissions on this file and/or moving files around. I tried uninstalling and reinstalling valet and nginx lots of times. What finally solved it for me was deleting the ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist file and rebooting my machine.

    I’m happy to submit a PR to the docs to say «If you can’t connect to your .test domain run ‘brew services list’, if this is the error then delete the file and reboot your machine» but I don’t really know how Nginx got in this improper state.

    Should I submit a PR to the docs to say that or is there any other information I can provide?

    Steps To Reproduce:

    Not clear how this plist file was generated. I had run sudo nginx -s stop but then reinstalling valet and nginx did not fix the issue. I had to remove the file and restart.


    This was my diagnosis when I had the issue:

    ProductName:	macOS
    ProductVersion:	12.1
    BuildVersion:	21C52
    valet —version
    Laravel Valet 3.1.1
    cat ~/.config/valet/config.json
        "tld": "test",
        "loopback": "",
        "paths": [
    cat ~/.composer/composer.json
        "require": {
            "laravel/valet": "^3.1",
            "tightenco/takeout": "1.8.6"
    composer global diagnose
    Changed current directory to /Users/connorleech/.composer
    Checking composer.json: WARNING
    No license specified, it is recommended to do so. For closed-source software you may use "proprietary" as license.
    require.tightenco/takeout : exact version constraints (1.8.6) should be avoided if the package follows semantic versioning
    Checking platform settings: OK
    Checking git settings: OK
    Checking http connectivity to packagist: OK
    Checking https connectivity to packagist: OK
    Checking oauth access: OK
    Checking disk free space: OK
    Checking pubkeys: 
    Tags Public Key Fingerprint: 57815BA2 7E54DC31 7ECC7CC5 573090D0  87719BA6 8F3BB723 4E5D42D0 84A14642
    Dev Public Key Fingerprint: 4AC45767 E5EC2265 2F0C1167 CBBB8A2B  0C708369 153E328C AD90147D AFE50952
    Checking composer version: You are not running the latest stable version, run `composer self-update` to update (2.2.5 => 2.3.4)
    Composer version: 2.2.5
    PHP version: 7.4.28
    PHP binary path: /opt/homebrew/Cellar/php@7.4/7.4.28_1/bin/php
    OpenSSL version: OpenSSL 1.1.1m  14 Dec 2021
    cURL version: 7.82.0 libz 1.2.11 ssl (SecureTransport) OpenSSL/1.1.1n
    zip: extension present, unzip present, 7-Zip not available
    composer global outdated
    Changed current directory to /Users/connorleech/.composer
    Info from �[37;44m#StandWith�[30;43mUkraine�[0m
    ! patch or minor release available - update recommended
    ~ major release available - update possible
    guzzlehttp/guzzle             7.4.1   ! 7.4.2   Guzzle is a PHP HTTP client library
    guzzlehttp/psr7               2.1.0   ! 2.2.1   PSR-7 message implementation that also provides common utility methods
    illuminate/container          v8.83.4 ! v8.83.7 The Illuminate Container package.
    illuminate/contracts          v8.83.4 ! v8.83.7 The Illuminate Contracts package.
    psr/container                 1.1.2   ~ 2.0.2   Common Container Interface (PHP FIG PSR-11)
    symfony/console               v5.4.5  ! v5.4.7  Eases the creation of beautiful and testable command line interfaces
    symfony/deprecation-contracts v2.5.0  ! v2.5.1  A generic function and convention to trigger deprecation notices
    symfony/process               v5.4.5  ! v5.4.7  Executes commands in sub-processes
    symfony/service-contracts     v2.5.0  ! v2.5.1  Generic abstractions related to writing services
    tightenco/collect             v8.83.2 ! v8.83.6 Collect - Illuminate Collections as a separate package.
    tightenco/takeout             v1.8.6  ! v1.8.13 Manage your dev dependencies with simple one-off Docker containers.
    ls -al /etc/sudoers.d/
    total 0
    drwxr-xr-x   2 root  wheel    64 Dec  7 15:39 .
    drwxr-xr-x  82 root  wheel  2624 Apr  4 02:22 ..
    brew config
    HEAD: 56415326bb8c9eccc6e53f3997b4e062b36402af
    Last commit: 3 days ago
    Core tap ORIGIN:
    Core tap HEAD: ce9639a3e46908afe436f9339aba7ba9ff4d2fa8
    Core tap last commit: 2 hours ago
    Core tap branch: master
    HOMEBREW_PREFIX: /opt/homebrew
    Homebrew Ruby: 2.6.8 => /opt/homebrew/Library/Homebrew/vendor/portable-ruby/2.6.8/bin/ruby
    CPU: octa-core 64-bit arm_firestorm_icestorm
    Clang: 13.1.6 build 1316
    Git: 2.32.0 => /Library/Developer/CommandLineTools/usr/bin/git
    Curl: 7.77.0 => /usr/bin/curl
    macOS: 12.1-arm64
    Xcode: N/A
    Rosetta 2: false
    brew services list
    Name    Status User File
    dnsmasq none            root 
    nginx   error  256      root ~/Library/LaunchAgents/homebrew.mxcl.nginx.plist
    php     none                 
    php@7.4 none            root
    brew list —formula —versions | grep -E «(php|nginx|dnsmasq|mariadb|mysql|mailhog|openssl)(@\d\..*)?\s»
    dnsmasq 2.86
    nginx 1.21.6_1
    openssl@1.1 1.1.1n
    php 8.1.4
    php@7.4 7.4.28_1
    brew outdated
    brew tap
    php -v
    PHP 7.4.28 (cli) (built: Feb 28 2022 07:33:39) ( NTS )
    Copyright (c) The PHP Group
    Zend Engine v3.4.0, Copyright (c) Zend Technologies
        with Zend OPcache v7.4.28, Copyright (c), by Zend Technologies
    which -a php
    php —ini
    Configuration File (php.ini) Path: /opt/homebrew/etc/php/7.4
    Loaded Configuration File:         /opt/homebrew/etc/php/7.4/php.ini
    Scan for additional .ini files in: /opt/homebrew/etc/php/7.4/conf.d
    Additional .ini files parsed:      /opt/homebrew/etc/php/7.4/conf.d/error_log.ini,
    nginx -v
    nginx version: nginx/1.21.6
    curl —version
    curl 7.77.0 (x86_64-apple-darwin21.0) libcurl/7.77.0 (SecureTransport) LibreSSL/2.8.3 zlib/1.2.11 nghttp2/1.42.0
    Release-Date: 2021-05-26
    Protocols: dict file ftp ftps gopher gophers http https imap imaps ldap ldaps mqtt pop3 pop3s rtsp smb smbs smtp smtps telnet tftp 
    Features: alt-svc AsynchDNS GSS-API HSTS HTTP2 HTTPS-proxy IPv6 Kerberos Largefile libz MultiSSL NTLM NTLM_WB SPNEGO SSL UnixSockets
    php —ri curl

    cURL support => enabled
    cURL Information => 7.82.0
    Age => 9
    AsynchDNS => Yes
    CharConv => No
    Debug => No
    GSS-Negotiate => No
    IDN => Yes
    IPv6 => Yes
    krb4 => No
    Largefile => Yes
    libz => Yes
    NTLM => Yes
    NTLMWB => Yes
    SPNEGO => Yes
    SSL => Yes
    SSPI => No
    TLS-SRP => Yes
    HTTP2 => Yes
    GSSAPI => Yes
    KERBEROS5 => Yes
    PSL => No
    HTTPS_PROXY => Yes
    MULTI_SSL => Yes
    BROTLI => Yes
    Protocols => dict, file, ftp, ftps, gopher, gophers, http, https, imap, imaps, ldap, ldaps, mqtt, pop3, pop3s, rtmp, rtsp, scp, sftp, smb, smbs, smtp, smtps, telnet, tftp
    Host => aarch64-apple-darwin21.3.0
    SSL Version => (SecureTransport) OpenSSL/1.1.1n
    ZLib Version => 1.2.11
    libSSH Version => libssh2/1.10.0

    Directive => Local Value => Master Value
    curl.cainfo => no value => no value

    ~/.composer/vendor/laravel/valet/bin/ngrok version
    ngrok version 2.3.40
    ~/.composer/vendor/laravel/valet/bin/ngrok-arm version
    ngrok version 2.3.40
    ls -al ~/.ngrok2
    ls: /Users/connorleech/.ngrok2: No such file or directory
    brew info nginx
    nginx: stable 1.21.6 (bottled), HEAD
    HTTP(S) server and reverse proxy, and IMAP/POP3 proxy server
    /opt/homebrew/Cellar/nginx/1.21.6_1 (26 files, 2.2MB) *
      Poured from bottle on 2022-04-11 at 18:11:57
    License: BSD-2-Clause
    ==> Dependencies
    Required: openssl@1.1, pcre2
    ==> Options
    	Install HEAD version
    ==> Caveats
    Docroot is: /opt/homebrew/var/www

    The default port has been set in /opt/homebrew/etc/nginx/nginx.conf to 8080 so that
    nginx can run without sudo.

    nginx will load all files in /opt/homebrew/etc/nginx/servers/.

    To restart nginx after an upgrade:
    brew services restart nginx
    Or, if you don't want/need a background service you can just run:
    /opt/homebrew/opt/nginx/bin/nginx -g daemon off;
    ==> Analytics
    install: 39,084 (30 days), 123,812 (90 days), 486,412 (365 days)
    install-on-request: 39,000 (30 days), 123,600 (90 days), 485,411 (365 days)
    build-error: 24 (30 days)

    brew info php
    php: stable 8.1.4 (bottled), HEAD
    General-purpose scripting language
    /opt/homebrew/Cellar/php/8.1.4 (513 files, 81.6MB)
      Poured from bottle on 2022-04-11 at 18:02:24
    License: PHP-3.01
    ==> Dependencies
    Build: httpd, pkg-config
    Required: apr, apr-util, argon2, aspell, autoconf, curl, freetds, gd, gettext, gmp, icu4c, krb5, libpq, libsodium, libzip, oniguruma, openldap, openssl@1.1, pcre2, sqlite, tidy-html5, unixodbc
    ==> Options
    	Install HEAD version
    ==> Caveats
    To enable PHP in Apache add the following to httpd.conf and restart Apache:
        LoadModule php_module /opt/homebrew/opt/php/lib/httpd/modules/
    <FilesMatch \.php$>
        SetHandler application/x-httpd-php

    Finally, check DirectoryIndex includes index.php
    DirectoryIndex index.php index.html

    The php.ini and php-fpm.ini file can be found in:

    To restart php after an upgrade:
    brew services restart php
    Or, if you don't want/need a background service you can just run:
    /opt/homebrew/opt/php/sbin/php-fpm --nodaemonize
    ==> Analytics
    install: 133,555 (30 days), 380,644 (90 days), 994,268 (365 days)
    install-on-request: 112,411 (30 days), 315,787 (90 days), 867,802 (365 days)
    build-error: 50 (30 days)

    brew info openssl
    openssl@3: stable 3.0.2 (bottled) [keg-only]
    Cryptography and SSL/TLS Toolkit
    Not installed
    License: Apache-2.0
    ==> Dependencies
    Required: ca-certificates
    ==> Caveats
    A CA file has been bootstrapped using certificates from the system
    keychain. To add additional certificates, place .pem files in

    ==> Analytics
    install: 169,146 (30 days), 376,585 (90 days), 717,589 (365 days)
    install-on-request: 135,711 (30 days), 296,399 (90 days), 565,133 (365 days)
    build-error: 5,868 (30 days)

    openssl version -a
    LibreSSL 2.8.3
    built on: date not available
    platform: information not available
    options:  bn(64,64) rc4(ptr,int) des(idx,cisc,16,int) blowfish(idx) 
    compiler: information not available
    OPENSSLDIR: "/private/etc/ssl"
    openssl ciphers
    sudo nginx -t
    nginx: the configuration file /opt/homebrew/etc/nginx/nginx.conf syntax is ok
    nginx: configuration file /opt/homebrew/etc/nginx/nginx.conf test is successful
    which -a php-fpm
    /opt/homebrew/opt/php/sbin/php-fpm -v
    PHP 8.1.4 (fpm-fcgi) (built: Mar 18 2022 09:32:39)
    Copyright (c) The PHP Group
    Zend Engine v4.1.4, Copyright (c) Zend Technologies
        with Zend OPcache v8.1.4, Copyright (c), by Zend Technologies
    sudo /opt/homebrew/opt/php/sbin/php-fpm -y /opt/homebrew/etc/php/7.4/php-fpm.conf —test
    [11-Apr-2022 18:25:14] NOTICE: configuration file /opt/homebrew/etc/php/7.4/php-fpm.conf test is successful
    ls -al ~/Library/LaunchAgents | grep homebrew
    -rw-r--r--   1 connorleech  staff   490 Apr 11 18:12 homebrew.mxcl.nginx.plist
    ls -al /Library/LaunchAgents | grep homebrew
    ls -al /Library/LaunchDaemons | grep homebrew
    -rw-r--r--   1 root  admin   602 Apr 11 18:17 homebrew.mxcl.dnsmasq.plist
    -rw-r--r--   1 root  admin   490 Apr 11 18:23 homebrew.mxcl.nginx.plist
    -rw-r--r--   1 root  admin   594 Apr 11 18:17 homebrew.mxcl.php@7.4.plist
    ls -al /Library/LaunchDaemons | grep «com.laravel.valet.»
    ls -aln /etc/resolv.conf
    lrwxr-xr-x  1 0  0  22 Dec  7 15:39 /etc/resolv.conf -> ../var/run/resolv.conf
    cat /etc/resolv.conf
    # macOS Notice
    # This file is not consulted for DNS hostname resolution, address
    # resolution, or the DNS query routing mechanism used by most
    # processes on this system.
    # To view the DNS configuration used by this system, use:
    #   scutil --dns
    # SEE ALSO
    #   dns-sd(1), scutil(8)
    # This file is automatically generated.
    nameserver 2001:558:feed::1
    nameserver 2001:558:feed::2
    ifconfig lo0
    lo0: flags=8049 mtu 16384
    	inet netmask 0xff000000 
    	inet6 ::1 prefixlen 128 
    	inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 
    	nd6 options=201
    sh -c ‘echo «——\n/opt/homebrew/etc/nginx/valet/valet.conf\n—\n»; cat /opt/homebrew/etc/nginx/valet/valet.conf | grep -n «# valet loopback»; echo «\n——\n»‘

    3: #listen VALET_LOOPBACK:80; # valet loopback

    sh -c ‘for file in ~/.config/valet/dnsmasq.d/*; do echo «——\n~/.config/valet/dnsmasq.d/$(basename $file)\n—\n»; cat $file; echo «\n——\n»; done’
    sh -c ‘for file in ~/.config/valet/nginx/*; do echo «——\n~/.config/valet/nginx/$(basename $file)\n—\n»; cat $file | grep -n «# valet loopback»; echo «\n——\n»; done’

    3: #listen; # valet loopback
    10: #listen ssl http2; # valet loopback
    54: #listen; # valet loopback

    My findings

    Results of `brew services list`

    Screen Shot 2022-01-02 at 6 17 13 PM

    Results of `sudo brew services list`

    Screen Shot 2022-01-02 at 6 18 35 PM

    Result for `launchctl list`

    Screen Shot 2022-01-02 at 6 19 10 PM

    Result for `sudo launchctl list`

    Screen Shot 2022-01-02 at 6 20 01 PM

    It shows that nginx is started and has a pid but other services like php, dnsmasq don’t have a pid.

    I looked up a lot and found that this might be due to 2 separate .plist files registered. I tried to delete the .plist files from /Library/LaunchAgents/ location. But this was no help.

    Tried to run brew services cleanup but that didn’t do the trick as well.

    Kindly let me know if more information is required. Any help is appreciated.

    6 ответов

    Мое решение, остановите службу httpd, затем проверьте httpd.conf и проверьте DocumentRoot «/opt/homebrew/var/www» при возврате в исходное состояние этого маршрута перезапустите httpd сервис и все заработало без проблем.

    14 Мар 2022 в 18:35

    Если вы запускаете его как root, укажите его с привилегиями root:

    sudo brew services start httpd > sudo brew services list

    Или с привилегиями пользователя:

    brew services start httpd > brew services list. «

    Yuma Technical Inc.
    11 Янв 2021 в 20:27

    Первая команда дает такой результат:

    sudo apachectl -e error
    AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using MBP-Matteo.local. Set the 'ServerName' directive globally to suppress this message
    (48)Address already in use: AH00072: make_sock: could not bind to address
    no listening sockets available, shutting down
    AH00015: Unable to open logs

    И файл ‘/usr/local/var/log/httpd/error_log’ пуст

    Результаты не меняются, если я выполняю команды варки как с sudo, так и без него (учитывая, что ранее я использовал без sudo)

    12 Янв 2021 в 01:05

    У меня была точно такая же проблема в Монтерее. При копании кажется, что проблема заключалась в том, что символ не найден ( _apr_bucket_alloc_aligned_floor ), ожидаемый в: /usr/lib/libaprutil-1.0.dylib.

    Переустановка apr-util исправила мой случай:

    brew reinstall apr-util

    5 Янв 2022 в 03:03

    Судя по результату sudo apachectl -e error, он не может использовать порт 8080, потому что его использует другое приложение.

    Первое предупреждение — можно игнорировать — или указать полное доменное имя в httpd.conf. Обычно это находится в папке «/usr/local/etc/httpd». Редактировать с помощью sudo vi /usr/local/etc/httpd/httpd.conf. (Мне нравится vi — используйте то, что вам удобно — sudo open -e /usr/local/etc/httpd/httpd.conf обычно). В конфигурации по умолчанию есть строка #ServerName, удалите этот «#» и замените «» на «MBP-Matteo.local» или что-то еще.

    Введите sudo lsof -i tcp:8080, чтобы вывести список всех приложений, использующих порт 8080, в основном важны только те приложения, которые ПРОСЛУШИВАЮТ.

    Следующая ошибка: вы должны остановить другое приложение, использующее порт 8080 (и предотвратить запуск при загрузке), или настроить Apache на использование другого порта. (Примечание. Если вы выберете порт ниже 1024, для запуска службы необходимо использовать «sudo».) Обычно порт 80 предназначен для Apache. Используемый порт можно установить, отредактировав файл конфигурации, как указано выше, затем найдите строку «Слушать 8080» и замените 8080 на нужный порт.

    Yuma Technical Inc.
    14 Янв 2021 в 19:18

    Кажется, что-то не работает, но я все еще не могу найти, почему.

    Я остановил все службы (либо sudo brew, либо brew без sudo), а затем выполнил команды:

    sudo lsof -i :80
    sudo lsof -i :8080
    sudo lsof -i tcp:80
    sudo lsof -i tcp:8080

    Результат всегда ни о чем. Но если я бегу:

    sudo brew services start httpd    
    ==> Successfully started `httpd` (label: homebrew.mxcl.httpd)

    Httpd не запустится (даже если в терминале написано да):

    sudo brew services list
    httpd             error   root            /Library/LaunchDaemons/homebrew.mxcl.httpd.plist

    И если я проверяю ошибку apachetl, я всегда получаю, что порт 80 занят, даже если на этом порту нет процессов:

    apachectl -e error
    (48)Address already in use: AH00072: make_sock: could not bind to address
    no listening sockets available, shutting down
    AH00015: Unable to open logs

    Мне срочно нужно найти решение этой ошибки. Кажется, что в некоторых httpd поврежден, даже если я удалю и переустановлю снова

    Я действительно не знаю, как я это сделал, но теперь это работает. Я остановил все службы brew httpd и перезапустил apache с помощью команды:

    sudo apachectl -k start

    И это сработало для меня

    11 Мар 2021 в 12:35

    1 ответ

    У меня такая же проблема с nginx. Вручную выгрузил его, а затем перезапустил, все работало нормально.

    sudo launchctl bootout system /Library/LaunchDaemons/homebrew.mxcl.httpd.plist
    sudo brew services start httpd

    4 ответа

    Была та же проблема, но не мог заставить работать Postgres 14, и в итоге я просто обновился до Postgres 15, что у меня и получилось.

    Шаги выглядели так (номера версий могут отличаться)

    brew services stop postgresql@14
    brew install postgresql@15
    # This command will copy data over to the new database
    brew /opt/homebrew/Cellar/postgresql@15/15.1/bin/pg_upgrade -b /opt/homebrew/Cellar/postgresql@14/14.6/bin/ -d /opt/homebrew/var/postgres/ -D /opt/homebrew/var/postgresql@15/
    brew services start postgresql@15

    16 Ноя 2022 в 21:38

    # Remove postgresql 14 with brew 
    brew remove postgresql@14
    # Reinstall postgresql 14 with brew
    brew install postgresql@14
    # Remove all the files in the db folder
    rf -rf /usr/local/var/postgresql@14/*
    # Kill all process that run any db of the postgresql 14 folder 
    pkill -f /usr/local/var/postgresql@14   
    # Initialize the db folder for postgresql 14 
    initdb --locale=C -E UTF-8 /usr/local/var/postgresql@14
    # Restart postgresql with brew (should say that it's already running) 
    brew services start postgresql@14

    17 Фев 2023 в 14:28

    Сегодня была такая же ошибка 🤓 на моем Mac Ventura 13.0. Проделал эти шаги и это помогло.

    1. Запустите rm /usr/local/var/postgresql@{YOUR_VERSION}/, чтобы удалить файл обычно это вызвано ошибкой в ​​файле
    2. Запустите brew services stop postgresql, чтобы остановить текущую службу postgresql.
    3. Затем, наконец, запустите brew services start postgresql, будет создан новый файл

    Если это не сработает, вы можете запустить brew doctor и посмотреть, вернет ли он Your system is ready to brew. Если есть предупреждения 🥶, вы можете поделиться ими здесь с сообществом для получения более подробной информации.?

    9 Ноя 2022 в 16:57

    Дополнительно:  Java.lang.ClassNotFoundException
    Оцените статью
    Master Hi-technology
    Добавить комментарий