cytopia / devilbox

A modern Docker LAMP stack and MEAN stack for local development
http://devilbox.org
MIT License
4.39k stars 655 forks source link

Error response from daemon: Ports are not available: listen tcp 0.0.0.0:5432: bind #812

Closed SHJordanSLIM closed 2 years ago

SHJordanSLIM commented 3 years ago

log ahead, started with docker compose up as it is now the default recommendation for docker instead of docker-compose up.

shell had elevated privileges. Any way to work around? nothing working rn for me.


[+] Running 8/8
 - Container devilbox_bind_1   Created                                                                             0.0s
 - Container devilbox_php_1    Created                                                                             0.1s
 - Container devilbox_httpd_1  Created                                                                             0.1s
 - Container devilbox_mongo_1  Created                                                                             0.1s
 - Container devilbox_pgsql_1  Created                                                                             0.1s
 - Container devilbox_redis_1  Created                                                                             0.1s
 - Container devilbox_mysql_1  Created                                                                             0.1s
 - Container devilbox_memcd_1  Created                                                                             0.1s
Attaching to bind_1, httpd_1, memcd_1, mongo_1, mysql_1, pgsql_1, php_1, redis_1
bind_1   | [INFO] Debug level: 2
bind_1   | [INFO] BIND logging: disabled explicitly
bind_1   | [INFO] Using default DNS TTL time: 3600 sec
bind_1   | [INFO] Using default DNS Refresh time: 1200 sec
bind_1   | [INFO] Using default DNS Retry time: 180 sec
bind_1   | [INFO] Using default DNS Expiry time: 1209600 sec
bind_1   | [INFO] Using default DNS Max Cache time: 10800 sec
bind_1   | [INFO] Adding wildcard DNS: *.test -> 127.0.0.1
bind_1   |
bind_1   | zone test/IN: loaded serial 1621858542
bind_1   | OK
bind_1   | [INFO] Not adding any extra hosts
bind_1   | [INFO] DNSSEC Validation: no
bind_1   | [INFO] Adding custom DNS forwarder: 8.8.8.8,8.8.4.4
bind_1   | [INFO] Starting BIND 9.11.3
php_1    | [INFO] Debug level: 2
php_1    | [INFO] Changing user 'devilbox' uid to: 1000
php_1    | root $ usermod -u 1000 devilbox 2>/dev/null
php_1    | root $ chown -R devilbox /home/devilbox 2>/dev/null || true
php_1    | root $ chown -R devilbox /var/lib/php/session
php_1    | root $ chown -R devilbox /var/lib/php/wsdlcache
php_1    | root $ chown -R devilbox /var/spool/mail/devilbox
php_1    | root $ chown -R devilbox /etc/supervisor/custom.d
php_1    | [INFO] Changing group 'devilbox' gid to: 1000
php_1    | root $ groupmod -g 1000 devilbox 2>/dev/null
php_1    | root $ chown -R :devilbox /home/devilbox 2>/dev/null || true
php_1    | root $ chown -R :devilbox /var/lib/php/session
php_1    | root $ chown -R :devilbox /var/lib/php/wsdlcache
php_1    | root $ chown -R :devilbox /var/spool/mail/devilbox
php_1    | root $ chown -R :devilbox /etc/supervisor/custom.d
php_1    | [INFO] Setting container timezone to: America/Bahia
php_1    | root $ ln -sf /usr/share/zoneinfo/America/Bahia /etc/localtime
php_1    | [INFO] Setting PHP: timezone=America/Bahia
php_1    | root $ echo 'date.timezone = America/Bahia' > /usr/local/etc/php/conf.d/devilbox-runtime-timezone.ini
php_1    | [INFO] Docker date set to: Mon May 24 09:15:43 -03 2021
php_1    | [INFO] $DOCKER_LOGS set to 0. Logging to files under: /var/log/php
php_1    | [INFO] Make sure to mount this directory in order to view logs
php_1    | root $ chown -R devilbox:devilbox /var/log/php
php_1    | root $ chmod 0755 /var/log/php
php_1    | [INFO] $ENABLE_MAIL set to 2. Enabling postfix catch-all
php_1    | root $ chown devilbox:devilbox /var/log/php
php_1    | root $ chown devilbox:devilbox /var/log/php/mail.log
php_1    | root $ chmod 0644 /var/log/php/mail.log
php_1    | root $ chmod 0644 /var/mail/devilbox
php_1    | root $ chown devilbox:devilbox /var/mail
php_1    | root $ chown devilbox:devilbox /var/mail/devilbox
php_1    | root $ postconf -e 'strict_mailbox_ownership=no'
php_1    | root $ postconf -e 'inet_protocols=ipv4'
php_1    | root $ postconf -e 'virtual_alias_maps=pcre:/etc/postfix/virtual'
php_1    | root $ echo '/.*@.*/ devilbox' >> /etc/postfix/virtual
php_1    | root $ newaliases
httpd_1  | [INFO] Debug level: 2
httpd_1  | [INFO] Runtime debug: 2
httpd_1  | [INFO] Changing user 'nginx' uid to: 1000
httpd_1  | root $ usermod -u 1000 nginx
httpd_1  | [INFO] Changing group 'nginx' gid to: 1000
httpd_1  | root $ groupmod -g 1000 nginx
httpd_1  | [INFO] Setting container timezone to: America/Bahia
httpd_1  | root $ ln -sf /usr/share/zoneinfo/America/Bahia /etc/localtime
httpd_1  | [INFO] Docker date set to: Mon May 24 09:15:44 -03 2021
httpd_1  | [INFO] $WORKER_PROCESSES set to its default value: 'auto'.
httpd_1  | root $ sed -i'' 's/__WORKER_PROCESSES__/auto/g' /etc/nginx/nginx.conf
httpd_1  | [INFO] Setting worker_connections to: 1024
httpd_1  | root $ sed -i'' 's/__WORKER_CONNECTIONS__/1024/g' /etc/nginx/nginx.conf
httpd_1  | [INFO] $DOCKER_LOGS disabled. Logging errors and access to log files inside container.
httpd_1  | [INFO] PHP-FPM: Enabled
httpd_1  | [INFO] PHP-FPM: Server address: 172.16.238.10
httpd_1  | [INFO] PHP-FPM: Server port: 9000
httpd_1  | [INFO] PHP-FPM: Timeout: 180
httpd_1  | [INFO] Main vhost: Enabled
httpd_1  | [INFO] Main vhost: Setting SSL type to: http and https
httpd_1  | [INFO] Main vhost: Enable automatic generation of SSL certificates
httpd_1  | [INFO] Main vhost: SSL CN: localhost,*.localhost,devilbox,*.devilbox,httpd
httpd_1  | [INFO] $MAIN_VHOST_DOCROOT not specified. Keeping default: htdocs
httpd_1  | [INFO] $MAIN_VHOST_TPL not specified. Keeping default: cfg
httpd_1  | [INFO] Main vhost: Enabling httpd status page
httpd_1  | [INFO] Main vhost: Changing status page alias to: /devilbox-httpd-status
httpd_1  | [INFO] Mass vhost: Enabled
httpd_1  | [INFO] Mass vhost: Setting SSL type to: http and https
httpd_1  | [INFO] Mass vhost: Enable automatic generation of SSL certificates
httpd_1  | [INFO] Mass vhost: changing tld to: .test
httpd_1  | [INFO] Mass vhost: changing document root to: htdocs
httpd_1  | [INFO] Mass vhost: changing template dir to: .devilbox
httpd_1  | [INFO] vhost-gen: no customized template found
httpd_1  | root $ sed -i'' 's/__PHP_ENABLE__/yes/g' /etc/vhost-gen/main.yml
httpd_1  | root $ sed -i'' 's/__PHP_ADDR__/172.16.238.10/g' /etc/vhost-gen/main.yml
httpd_1  | root $ sed -i'' 's/__PHP_PORT__/9000/g' /etc/vhost-gen/main.yml
httpd_1  | root $ sed -i'' 's/__PHP_TIMEOUT__/180/g' /etc/vhost-gen/main.yml
httpd_1  | root $ sed -i'' 's/__PHP_ENABLE__/yes/g' /etc/vhost-gen/mass.yml
httpd_1  | root $ sed -i'' 's/__PHP_ADDR__/172.16.238.10/g' /etc/vhost-gen/mass.yml
httpd_1  | root $ sed -i'' 's/__PHP_PORT__/9000/g' /etc/vhost-gen/mass.yml
httpd_1  | root $ sed -i'' 's/__PHP_TIMEOUT__/180/g' /etc/vhost-gen/mass.yml
httpd_1  | root $ sed -i'' 's/__DOCKER_LOGS_ERROR__/no/g' /etc/vhost-gen/main.yml
httpd_1  | root $ sed -i'' 's/__DOCKER_LOGS_ACCESS__/no/g' /etc/vhost-gen/main.yml
httpd_1  | root $ sed -i'' 's/__DOCKER_LOGS_ERROR__/no/g' /etc/vhost-gen/mass.yml
httpd_1  | root $ sed -i'' 's/__DOCKER_LOGS_ACCESS__/no/g' /etc/vhost-gen/mass.yml
httpd_1  | root $ sed -i'' 's|__ENABLE_STATUS__|yes|g' /etc/vhost-gen/main.yml
httpd_1  | root $ sed -i'' 's|__STATUS_ALIAS__|/devilbox-httpd-status|g' /etc/vhost-gen/main.yml
httpd_1  | root $ vhost-gen -n localhost -p /var/www/default/htdocs -t /etc/vhost-gen/templates-main/ -c /etc/vhost-gen/main.yml -o /var/www/default/cfg -v -d -s -m both
httpd_1  | vhost-gen: [INFO]  (2021-05-24 09:15:44): Loading configuration file        (-c): /etc/vhost-gen/main.yml
httpd_1  | vhost-gen: [INFO]  (2021-05-24 09:15:44): Loading vhost template (global)   (-t): /etc/vhost-gen/templates-main/nginx.yml
httpd_1  | vhost-gen: [INFO]  (2021-05-24 09:15:44): Loading vhost template (override) (-o): /var/www/default/cfg/nginx.yml
httpd_1  | vhost-gen: [WARN]  (2021-05-24 09:15:44): Override Vhost template not found: /var/www/default/cfg/nginx.yml
httpd_1  | vhost-gen: [INFO]  (2021-05-24 09:15:44): Creating vhost type: https and http (both)
httpd_1  | vhost-gen: [INFO]  (2021-05-24 09:15:44): Using vhost name: localhost
httpd_1  | vhost-gen: [INFO]  (2021-05-24 09:15:44): Log setting: dir -> True
httpd_1  | vhost-gen: [INFO]  (2021-05-24 09:15:44): Log setting: Not specified
httpd_1  | vhost-gen: [INFO]  (2021-05-24 09:15:44): Vhost config written to: /etc/httpd/conf.d/localhost.conf
httpd_1  | root $ sed -i'' 's|__DOCROOT_SUFFIX__|htdocs|g' /etc/vhost-gen/mass.yml
httpd_1  | root $ sed -i'' 's/__TLD__/.test/g' /etc/vhost-gen/mass.yml
httpd_1  | root $ mkdir -p /etc/httpd/cert/main
httpd_1  | root $ cert-gen -v -c DE -s Berlin -l Berlin -o Devilbox -u Devilbox -n 'localhost' -e 'admin@localhost' -a 'localhost *.localhost devilbox *.devilbox httpd' /ca/devilbox-ca.key /ca/devilbox-ca.crt /etc/httpd/cert/main/localhost.key /etc/httpd/cert/main/localhost.csr /etc/httpd/cert/main/localhost.crt
httpd_1  | $ openssl req -newkey rsa:2048 -sha256 -nodes -extensions v3_req -config <(echo "[req]
httpd_1  | distinguished_name = req_distinguished_name
httpd_1  | x509_extensions = v3_req
httpd_1  |
httpd_1  | [req_distinguished_name]
httpd_1  |
httpd_1  | [ v3_req ]
httpd_1  | basicConstraints = critical, CA:FALSE
httpd_1  | subjectKeyIdentifier = hash
httpd_1  | keyUsage = critical, digitalSignature, keyEncipherment
httpd_1  | authorityKeyIdentifier = keyid:always,issuer:always
httpd_1  | extendedKeyUsage = serverAuth, clientAuth
httpd_1  | subjectAltName=${ALT_NAMES}") -keyout /etc/httpd/cert/main/localhost.key -subj '/C=DE/ST=Berlin/L=Berlin/O=Devilbox/OU=Devilbox/CN=localhost/emailAddress=admin@localhost' -out /etc/httpd/cert/main/localhost.csr
httpd_1  | $ openssl x509 -req -sha256 -extensions v3_req -extfile <(echo "[req]
httpd_1  | distinguished_name = req_distinguished_name
httpd_1  | x509_extensions = v3_req
httpd_1  |
httpd_1  | [req_distinguished_name]
httpd_1  |
httpd_1  | [ v3_req ]
httpd_1  | basicConstraints = critical, CA:FALSE
httpd_1  | subjectKeyIdentifier = hash
httpd_1  | keyUsage = critical, digitalSignature, keyEncipherment
httpd_1  | authorityKeyIdentifier = keyid:always,issuer:always
httpd_1  | extendedKeyUsage = serverAuth, clientAuth
httpd_1  | subjectAltName=${ALT_NAMES}") -days 825 -in /etc/httpd/cert/main/localhost.csr -CA /ca/devilbox-ca.crt -CAkey /ca/devilbox-ca.key -CAcreateserial -out /etc/httpd/cert/main/localhost.crt
httpd_1  | Certificate:
httpd_1  |     Data:
httpd_1  |         Version: 3 (0x2)
httpd_1  |         Serial Number:
httpd_1  |             46:86:77:76:ba:dc:3f:0b:3a:9a:d9:2a:ae:a0:f9:72:d7:fb:7b:23
httpd_1  |         Signature Algorithm: sha256WithRSAEncryption
httpd_1  |         Issuer: C = DE, ST = Berlin, L = Berlin, O = Devilbox, OU = Devilbox, CN = Devilbox Root CA, emailAddress = cytopia@devilbox.org, dnQualifier = FYMPZv8kOPjb0SSH6uOmGGK5BtU=
httpd_1  |         Validity
httpd_1  |             Not Before: May 24 12:15:44 2021 GMT
httpd_1  |             Not After : Aug 27 12:15:44 2023 GMT
httpd_1  |         Subject: C = DE, ST = Berlin, L = Berlin, O = Devilbox, OU = Devilbox, CN = localhost, emailAddress = admin@localhost
httpd_1  |         Subject Public Key Info:
httpd_1  |             Public Key Algorithm: rsaEncryption
httpd_1  |                 RSA Public-Key: (2048 bit)
httpd_1  |                 Modulus:
httpd_1  |                     00:a4:f0:d8:67:a5:71:66:6c:46:89:70:cd:21:c8:
httpd_1  |                     f7:ca:89:5b:25:52:d5:81:31:2b:a6:26:a6:7c:60:
httpd_1  |                     90:89:5f:d3:6e:4a:f7:f1:1e:d6:34:d2:51:b2:b7:
httpd_1  |                     72:7b:2b:56:e7:95:1c:83:88:98:cd:e6:ab:de:f9:
httpd_1  |                     fa:bf:6e:86:91:d3:d9:0c:be:d9:57:b9:e5:f1:9e:
httpd_1  |                     d7:ac:c9:54:53:30:1b:a9:a0:9d:2c:cd:a9:fe:5d:
httpd_1  |                     f3:6c:5e:c3:d1:1e:6c:57:4a:aa:16:b9:8c:82:2a:
httpd_1  |                     0d:64:72:84:ac:98:b8:0b:ba:c5:11:7a:78:77:3f:
httpd_1  |                     7b:53:2c:4b:92:87:ce:a8:d4:a1:27:12:9f:55:f4:
httpd_1  |                     f5:77:7d:a8:b1:c8:96:27:14:85:21:f5:ae:a3:05:
httpd_1  |                     76:75:d4:ee:a2:e9:45:75:e8:3a:7f:a7:68:d5:6c:
httpd_1  |                     8d:5d:49:f8:53:10:c5:5b:f6:76:2b:cf:e2:f9:c0:
httpd_1  |                     b5:ca:a1:78:d8:25:24:7f:bc:70:38:98:06:a4:42:
httpd_1  |                     d0:40:89:86:a6:5c:99:b9:5c:a4:68:1f:d6:3c:58:
httpd_1  |                     16:b5:27:1c:20:a1:86:68:d8:f3:4a:fd:55:29:fa:
httpd_1  |                     b4:ba:18:e3:61:15:c6:a9:d6:df:90:81:12:35:0e:
httpd_1  |                     49:3c:df:03:ec:cc:40:04:cd:f5:f5:d6:8d:72:e2:
httpd_1  |                     85:5d
httpd_1  |                 Exponent: 65537 (0x10001)
httpd_1  |         X509v3 extensions:
httpd_1  |             X509v3 Basic Constraints: critical
httpd_1  |                 CA:FALSE
httpd_1  |             X509v3 Subject Key Identifier:
httpd_1  |                 1C:77:4D:25:0A:2E:46:2C:62:1C:B6:89:E0:FE:7A:4C:61:30:4B:04
httpd_1  |             X509v3 Key Usage: critical
httpd_1  |                 Digital Signature, Key Encipherment
httpd_1  |             X509v3 Authority Key Identifier:
httpd_1  |                 keyid:15:83:0F:66:FF:24:38:F8:DB:D1:24:87:EA:E3:A6:18:62:B9:06:D5
httpd_1  |                 DirName:/C=DE/ST=Berlin/L=Berlin/O=Devilbox/OU=Devilbox/CN=Devilbox Root CA/emailAddress=cytopia@devilbox.org/dnQualifier=FYMPZv8kOPjb0SSH6uOmGGK5BtU=
httpd_1  |                 serial:6D:EC:0B:66:59:3A:E8:B0:40:C0:6E:F5:0D:50:18:68:D8:3C:26:E5
httpd_1  |
httpd_1  |             X509v3 Extended Key Usage:
httpd_1  |                 TLS Web Server Authentication, TLS Web Client Authentication
httpd_1  |             X509v3 Subject Alternative Name:
httpd_1  |                 DNS:localhost, DNS:localhost, DNS:*.localhost, DNS:devilbox, DNS:*.devilbox, DNS:httpd
httpd_1  |     Signature Algorithm: sha256WithRSAEncryption
httpd_1  |          a5:cc:c3:ad:63:46:82:a0:d5:98:4a:bc:b5:fc:26:5a:bb:b5:
httpd_1  |          be:07:8a:d3:38:07:b8:e6:9b:fd:6f:b9:61:32:a1:fb:4c:4d:
httpd_1  |          d8:2b:28:68:1f:23:f7:3c:a9:48:75:a0:59:7e:a8:40:97:c0:
httpd_1  |          8c:67:a8:ea:93:06:3e:ab:75:e6:38:02:f2:3a:6a:ba:d3:74:
httpd_1  |          1d:3b:cd:29:6e:ac:ca:87:a2:3d:fc:cc:09:51:f6:05:f3:8d:
httpd_1  |          a4:00:10:a5:05:e4:69:27:b2:80:74:8e:41:c2:db:d8:fb:01:
httpd_1  |          95:ce:63:88:b9:5c:60:2e:81:a5:2d:fd:ae:f9:96:90:0c:ca:
httpd_1  |          6e:11:ad:27:29:44:f3:5a:6c:ba:fd:c0:2e:ee:23:31:99:83:
httpd_1  |          48:8e:4c:5f:d0:fb:e2:e7:0a:0b:28:b9:24:04:5f:46:1c:e5:
httpd_1  |          06:40:18:3b:96:a8:42:e1:b4:bc:41:b0:34:fa:8b:f1:10:36:
httpd_1  |          fd:64:a6:b1:40:ef:7e:00:25:f7:18:45:8c:56:02:f6:f9:60:
httpd_1  |          82:47:1c:d0:e1:aa:96:30:8f:a3:83:3d:20:19:ec:96:1b:fd:
httpd_1  |          94:bf:03:95:d3:e5:ce:ab:ad:db:a9:42:e5:33:9b:79:99:3f:
httpd_1  |          ab:b9:30:41:d1:19:a7:fa:e6:86:12:75:e3:0d:e2:a3:46:58:
httpd_1  |          90:80:d0:cb
httpd_1  | /etc/httpd/cert/main/localhost.crt: OK
httpd_1  | root $ chown -R 1000:1000 /ca
httpd_1  | [INFO] Starting supervisord: 3.3.5
httpd_1  | 2021-05-24 09:15:45,097 INFO Set uid to user 0 succeeded
httpd_1  | 2021-05-24 09:15:45,099 INFO supervisord started with pid 1
php_1    | [INFO] Forwarding httpd:80 to 127.0.0.1:80 inside this docker.
php_1    | [INFO] Forwarding httpd:443 to 127.0.0.1:443 inside this docker.
php_1    | [INFO] Forwarding mysql:3306 to 127.0.0.1:3306 inside this docker.
php_1    | [INFO] Forwarding pgsql:5432 to 127.0.0.1:5432 inside this docker.
mysql_1  | 2021-05-24 12:15:45+00:00 [Note] [Entrypoint]: Entrypoint script for MySQL Server 1:10.5.8+maria~focal started.
php_1    | [INFO] Forwarding redis:6379 to 127.0.0.1:6379 inside this docker.
php_1    | [INFO] Forwarding memcd:11211 to 127.0.0.1:11211 inside this docker.
php_1    | [INFO] Forwarding mongo:27017 to 127.0.0.1:27017 inside this docker.
php_1    | [INFO] Enabling 'socat-80-httpd-80' to be started by supervisord
php_1    | [INFO] Enabling 'socat-443-httpd-443' to be started by supervisord
php_1    | [INFO] Enabling 'socat-3306-mysql-3306' to be started by supervisord
Error response from daemon: Ports are not available: listen tcp 0.0.0.0:5432: bind: An attempt was made to access a socket in a way that is prohibited by access permissions```
cytopia commented 3 years ago

started with docker compose up as it is now the default recommendation for docker instead of docker-compose up.

This has not been tested with Devilbox. Please do use docker-compose up and in case of something not working as expected use the bug report template. Otherwise it will not be possible for people to reproduce your issue and assisting you with it.

olka276 commented 3 years ago

Look for this port on netstat command (netstat -tulpn | grep LISTEN). If it appears there - kill it by process ID - last column number (kill -9 [ID])

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.