Team-TAU / tau

TAU- Twitch API Unifier, a containerized relay/proxy to unify the WebHook- and WebSocket-based real-time Twitch APIs under a single (local) WebSocket connection.
MIT License
153 stars 39 forks source link

[BUG] docker compose up complains about port 7000 but running again is fine #119

Closed iandouglas closed 1 year ago

iandouglas commented 2 years ago

Describe the bug I rebooted my Windows machine, opened a PowerShell to run TAU, and it complained about port 7000 being in use. Running it again immediately had no problem.

To Reproduce Steps to reproduce the behavior:

  1. I rebooted my Windows 11 machine
  2. I restarted Docker
  3. I opened a PowerShell, navigated to the TAU folder, and ran "docker-compose up", got port 7000 error
  4. Did some checking about what was running on port 7000 already, Docker came up as the culprit
  5. Immediately re-ran the "docker-compose up" command again, and it worked just fine

Expected behavior As a user, I'd like to only run "docker-compose up" one time.

Screenshots

[+] Running 4/3
 - Network tau_default    Created                                                                                  0.0s
 - Container tau-redis-1  Created                                                                                  0.1s
 - Container tau-db-1     Created                                                                                  0.1s
 - Container tau-app-1    Created                                                                                  0.0s
Attaching to tau-app-1, tau-db-1, tau-redis-1
tau-redis-1  | 1:C 24 Sep 2022 19:25:44.437 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
tau-redis-1  | 1:C 24 Sep 2022 19:25:44.437 # Redis version=6.2.7, bits=64, commit=00000000, modified=0, pid=1, just started
tau-redis-1  | 1:C 24 Sep 2022 19:25:44.437 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf
tau-db-1     |
tau-db-1     | PostgreSQL Database directory appears to contain a database; Skipping initialization
tau-redis-1  | 1:M 24 Sep 2022 19:25:44.437 * monotonic clock: POSIX clock_gettime
tau-db-1     |
tau-redis-1  | 1:M 24 Sep 2022 19:25:44.438 # A key '__redis__compare_helper' was added to Lua globals which is not on the globals allow list nor listed on the deny list.
tau-redis-1  | 1:M 24 Sep 2022 19:25:44.438 * Running mode=standalone, port=6379.
tau-redis-1  | 1:M 24 Sep 2022 19:25:44.438 # Server initialized
tau-redis-1  | 1:M 24 Sep 2022 19:25:44.438 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
tau-redis-1  | 1:M 24 Sep 2022 19:25:44.438 * Ready to accept connections
tau-db-1     | 2022-09-24 19:25:44.487 UTC [1] LOG:  starting PostgreSQL 13.7 on x86_64-pc-linux-musl, compiled by gcc (Alpine 11.2.1_git20220219) 11.2.1 20220219, 64-bit
tau-db-1     | 2022-09-24 19:25:44.487 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
tau-db-1     | 2022-09-24 19:25:44.487 UTC [1] LOG:  listening on IPv6 address "::", port 5432
tau-db-1     | 2022-09-24 19:25:44.489 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
tau-db-1     | 2022-09-24 19:25:44.494 UTC [21] LOG:  database system was shut down at 2022-09-18 19:00:49 UTC
tau-db-1     | 2022-09-24 19:25:44.499 UTC [1] LOG:  database system is ready to accept connections
Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:7000 -> 0.0.0.0:0: listen tcp 0.0.0.0:7000: bind: Only one usage of each socket address (protocol/network address/port) is normally permitted.
PS D:\src\public\tau\tau> git pull
Already up to date.
PS D:\src\public\tau\tau> & 'C:\Program Files\Docker\cli-plugins\docker-compose.exe' up
[+] Running 3/0
 - Container tau-db-1     Running                                                                                  0.0s
 - Container tau-redis-1  Running                                                                                  0.0s
 - Container tau-app-1    Running                                                                                  0.0s
Attaching to tau-app-1, tau-db-1, tau-redis-1
tau-app-1    | server stdout | 127.0.0.1:35842 - - [24/Sep/2022:19:32:46] "GET /api/v1/heartbeat" 200 18
tau-app-1    | server stdout |
tau-app-1    | server stdout | 127.0.0.1:56032 - - [24/Sep/2022:19:32:58] "POST /api/v1/irc" 201 2
tau-app-1    | server stdout |
tau-app-1    | server stdout | 127.0.0.1:35842 - - [24/Sep/2022:19:33:01] "GET /api/v1/heartbeat" 200 18
tau-app-1    | server stdout |
tau-app-1    | server stdout | 127.0.0.1:35842 - - [24/Sep/2022:19:33:17] "GET /api/v1/heartbeat" 200 18
tau-app-1    | server stdout |

Deployment: Docker Version: Docker version 20.10.17, build 100c701 Docker Compose Version (if applicable): docker-compose version 1.29.2, build 5becea4c Deployment Type: Local Deployment Details: n/a

Additional context Riker says hello to your puppers

FiniteSingularity commented 2 years ago

Is this something that happens every time you reboot? Are you assigning TAU to run on port 7000 in your .env file? There is nothing I know of that uses port 7000 by default in Tau. Also, did you check to see if TAU is already running after your reboot (depending on how Docker is configured, it may be auto-starting TAU for you on reboot, and you're trying to launch the same set of processes again).

FiniteSingularity commented 1 year ago

Closing for now, as I can't reproduce. Feel free to open if you see this again.