apache / apache/pulsar-manager

Starting Docker container pulsar-manager-0.3.0 with internal PostgreSQL does not work

Open
#505 33 comments 1 reaction 0 assignees View on GitHub
Dominant language
Vue
Stars
539
Forks
239
PR merge metrics
No merged PRs in 30d

Description

Running Pulsar Manager with the default [Pulsar Helm Chart settings](https://github.com/apache/pulsar-helm-chart/blob/pulsar-3.0.0/charts/pulsar/values.yaml#L1051) ends with not working manager instance.

## Steps to reproduce
Run the container using the default:
```bash
docker pull apachepulsar/pulsar-manager:v0.3.0
docker run -it \
-p 9527:9527 -p 7750:7750 \
-e REDIRECT_HOST="http://127.0.0.1" \
-e REDIRECT_PORT="9527" \
-e DRIVER_CLASS_NAME="org.postgresql.Driver" \
-e URL="jdbc:postgresql://127.0.0.1:5432/pulsar_manager" \
-e USERNAME="pulsar" \
-e PASSWORD="pulsar" \
-e LOG_LEVEL="DEBUG" \
apachepulsar/pulsar-manager:v0.3.0
```

## Result
First, the user is asked for the information by the `adduser` command from the https://github.com/apache/pulsar-manager/blob/v0.3.0/docker/entrypoint.sh#L27 (looks like fix for this is pretty easy: `adduser --disabled-password --gecos "" --ingroup pulsar pulsar`). However, later running the `/pulsar-manager/startup.sh` fails with:

```bash
/pulsar-manager/startup.sh: 21: initdb: not found
/pulsar-manager/startup.sh: 22: pg_ctl: not found
createdb: error: could not connect to database template1: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
psql: error: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
```

Then in the `/pulsar-manager/pulsar-manager.log` you can see the connection error (as the DB didn't start):
```bash
2023-01-13 10:49:51.463 ERROR 156 --- [pool-2-thread-1] com.zaxxer.hikari.pool.HikariPool : HikariPool-1 - Exception during pool initialization.

org.postgresql.util.PSQLException: Connection to 127.0.0.1:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
```

Finally, the backend never starts properly.

## Expected result
The Pulsar Manager creates an internal DB instance and runs properly.

## Additional details
I'm running the command above on M1 Apple Silicon processor and Docker Desktop for Mac `v4.15.0`.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.