nuxsmin / docker-syspass

Docker stuff for running sysPass on Docker
GNU General Public License v3.0
39 stars 21 forks source link

Error while checking the database Please, try the installation again. #11

Closed szirmaigy closed 6 years ago

szirmaigy commented 6 years ago

Hi,

I created the docker-compose file with networs, and nginx-proxy (in other compose file ( jwilder/nginx-proxy )). When I want installated syspass the system writed this error. What could be the reason for that?

Order of creation:

  1. docker network create nginx-proxy

  2. docker-compose -p nginx-proxy -f nginx-proxy/docker-compose.yml

compose file: version: '2'

services: nginx-proxy: image: jwilder/nginx-proxy container_name: nginx-proxy restart: always networks:

networks: nginx-proxy: external: true

  1. docker-compose -p syspass -f syspass/docker-compose.yml

compose file: version: '2' services: app: container_name: syspass-app image: nuxsmin/docker-syspass:latest restart: always networks:

volumes: syspass-config: syspass-backup: syspass-db:

networks: nginx-proxy: external: name: nginx-proxy default: driver: bridge


docker network ls:

NETWORK ID NAME DRIVER SCOPE 1a996b899403 bridge bridge local fe846508a28d host host local 22a55494622f nginx-proxy bridge local 72192372741a none null local cfbce377fa17 syspass_default bridge local

docker network inspect syspass_default:

    "Containers": {
        "735bceea779e797bafb3ee2f4ca2795e97f40e961188075ea8d5569c4dfd537a": {
            "Name": "syspass-db",
            "EndpointID": "85c7a8f95cce0c92c302c4680686c428bd765de25ebea0baf6d539dc02657a39",
            "MacAddress": "02:42:ac:12:00:03",
            "IPv4Address": "172.18.0.3/16",
            "IPv6Address": ""
        },
        "e1f222fc30919e70d7079fc955352f418b972916de272a7b258e304e81c7d638": {
            "Name": "syspass-app",
            "EndpointID": "1c13109ecc91491174298cb6feb3e600fcb349a504cbd9e38995abfe257e674c",
            "MacAddress": "02:42:ac:12:00:02",
            "IPv4Address": "172.18.0.2/16",
            "IPv6Address": ""
        }
    },

docker inspect syspass-db:

        "Networks": {
            "syspass_default": {
                "IPAMConfig": null,
                "Links": null,
                "Aliases": [
                    "735bceea779e",
                    "db",
                    "syspass-db"
                ],
                "NetworkID": "cfbce377fa178838b645303b1856c4baf70650f41db8c29243c3bc769ddd18da",
                "EndpointID": "85c7a8f95cce0c92c302c4680686c428bd765de25ebea0baf6d539dc02657a39",
                "Gateway": "172.18.0.1",
                "IPAddress": "172.18.0.3",
                "IPPrefixLen": 16,
                "IPv6Gateway": "",
                "GlobalIPv6Address": "",
                "GlobalIPv6PrefixLen": 0,
                "MacAddress": "02:42:ac:12:00:03"
            }

docker inspect syspass-app:

        "Networks": {
            "nginx-proxy": {
                "IPAMConfig": null,
                "Links": null,
                "Aliases": [
                    "app",
                    "e1f222fc3091"
                ],
                "NetworkID": "22a55494622fb0273e9f865c93f6ca574194f048efda70632a71c3b786118d73",
                "EndpointID": "00016f93da24b3ed06984a5cbb7d3f54b2ff5072e9cd6adfa1eb9605555633d0",
                "Gateway": "172.20.0.1",
                "IPAddress": "172.20.0.3",
                "IPPrefixLen": 16,
                "IPv6Gateway": "",
                "GlobalIPv6Address": "",
                "GlobalIPv6PrefixLen": 0,
                "MacAddress": "02:42:ac:14:00:03"
            },
            "syspass_default": {
                "IPAMConfig": null,
                "Links": null,
                "Aliases": [
                    "app",
                    "e1f222fc3091"
                ],
                "NetworkID": "cfbce377fa178838b645303b1856c4baf70650f41db8c29243c3bc769ddd18da",
                "EndpointID": "1c13109ecc91491174298cb6feb3e600fcb349a504cbd9e38995abfe257e674c",
                "Gateway": "172.18.0.1",
                "IPAddress": "172.18.0.2",
                "IPPrefixLen": 16,
                "IPv6Gateway": "",
                "GlobalIPv6Address": "",
                "GlobalIPv6PrefixLen": 0,
                "MacAddress": "02:42:ac:12:00:02"
            }

docker exec -it syspass-db ping syspass-app:

PING syspass-app (172.18.0.2): 56 data bytes 64 bytes from 172.18.0.2: icmp_seq=0 ttl=64 time=0.128 ms 64 bytes from 172.18.0.2: icmp_seq=1 ttl=64 time=0.069 ms

docker exec -it syspass-db mysql -e "select user,host from mysql.user;":

+------------------+-----------------------------+ | user | host | +------------------+-----------------------------+ | root | 127.0.0.1 | | root | 16163be85d95 | | root | ::1 | | debian-sys-maint | localhost | | root | localhost | | root | syspass-app.syspass_default | +------------------+-----------------------------+

DB Configuration (MySQL): DB access user: root DB access password: syspass syspass database name: syspass syspass database server: db (or syspass-db)

Thank for your help!

nuxsmin commented 6 years ago

Hi!, please try out this compose file https://github.com/nuxsmin/docker-syspass/tree/master/sysPass-dev-php7

Although it's named "dev-php7", it only adds some development packages and just pull the master branch.

Regards.

szirmaigy commented 6 years ago

Hi,

I have error: Pulling app (nuxsmin/docker-syspass:dev-php7)... ERROR: manifest for nuxsmin/docker-syspass:dev-php7 not found

nuxsmin commented 6 years ago

Fixed!! It was pointing to the wrong tag (dev-php7 instead of devel-php7).

captura_350

szirmaigy commented 6 years ago

I found the problem. The problem was in docker-compose.yml file, the images is not nuxsmin/docker-syspass:dev-php7, the right is nuxsmin/docker-syspass:devel-php7.

szirmaigy commented 6 years ago

I update compose file and I have this page on browser: 1 2

nuxsmin commented 6 years ago

Do you have the container's log?

The entrypoint should have set the right permissions:

        unzip ${SYSPASS_BRANCH}.zip \
        && mv sysPass-${SYSPASS_BRANCH}/* sysPass \
        && chown ${APACHE_RUN_USER}:${SYSPASS_UID} -R sysPass/ \
        && chmod g+w -R sysPass/ \
        && chmod 750 sysPass/config sysPass/backup
nuxsmin commented 6 years ago

I've just deployed the standalone container (without docker-compose) and it worked fine.

captura_351 captura_352

szirmaigy commented 6 years ago

I have a log when a started compose file without -d parameter:

syspass-app | inflating: sysPass-master/js/zxcvbn-async.min.js syspass-app | inflating: sysPass-master/js/zxcvbn.min.js syspass-app | mv: cannot move 'sysPass-master/backup' to 'sysPass/backup': Device or resource busy syspass-app | mv: cannot move 'sysPass-master/config' to 'sysPass/config': Device or resource busy syspass-app | syspass-app | Setting up composer ... syspass-app | /var/www/html/sysPass /var/www/html syspass-app | Installer verified syspass-app | All settings correct for using Composer syspass-app | Downloading... syspass-app | syspass-app | Composer (version 1.6.3) successfully installed to: /var/www/html/sysPass/composer.phar syspass-app | Use it: php composer.phar syspass-app | syspass-app | You are already using composer version 1.6.3 (stable channel). syspass-app | Do not run Composer as root/super user! See https://getcomposer.org/root for details syspass-app | Composer could not find a composer.json file in /var/www/html/sysPass syspass-app | To initialize a project, please create a composer.json file as described in the https://getcomposer.org/ "Getting Started" section syspass-app | /var/www/html syspass-app | AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 172.20.0.3. Set the 'ServerName' directive globally to suppress this message

This 2 line is not too good: syspass-app | mv: cannot move 'sysPass-master/backup' to 'sysPass/backup': Device or resource busy syspass-app | mv: cannot move 'sysPass-master/config' to 'sysPass/config': Device or resource busy

nuxsmin commented 6 years ago

I've just pushed a new commit that prevents failing when setting up sysPass directories. You can deploy it a soon as the automated build is completed: https://hub.docker.com/r/nuxsmin/docker-syspass/builds/

szirmaigy commented 6 years ago

So, We solved probrem the release version. If We created the DB manually in syspass-db, that the installation process was finished, and We can login to app. The problem is the database check.