Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mysql connection not using the host and port specified #5

Open
brycelarge opened this issue Oct 12, 2023 · 9 comments
Open

Mysql connection not using the host and port specified #5

brycelarge opened this issue Oct 12, 2023 · 9 comments

Comments

@brycelarge
Copy link

brycelarge commented Oct 12, 2023

Hi there,

Here is the docker run script:

docker run
  -d
  --name='semaphore'
  --net='bridge'
  -e 'SEMAPHORE_DB_DIALECT'='mysql'
  -e 'SEMAPHORE_ADMIN'='admin'
  -e 'SEMAPHORE_ADMIN_PASSWORD'='somepass'
  -e 'SEMAPHORE_ADMIN_NAME'='someone'
  -e 'SEMAPHORE_ADMIN_EMAIL'='someone@somewhere'
  -e 'SEMAPHORE_ACCESS_KEY_ENCRYPTION'='9946NyKhSqwfqeqwfqwfqwfqw5CH+kg='
  -e 'SEMAPHORE_DB_HOST'='192.168.1.2'
  -e 'SEMAPHORE_DB_PORT'='3309'
  -e 'SEMAPHORE_DB_USER'='semaphore'
  -e 'SEMAPHORE_DB_PASS'='somepassword'
  -e 'SEMAPHORE_DB'='semaphore'
  -p '3000:3000/tcp'
  -v '/semaphore':'/config':'rw' 'ghcr.io/imagegenius/semaphore' 

Here is the container errors:

/go/src/github.com/ansible-semaphore/semaphore/cli/main.go:8 +0x17
time="2023-10-12T09:07:22+02:00" level=warning msg="Error 1045: Access denied for user 'semaphore'@'172.17.0.1' (using password: YES)"
panic: Error 1045: Access denied for user 'semaphore'@'172.17.0.1' (using password: YES)
@hydazz
Copy link
Member

hydazz commented Oct 12, 2023

what does printenv show within the container?

@brycelarge
Copy link
Author

brycelarge commented Oct 12, 2023

what does printenv show within the container?

SEMAPHORE_TMP_PATH=/tmp/semaphore
SEMAPHORE_DB_HOST=192.168.1.2
PUID=99
SEMAPHORE_ADMIN=admin
HOSTNAME=fddb2f5d6bd9
S6_CMD_WAIT_FOR_SERVICES_MAXTIME=0
SEMAPHORE_ADMIN_EMAIL=someone@somewhere.com
HOST_CONTAINERNAME=semaphore
UMASK=022
PWD=/
TZ=Africa/Johannesburg
SEMAPHORE_DB=semaphore
HOME=/config
PGID=100
VIRTUAL_ENV=/lsiopy
SEMAPHORE_ADMIN_NAME=Somneone
S6_VERBOSITY=1
S6_STAGE2_HOOK=/docker-mods
SEMAPHORE_ACCESS_KEY_ENCRYPTION=6646NyKsomekeykeyvm6Z4n36d5WZ5CH+kg=
TERM=xterm
HOST_OS=Unraid
SEMAPHORE_DB_PORT=3309
SHLVL=1
SEMAPHORE_DB_DIALECT=mysql
SEMAPHORE_CONFIG_PATH=/config
SEMAPHORE_DB_PASS=somepass24525
PS1=$(whoami)@$(hostname):$(pwd)$
PATH=/lsiopy/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
HOST_HOSTNAME=myserver
SEMAPHORE_DB_USER=semaphore
SEMAPHORE_ADMIN_PASSWORD=somepassword
SEMAPHORE_DB_PATH=/config

@brycelarge
Copy link
Author

PS1 value is suspect but dont think that would cause this issue

@hydazz
Copy link
Member

hydazz commented Oct 12, 2023

It is indeed working, looks like mysql is not configured so that the user semaphore is allowed to connect from 172.17.0.1, update the user so that it allows connections from anywhere % or 172.17.0.1

@brycelarge
Copy link
Author

Thanks for the quick assistance.

Tried that, perhaps its not connecting to the correct port, I have mysql running on many ports. Let me test the 3306 instance

image

@brycelarge
Copy link
Author

brycelarge commented Oct 12, 2023

Confirmed its connecting to 3306 not the specified SEMAPHORE_DB_PORT of 3309

is this a limitation of semaphore or is there something else going on?

@jfroebe
Copy link

jfroebe commented Dec 25, 2023

Semaphore requires the port be part of SEMAPHORE_DB_HOST as it knows nothing about SEMAPHORE_DB_PORT. e.g. SEMAPHORE_DB_HOST=192.168.0.2:4306

@hydazz
Copy link
Member

hydazz commented Dec 25, 2023

Semaphore requires the port be part of SEMAPHORE_DB_HOST as it knows nothing about SEMAPHORE_DB_PORT. e.g. SEMAPHORE_DB_HOST=192.168.0.2:4306

https://docs.semui.co/administration-guide/installation#docker, SEMAPHORE_DB_PORT is marked as a variable here

@jfroebe
Copy link

jfroebe commented Dec 25, 2023

Semaphore requires the port be part of SEMAPHORE_DB_HOST as it knows nothing about SEMAPHORE_DB_PORT. e.g. SEMAPHORE_DB_HOST=192.168.0.2:4306

https://docs.semui.co/administration-guide/installation#docker, SEMAPHORE_DB_PORT is marked as a variable here

Yes but the Semphore code doesn't do anything with SEMAPHORE_DB_PORT. The port needs to be specified with SEMAPHORE_DB_HOST. SEMAPHORE_DB_PORT simply isn't implemented (yet).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants