docker-bookstack icon indicating copy to clipboard operation
docker-bookstack copied to clipboard

Bookstack app should able to test connection to MySQL non default port 3306

Open thohng opened this issue 3 years ago • 5 comments

linuxserver.io


Our Bookstack hosting using Digital Ocean MySQL cluster which not use the default port 3306.

Expected Behavior

Bookstack app should able to test connection to MySQL which not use default port, e.g. DB_HOST=10.109.0.2:25060.

Current Behavior

The startup process will try to test connection to MySQL in 30 seconds before can proceed the next steps.

Steps to Reproduce

Provide configuration environment on docker-compose.yml

environment:
  - APP_URL=https://domain
  - DB_HOST=10.109.0.2:25060
  - DB_USER=user
  - DB_PASS=password
  - DB_DATABASE=database_name
  1. DB_HOST=10.109.0.2:25060

Environment

OS: Ubuntu 20.04 TLS CPU architecture: x86_64 How docker service was installed: From the official https://docs.docker.com/engine/install/ubuntu/

Command used to create docker container (run/create/compose/screenshot)

docker-compose up -d
docker-compose logs -f

Docker logs

...
Running config - db_user set
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
nc: getaddrinfo: Name does not resolve
Nothing to migrate.
....

thohng avatar Sep 23 '22 08:09 thohng

Thanks for opening your first issue here! Be sure to follow the bug or feature issue templates!

github-actions[bot] avatar Sep 23 '22 08:09 github-actions[bot]

Submitted PR

thohng avatar Sep 23 '22 08:09 thohng

Will the change in PR we've discussed still resolve the issue you're reporting here? Majority of the team doesn't change the db port so it's not something we had encountered before and like you, we would like to see it resolved.

drizuid avatar Oct 08 '22 16:10 drizuid

Yub, I've tested the PR fixes this issue. And I think Im going to extent the PR a bit to have it support DB_PORT also.

thohng avatar Oct 08 '22 17:10 thohng

The PR now support DB_PORT

thohng avatar Oct 08 '22 19:10 thohng

The issue is fixed from version v22.11.1 from build 23/Dec/2022: https://hub.docker.com/layers/linuxserver/bookstack/22.11.1/images/sha256-356ae10976e45c62c57fb15e1ad257b002c3cd133f8e34fb3703ee3484530e01?context=explore

Fix and improvements in the PR 136:

  • Default port will be 3306, and can be specified if different with 3306, either on DB_HOST or DB_PORT, but not in both at the same time
  • DB_HOST can be host only or host:port
  • Adding new DB_PORT
  • Improve sed and grep searching at beginning of the line, instead of any position on the line
  • Can uncomment and active the ENV DB info, like #DB_PORT=anyservernameorip to DB_PORT=newservernameorip
  • Can reupdate the ENV DB info again from docker environment variable
  • Refactoring file 50-config

thohng avatar Dec 23 '22 03:12 thohng