jacobalberty / firebird-docker

Firebird Dockerfile
130 stars 96 forks source link

Default password error #43

Closed Bence98007 closed 2 years ago

Bence98007 commented 5 years ago

Hi there!

I get an error message when trying to connect to the Firebird 2.5 server. I’m trying to change the default password.. I’m not sure if I can make this clear, but I’ll try:

The error: I set the password via “ISC_PASSWORD='masterkey'” environment in the run command. When I try to run the container, the password is not changed to the value I’ve set in the run command.

This is my container run command:

docker run -d --restart=always \ --name FB2-Develop \ -p 3052:3050 \ -p 33052:33052 \ -v /var/containersdata/firebird2/data/:/firebird/data/ \ -v /var/containersdata/firebird2/etc/:/firebird/etc/ \ -e TZ='Europe/Budapest' \ -e ISC_PASSWORD='masterkey' \ jacobalberty/firebird:2.5-sc

Error message:

“Your user name and password are not defined. Ask your database administrator to set up a Firebird login.”

Later, I found out that the default password is in use, not mine. ( “9yd3vRy0” from /usr/local/firebird/skel/etc/SYSDBA.password file ) SYSDBA.password file is not created.

Container logs:

Warning - maximum 8 significant bytes of password used use gsec -? to get help Your user name and password are not defined. Ask your database administrator to set up a Firebird login. unable to open database

When I delete SYSDBA.password file, and run docker image: Container logs:

root@develop:~# docker logs FB2-Develop /usr/local/firebird/docker-entrypoint.sh: line 65: /firebird/etc/SYSDBA.password: No such file or directory Warning - maximum 8 significant bytes of password used use gsec -? to get help Your user name and password are not defined. Ask your database administrator to set up a Firebird login. unable to open database

Workaround

So before the first time (0.event) when I run the container, I have to copy the SYSDBA.password file from the skeleton directory in the firebird docker image, to the mapped directory (outside the docker) to make it work. After I start the container, it’s working fine, the file is changed to the new password which I’ve defined. This method is not permanent, since if You guys update this docker image, I have to extract the SYSDBA.password file again.

In Container

> root@5d26cf9d2e54:/# cat /usr/local/firebird/skel/etc/SYSDBA.password
> # Firebird generated password for user SYSDBA is:
> 
> ISC_USER=sysdba
> ISC_PASSWD=se1wHxZY
> 
> # generated on afc972672d14 at time Tue Mar 27 22:48:09 UTC 2018
> 
> # Your password can be changed to a more suitable one using the
> # /usr/local/firebird/bin/gsec utility.
> 
> rm /firebird/etc/SYSDBA.password
> cp /usr/local/firebird/skel/etc/SYSDBA.password /firebird/etc/
> 
> root@01e90334b15b:/# ls -al /firebird/etc/
> total 300
> drwxrwxrwx 3 root root   4096 Jul 29 13:20 .
> drwxr-xr-x 6 root root   4096 Jul 29 13:18 ..
> -r--r--r-- 1 root root  26023 Jul  2 20:49 IDPLicense.txt
> -r--r--r-- 1 root root  24301 Jul  2 20:49 IPLicense.txt
> -rw-r--r-- 1 root root    687 Jul  2 20:49 README
> -r-------- 1 root root    258 Jul 29 13:20 SYSDBA.password
> -rw-r--r-- 1 root root 190594 Jul  2 20:49 WhatsNew
> -rw-r--r-- 1 root root    275 Jul  2 20:49 aliases.conf
> -rw-r--r-- 1 root root   5464 Jul  2 20:49 fbtrace.conf
> -rw-r--r-- 1 root root  26921 Jul  2 21:25 firebird.conf
> drwxrwxrwx 2 root root   4096 Jul 26 16:31 h
> 
> root@01e90334b15b:/# exit

On host

root@develop:~# docker stop FB2-Develop
FB2-Develop
root@develop:~# docker rm FB2-Develop
FB2-Develop

root@develop:~# ./fb2_run-container
79be48605908a77d6cf4533363adedeb33f72ffa611312e16e7ab7d09b0e2357

root@develop:~# cat /var/containersdata/firebird2/etc/SYSDBA.password
# Firebird generated password for user SYSDBA is:

ISC_USER=SYSDBA
ISC_PASSWD=masterkey
# Your password can be changed to a more suitable one using the
# /usr/local/firebird/bin/gsec utility.

# Set for interop with 3.0
ISC_PASSWORD=masterkey

root@develop:~# ls -al /var/containersdata/firebird2/etc/
total 300
drwxrwxrwx 3 root root   4096 Jul 29 13:20 .
drwxrwxrwx 4 root root   4096 Jun 13 15:39 ..
-rw-r--r-- 1 root root  275 Jul  2 20:49 aliases.conf
-rw-r--r-- 1 root root   5464 Jul  2 20:49 fbtrace.conf
-rw-r--r-- 1 root root  26921 Jul  2 21:25 firebird.conf
drwxrwxrwx 2 root root   4096 Jul 26 16:31 h
-r--r--r-- 1 root root  26023 Jul  2 20:49 IDPLicense.txt
-r--r--r-- 1 root root  24301 Jul  2 20:49 IPLicense.txt
-rw-r--r-- 1 root root  687 Jul  2 20:49 README
-r-------- 1 root root  243 Jul 29 13:27 SYSDBA.password
-rw-r--r-- 1 root root 190594 Jul  2 20:49 WhatsNew

Environment

Host (name is develop):

root@develop:~# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 9 (stretch)"
NAME="Debian GNU/Linux"
VERSION_ID="9"
VERSION="9 (stretch)"
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"

Docker version:

root@develop:~# docker version
Client:
 Version:           18.09.7
 API version:       1.39
 Go version:        go1.10.8
 Git commit:        2d0083d
 Built:             Thu Jun 27 17:57:09 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.7
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.8
  Git commit:       2d0083d
  Built:            Thu Jun 27 17:23:02 2019
  OS/Arch:          linux/amd64
  Experimental:     false

Docker images:

root@develop:~# docker images
REPOSITORY              TAG                 IMAGE ID            CREATED             SIZE
jacobalberty/firebird   latest              c2dc89dc42e5        2 weeks ago         188MB
jacobalberty/firebird   2.5-sc              923a50329d69        3 weeks ago         180MB
jacobalberty/firebird   <none>              f8c7b499c85a        2 months ago        188MB
jacobalberty/firebird   <none>              bdffcd794919        16 months ago       176MB

Running containers:

root@develop:~# docker ps
CONTAINER ID        IMAGE                       COMMAND                 CREATED             STATUS                  PORTS                                           NAMES
79be48605908        jacobalberty/firebird:2.5-sc   "/usr/local/firebird…"   9 minutes ago       Up 9 minutes (healthy)  0.0.0.0:33052->33052/tcp, 0.0.0.0:3052->3050/tcp   FB2-Develop
ac9eff70dd60        jacobalberty/firebird:latest   "/usr/local/firebird…"   29 minutes ago      Up 29 minutes (healthy)   0.0.0.0:33053->33053/tcp, 0.0.0.0:3053->3050/tcp   FB3-Develop
1c6e629dcd74        jacobalberty/firebird:latest   "/usr/local/firebird…"   29 minutes ago      Up 29 minutes (healthy)   0.0.0.0:3063->3050/tcp, 0.0.0.0:33063->33053/tcp   FB3-Testing
jacobalberty commented 5 years ago

The password is generated at first startup with a specific volume. It checks for the presence of /firebird/system/security2.fdb and won't attempt to change the password as long as that file exists. if you remove that file from your volume it will attempt to reset it either to a new random password or to the contents of ISC_PASSWORD or the contents of the file in ISC_PASSWORD_FILE.

joarb commented 4 years ago

@Bence98007, if you pass the environment variable ISC_PASSWORD with double quotes it should be ok:

docker run -d --restart=always
--name FB2-Develop
-e "ISC_PASSWORD=masterkey"
jacobalberty/firebird:2.5-sc
Bence98007 commented 4 years ago

@Bence98007, if you pass the environment variable ISC_PASSWORD with double quotes it should be ok:

docker run -d --restart=always
--name FB2-Develop
-e "ISC_PASSWORD=masterkey"
jacobalberty/firebird:2.5-sc

Thanks! Will try that!

github-actions[bot] commented 2 years ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 14 days.