FacilMap / facilmap

FacilMap is a privacy-friendly, open-source versatile online map that combines different services based on OpenStreetMap and makes it easy to find places, plan trips and add markers, lines and routes to custom maps with live collaboration.
https://facilmap.org/
GNU Affero General Public License v3.0
317 stars 21 forks source link

Cannot get to run facilmap server with docker #106

Closed eauchat closed 5 years ago

eauchat commented 5 years ago

I was trying to run facilmap server with the docker-compose config you propose, but somehow, I can't get to make it start, it's always failing.

I got API keys from OSR and mapbox (couldn't get one from mapzen, their signup page is down). And I assumed I have to generate a database for facilmap myself, so this is how my docker-compose file look like:

version: '2'

services:

  db:
    image: mariadb
    restart: always
    volumes:
      - /srv/data/facilmap/db:/var/lib/mysql
    environment:
      - MYSQL_ROOT_PASSWORD=mysqlrootpass
      - MYSQL_PASSWORD=mysqlpass
      - MYSQL_DATABASE=facilmap
      - MYSQL_USER=facilmap

  facilmap:
    image: facilmap/facilmap2
    ports:
        - 9005
    links:
        - db
    environment:
        USER_AGENT: Mydomain FacilMap (https://facilmap.mydomain.org/, facilmap@mydomain.org)
        DB_TYPE: mysql
        DB_HOST: facilmap_facilmap_1
        DB_NAME: facilmap
        DB_USER: facilmap
        DB_PASSWORD: mysqlpass
        # API key from https://go.openrouteservice.org/ (needed for routing)
        OSR_TOKEN: mycustomlooooongOSRtoken
        # API key from https://www.mapbox.com/signup/ (needed for routing)
        MAPBOX_TOKEN: mycustomlooooongMAPBOXtoken

    restart: on-failure

Any hint on what's the problem in it?

cdauth commented 5 years ago

I can think of two things spontaneously:

  1. As DB_HOST, you should specify db. This is the best way to use links. (I should update the docs.) The full container name of the database will probably be facilmap_db_1 with old versions of docker-compose or facilmap_db_1_randomhash with newer versions.
  2. The container listens on port 8080. If you want to make it available on your host system on port 9005, use 9005:8080. This will make it publicly available (without SSL). If you just want to make it available to a local reverse proxy, better use 127.0.0.1:9005:8080 or somethings similar to restrict it to the local interface.

In general, it's always good to have a look at the logs (docker-compose logs).

eauchat commented 5 years ago

Thanks, what to pass to DB_HOST was the mysterious part to me. I also made the change in ports to 9005:8080, I had tried it also, but I wasn't sure it was the proper way to specify it to facilmap. But somehow it's still not starting and logging the following:

facilmap_1  |      code: 'ER_ACCESS_DENIED_ERROR',
facilmap_1  |      errno: 1045,
facilmap_1  |      sqlState: '28000',
facilmap_1  |      sqlMessage:
facilmap_1  |       "Access denied for user 'facilmap'@'172.28.0.3' (using password: YES)" } }
facilmap_1  | error Command failed with exit code 1.

It seems that there is an error in accessing the database, but I don't understand why, since db's MYSQL_PASSWORD and facilmap's DB_PASSWORD are both set to the same value. Am I misunderstanding something?

Note: I also tried removing the directory /srv/data/facilmap/ and running docker-compose rm -s before running docker-compose up again, to be sure I had a clean state.

cdauth commented 5 years ago

It sounds like the database user doesn't exist on the database server. I would have tried the same, remove the database directory and the containers and try again.

Maybe verify that the IP address points to the right MySQL server? (docker inspect facilmap_db_1)

eauchat commented 5 years ago

When I run docker inspect facilmap_facilmap_1 I get the following which seems right I guess

        "NetworkSettings": {
            ...
            "Networks": {
                "facilmap_default": {
                    "IPAMConfig": null,
                    "Links": [
                        "facilmap_db_1:db",
                        "facilmap_db_1:db_1",
                        "facilmap_db_1:facilmap_db_1"

And if I run docker inspect facilmap_db_1 I get the following, which maybe means it's pointing to 172.28.0.2 I could imagine.

        "NetworkSettings": {
            "Bridge": "",
            "HairpinMode": false,
            "LinkLocalIPv6Address": "",
            "LinkLocalIPv6PrefixLen": 0,
            "Ports": {
                "3306/tcp": null
            },
            ...
            "Networks": {
                "facilmap_default": {
                    "IPAMConfig": null,
                    "Links": null,
                    "Aliases": [
                        "db",
                        "3159e772ad01"
                    ],
                    ...
                    "Gateway": "172.28.0.1",
                    "IPAddress": "172.28.0.2",

Since the error I was having previously was: facilmap_1 | "Access denied for user 'facilmap'@'172.28.0.3' (using password: YES)" } } I could imagine that there is a problem of IP.

But where is the IP configured?

I wonder if it could be related to having another mariadb running in another container totally unrelated (it's another app I installed). But they shouldn't be able to interfere with each other.

eauchat commented 5 years ago

I tried again to remove the directory /srv/data/facilmap/ and then running docker-compose rm -s. And restart.

I noted this output at first that seemed maybe to show something going wrong with IP 172.28.0.2

db_1        | Initializing database
facilmap_1  |        at Function.Module._load (internal/modules/cjs/loader.js:552:3)
facilmap_1  |        at Function.Module.runMain (internal/modules/cjs/loader.js:774:12)
facilmap_1  |        at executeUserCode (internal/bootstrap/node.js:342:17)
facilmap_1  |        at startExecution (internal/bootstrap/node.js:276:5)
facilmap_1  |        at startup (internal/bootstrap/node.js:227:5)
facilmap_1  |        at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
facilmap_1  |      errno: 'ECONNREFUSED',
facilmap_1  |      code: 'ECONNREFUSED',
facilmap_1  |      syscall: 'connect',
facilmap_1  |      address: '172.28.0.2',
facilmap_1  |      port: 3306,
facilmap_1  |      fatal: true } }
facilmap_1  | error Command failed with exit code 1.

After a while (couple of automatic restarting attempt), it gives the following (I join the full output of this error at the end of this comment):

facilmap_1  |      code: 'ER_HOST_NOT_PRIVILEGED',
facilmap_1  |      errno: 1130,
facilmap_1  |      sqlState: '',
facilmap_1  |      sqlMessage:
facilmap_1  |       "Host '172.28.0.3' is not allowed to connect to this MariaDB server" } }
facilmap_1  | error Command failed with exit code 1.

It seems again to be trying on 172.28.0.3 but I checked again and docker inspect facilmap_db_1 still returns the same as in previous comment.

facilmap_1  | $ node ./server.js
facilmap_1  | warning Cannot find a suitable global folder. Tried these: "/usr/local, /opt/facilmap/.yarn"
facilmap_1  | Downloading maxmind database
facilmap_1  | { SequelizeConnectionError: Host '172.28.0.3' is not allowed to connect to this MariaDB server
facilmap_1  |     at Utils.Promise.tap.then.catch.err (/opt/facilmap/server/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:149:19)
facilmap_1  | From previous event:
facilmap_1  |     at ConnectionManager.connect (/opt/facilmap/server/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:136:13)
facilmap_1  |     at sequelize.runHooks.then (/opt/facilmap/server/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:320:50)
facilmap_1  |     at processImmediate (timers.js:632:19)
facilmap_1  |     at process.topLevelDomainCallback (domain.js:120:23)
facilmap_1  | From previous event:
facilmap_1  |     at ConnectionManager._connect (/opt/facilmap/server/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:320:8)
facilmap_1  |     at ConnectionManager.getConnection (/opt/facilmap/server/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:250:46)
facilmap_1  |     at Promise.try (/opt/facilmap/server/node_modules/sequelize/lib/sequelize.js:554:34)
facilmap_1  | From previous event:
facilmap_1  |     at Promise.resolve.retryParameters (/opt/facilmap/server/node_modules/sequelize/lib/sequelize.js:454:64)
facilmap_1  |     at /opt/facilmap/server/node_modules/retry-as-promised/index.js:39:21
facilmap_1  |     at retryAsPromised (/opt/facilmap/server/node_modules/retry-as-promised/index.js:29:10)
facilmap_1  |     at Sequelize.query (/opt/facilmap/server/node_modules/sequelize/lib/sequelize.js:454:28)
facilmap_1  |     at Sequelize.authenticate (/opt/facilmap/server/node_modules/sequelize/lib/sequelize.js:783:17)
facilmap_1  |     at Database.connect (/opt/facilmap/server/database/database.js:32:21)
facilmap_1  |     at Object.<anonymous> (/opt/facilmap/server/server.js:62:28)
facilmap_1  |     at Module._compile (internal/modules/cjs/loader.js:721:30)
facilmap_1  |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10)
facilmap_1  |     at Module.load (internal/modules/cjs/loader.js:620:32)
facilmap_1  |     at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
facilmap_1  |     at Function.Module._load (internal/modules/cjs/loader.js:552:3)
facilmap_1  |     at Function.Module.runMain (internal/modules/cjs/loader.js:774:12)
facilmap_1  |     at executeUserCode (internal/bootstrap/node.js:342:17)
facilmap_1  |     at startExecution (internal/bootstrap/node.js:276:5)
facilmap_1  |     at startup (internal/bootstrap/node.js:227:5)
facilmap_1  |     at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
facilmap_1  |   name: 'SequelizeConnectionError',
facilmap_1  |   parent:
facilmap_1  |    { Error: Host '172.28.0.3' is not allowed to connect to this MariaDB server
facilmap_1  |        at Packet.asError (/opt/facilmap/server/node_modules/mysql2/lib/packets/packet.js:684:17)
facilmap_1  |        at ClientHandshake.execute (/opt/facilmap/server/node_modules/mysql2/lib/commands/command.js:28:26)
facilmap_1  |        at Connection.handlePacket (/opt/facilmap/server/node_modules/mysql2/lib/connection.js:455:32)
facilmap_1  |        at PacketParser.onPacket (/opt/facilmap/server/node_modules/mysql2/lib/connection.js:73:18)
facilmap_1  |        at PacketParser.executeStart (/opt/facilmap/server/node_modules/mysql2/lib/packet_parser.js:75:16)
facilmap_1  |        at Socket.<anonymous> (/opt/facilmap/server/node_modules/mysql2/lib/connection.js:80:31)
facilmap_1  |        at Socket.emit (events.js:189:13)
facilmap_1  |        at Socket.EventEmitter.emit (domain.js:441:20)
facilmap_1  |        at addChunk (_stream_readable.js:288:12)
facilmap_1  |        at readableAddChunk (_stream_readable.js:269:11)
facilmap_1  |        at Socket.Readable.push (_stream_readable.js:224:10)
facilmap_1  |        at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:145:17)
facilmap_1  |    From previous event:
facilmap_1  |        at ConnectionManager.connect (/opt/facilmap/server/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:92:12)
facilmap_1  |        at sequelize.runHooks.then (/opt/facilmap/server/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:320:50)
facilmap_1  |        at processImmediate (timers.js:632:19)
facilmap_1  |        at process.topLevelDomainCallback (domain.js:120:23)
facilmap_1  |    From previous event:
facilmap_1  |        at ConnectionManager._connect (/opt/facilmap/server/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:320:8)
facilmap_1  |        at ConnectionManager.getConnection (/opt/facilmap/server/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:250:46)
facilmap_1  |        at Promise.try (/opt/facilmap/server/node_modules/sequelize/lib/sequelize.js:554:34)
facilmap_1  |    From previous event:
facilmap_1  |        at Promise.resolve.retryParameters (/opt/facilmap/server/node_modules/sequelize/lib/sequelize.js:454:64)
facilmap_1  |        at /opt/facilmap/server/node_modules/retry-as-promised/index.js:39:21
facilmap_1  |        at retryAsPromised (/opt/facilmap/server/node_modules/retry-as-promised/index.js:29:10)
facilmap_1  |        at Sequelize.query (/opt/facilmap/server/node_modules/sequelize/lib/sequelize.js:454:28)
facilmap_1  |        at Sequelize.authenticate (/opt/facilmap/server/node_modules/sequelize/lib/sequelize.js:783:17)
facilmap_1  |        at Database.connect (/opt/facilmap/server/database/database.js:32:21)
facilmap_1  |        at Object.<anonymous> (/opt/facilmap/server/server.js:62:28)
facilmap_1  |        at Module._compile (internal/modules/cjs/loader.js:721:30)
facilmap_1  |        at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10)
facilmap_1  |        at Module.load (internal/modules/cjs/loader.js:620:32)
facilmap_1  |        at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
facilmap_1  |        at Function.Module._load (internal/modules/cjs/loader.js:552:3)
facilmap_1  |        at Function.Module.runMain (internal/modules/cjs/loader.js:774:12)
facilmap_1  |        at executeUserCode (internal/bootstrap/node.js:342:17)
facilmap_1  |        at startExecution (internal/bootstrap/node.js:276:5)
facilmap_1  |        at startup (internal/bootstrap/node.js:227:5)
facilmap_1  |        at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
facilmap_1  |      code: 'ER_HOST_NOT_PRIVILEGED',
facilmap_1  |      errno: 1130,
facilmap_1  |      sqlState: '',
facilmap_1  |      sqlMessage:
facilmap_1  |       "Host '172.28.0.3' is not allowed to connect to this MariaDB server" },
facilmap_1  |   original:
facilmap_1  |    { Error: Host '172.28.0.3' is not allowed to connect to this MariaDB server
facilmap_1  |        at Packet.asError (/opt/facilmap/server/node_modules/mysql2/lib/packets/packet.js:684:17)
facilmap_1  |        at ClientHandshake.execute (/opt/facilmap/server/node_modules/mysql2/lib/commands/command.js:28:26)
facilmap_1  |        at Connection.handlePacket (/opt/facilmap/server/node_modules/mysql2/lib/connection.js:455:32)
facilmap_1  |        at PacketParser.onPacket (/opt/facilmap/server/node_modules/mysql2/lib/connection.js:73:18)
facilmap_1  |        at PacketParser.executeStart (/opt/facilmap/server/node_modules/mysql2/lib/packet_parser.js:75:16)
facilmap_1  |        at Socket.<anonymous> (/opt/facilmap/server/node_modules/mysql2/lib/connection.js:80:31)
facilmap_1  |        at Socket.emit (events.js:189:13)
facilmap_1  |        at Socket.EventEmitter.emit (domain.js:441:20)
facilmap_1  |        at addChunk (_stream_readable.js:288:12)
facilmap_1  |        at readableAddChunk (_stream_readable.js:269:11)
facilmap_1  |        at Socket.Readable.push (_stream_readable.js:224:10)
facilmap_1  |        at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:145:17)
facilmap_1  |    From previous event:
facilmap_1  |        at ConnectionManager.connect (/opt/facilmap/server/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:92:12)
facilmap_1  |        at sequelize.runHooks.then (/opt/facilmap/server/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:320:50)
facilmap_1  |        at processImmediate (timers.js:632:19)
facilmap_1  |        at process.topLevelDomainCallback (domain.js:120:23)
facilmap_1  |    From previous event:
facilmap_1  |        at ConnectionManager._connect (/opt/facilmap/server/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:320:8)
facilmap_1  |        at ConnectionManager.getConnection (/opt/facilmap/server/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:250:46)
facilmap_1  |        at Promise.try (/opt/facilmap/server/node_modules/sequelize/lib/sequelize.js:554:34)
facilmap_1  |    From previous event:
facilmap_1  |        at Promise.resolve.retryParameters (/opt/facilmap/server/node_modules/sequelize/lib/sequelize.js:454:64)
facilmap_1  |        at /opt/facilmap/server/node_modules/retry-as-promised/index.js:39:21
facilmap_1  |        at retryAsPromised (/opt/facilmap/server/node_modules/retry-as-promised/index.js:29:10)
facilmap_1  |        at Sequelize.query (/opt/facilmap/server/node_modules/sequelize/lib/sequelize.js:454:28)
facilmap_1  |        at Sequelize.authenticate (/opt/facilmap/server/node_modules/sequelize/lib/sequelize.js:783:17)
facilmap_1  |        at Database.connect (/opt/facilmap/server/database/database.js:32:21)
facilmap_1  |        at Object.<anonymous> (/opt/facilmap/server/server.js:62:28)
facilmap_1  |        at Module._compile (internal/modules/cjs/loader.js:721:30)
facilmap_1  |        at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10)
facilmap_1  |        at Module.load (internal/modules/cjs/loader.js:620:32)
facilmap_1  |        at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
facilmap_1  |        at Function.Module._load (internal/modules/cjs/loader.js:552:3)
facilmap_1  |        at Function.Module.runMain (internal/modules/cjs/loader.js:774:12)
facilmap_1  |        at executeUserCode (internal/bootstrap/node.js:342:17)
facilmap_1  |        at startExecution (internal/bootstrap/node.js:276:5)
facilmap_1  |        at startup (internal/bootstrap/node.js:227:5)
facilmap_1  |        at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
facilmap_1  |      code: 'ER_HOST_NOT_PRIVILEGED',
facilmap_1  |      errno: 1130,
facilmap_1  |      sqlState: '',
facilmap_1  |      sqlMessage:
facilmap_1  |       "Host '172.28.0.3' is not allowed to connect to this MariaDB server" } }
facilmap_1  | error Command failed with exit code 1.
facilmap_1  | info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
facilmap_1  | yarn run v1.13.0
facilmap_1  | warning Skipping preferred cache folder "/opt/facilmap/.cache/yarn" because it is not writable.
facilmap_1  | warning Selected the next writable cache folder in the list, will be "/tmp/.yarn-cache-1001".
facilmap_1  | $ node ./server.js
facilmap_1  | warning Cannot find a suitable global folder. Tried these: "/usr/local, /opt/facilmap/.yarn"
facilmap_1  | Downloading maxmind database
facilmap_1  | { SequelizeConnectionError: Host '172.28.0.3' is not allowed to connect to this MariaDB server
facilmap_1  |     at Utils.Promise.tap.then.catch.err (/opt/facilmap/server/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:149:19)
facilmap_1  | From previous event:
facilmap_1  |     at ConnectionManager.connect (/opt/facilmap/server/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:136:13)
facilmap_1  |     at sequelize.runHooks.then (/opt/facilmap/server/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:320:50)
facilmap_1  |     at processImmediate (timers.js:632:19)
facilmap_1  |     at process.topLevelDomainCallback (domain.js:120:23)
facilmap_1  | From previous event:
facilmap_1  |     at ConnectionManager._connect (/opt/facilmap/server/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:320:8)
facilmap_1  |     at ConnectionManager.getConnection (/opt/facilmap/server/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:250:46)
facilmap_1  |     at Promise.try (/opt/facilmap/server/node_modules/sequelize/lib/sequelize.js:554:34)
facilmap_1  | From previous event:
facilmap_1  |     at Promise.resolve.retryParameters (/opt/facilmap/server/node_modules/sequelize/lib/sequelize.js:454:64)
facilmap_1  |     at /opt/facilmap/server/node_modules/retry-as-promised/index.js:39:21
facilmap_1  |     at retryAsPromised (/opt/facilmap/server/node_modules/retry-as-promised/index.js:29:10)
facilmap_1  |     at Sequelize.query (/opt/facilmap/server/node_modules/sequelize/lib/sequelize.js:454:28)
facilmap_1  |     at Sequelize.authenticate (/opt/facilmap/server/node_modules/sequelize/lib/sequelize.js:783:17)
facilmap_1  |     at Database.connect (/opt/facilmap/server/database/database.js:32:21)
facilmap_1  |     at Object.<anonymous> (/opt/facilmap/server/server.js:62:28)
facilmap_1  |     at Module._compile (internal/modules/cjs/loader.js:721:30)
facilmap_1  |     at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10)
facilmap_1  |     at Module.load (internal/modules/cjs/loader.js:620:32)
facilmap_1  |     at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
facilmap_1  |     at Function.Module._load (internal/modules/cjs/loader.js:552:3)
facilmap_1  |     at Function.Module.runMain (internal/modules/cjs/loader.js:774:12)
facilmap_1  |     at executeUserCode (internal/bootstrap/node.js:342:17)
facilmap_1  |     at startExecution (internal/bootstrap/node.js:276:5)
facilmap_1  |     at startup (internal/bootstrap/node.js:227:5)
facilmap_1  |     at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
facilmap_1  |   name: 'SequelizeConnectionError',
facilmap_1  |   parent:
facilmap_1  |    { Error: Host '172.28.0.3' is not allowed to connect to this MariaDB server
facilmap_1  |        at Packet.asError (/opt/facilmap/server/node_modules/mysql2/lib/packets/packet.js:684:17)
facilmap_1  |        at ClientHandshake.execute (/opt/facilmap/server/node_modules/mysql2/lib/commands/command.js:28:26)
facilmap_1  |        at Connection.handlePacket (/opt/facilmap/server/node_modules/mysql2/lib/connection.js:455:32)
facilmap_1  |        at PacketParser.onPacket (/opt/facilmap/server/node_modules/mysql2/lib/connection.js:73:18)
facilmap_1  |        at PacketParser.executeStart (/opt/facilmap/server/node_modules/mysql2/lib/packet_parser.js:75:16)
facilmap_1  |        at Socket.<anonymous> (/opt/facilmap/server/node_modules/mysql2/lib/connection.js:80:31)
facilmap_1  |        at Socket.emit (events.js:189:13)
facilmap_1  |        at Socket.EventEmitter.emit (domain.js:441:20)
facilmap_1  |        at addChunk (_stream_readable.js:288:12)
facilmap_1  |        at readableAddChunk (_stream_readable.js:269:11)
facilmap_1  |        at Socket.Readable.push (_stream_readable.js:224:10)
facilmap_1  |        at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:145:17)
facilmap_1  |    From previous event:
facilmap_1  |        at ConnectionManager.connect (/opt/facilmap/server/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:92:12)
facilmap_1  |        at sequelize.runHooks.then (/opt/facilmap/server/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:320:50)
facilmap_1  |        at processImmediate (timers.js:632:19)
facilmap_1  |        at process.topLevelDomainCallback (domain.js:120:23)
facilmap_1  |    From previous event:
facilmap_1  |        at ConnectionManager._connect (/opt/facilmap/server/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:320:8)
facilmap_1  |        at ConnectionManager.getConnection (/opt/facilmap/server/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:250:46)
facilmap_1  |        at Promise.try (/opt/facilmap/server/node_modules/sequelize/lib/sequelize.js:554:34)
facilmap_1  |    From previous event:
facilmap_1  |        at Promise.resolve.retryParameters (/opt/facilmap/server/node_modules/sequelize/lib/sequelize.js:454:64)
facilmap_1  |        at /opt/facilmap/server/node_modules/retry-as-promised/index.js:39:21
facilmap_1  |        at retryAsPromised (/opt/facilmap/server/node_modules/retry-as-promised/index.js:29:10)
facilmap_1  |        at Sequelize.query (/opt/facilmap/server/node_modules/sequelize/lib/sequelize.js:454:28)
facilmap_1  |        at Sequelize.authenticate (/opt/facilmap/server/node_modules/sequelize/lib/sequelize.js:783:17)
facilmap_1  |        at Database.connect (/opt/facilmap/server/database/database.js:32:21)
facilmap_1  |        at Object.<anonymous> (/opt/facilmap/server/server.js:62:28)
facilmap_1  |        at Module._compile (internal/modules/cjs/loader.js:721:30)
facilmap_1  |        at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10)
facilmap_1  |        at Module.load (internal/modules/cjs/loader.js:620:32)
facilmap_1  |        at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
facilmap_1  |        at Function.Module._load (internal/modules/cjs/loader.js:552:3)
facilmap_1  |        at Function.Module.runMain (internal/modules/cjs/loader.js:774:12)
facilmap_1  |        at executeUserCode (internal/bootstrap/node.js:342:17)
facilmap_1  |        at startExecution (internal/bootstrap/node.js:276:5)
facilmap_1  |        at startup (internal/bootstrap/node.js:227:5)
facilmap_1  |        at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
facilmap_1  |      code: 'ER_HOST_NOT_PRIVILEGED',
facilmap_1  |      errno: 1130,
facilmap_1  |      sqlState: '',
facilmap_1  |      sqlMessage:
facilmap_1  |       "Host '172.28.0.3' is not allowed to connect to this MariaDB server" },
facilmap_1  |   original:
facilmap_1  |    { Error: Host '172.28.0.3' is not allowed to connect to this MariaDB server
facilmap_1  |        at Packet.asError (/opt/facilmap/server/node_modules/mysql2/lib/packets/packet.js:684:17)
facilmap_1  |        at ClientHandshake.execute (/opt/facilmap/server/node_modules/mysql2/lib/commands/command.js:28:26)
facilmap_1  |        at Connection.handlePacket (/opt/facilmap/server/node_modules/mysql2/lib/connection.js:455:32)
facilmap_1  |        at PacketParser.onPacket (/opt/facilmap/server/node_modules/mysql2/lib/connection.js:73:18)
facilmap_1  |        at PacketParser.executeStart (/opt/facilmap/server/node_modules/mysql2/lib/packet_parser.js:75:16)
facilmap_1  |        at Socket.<anonymous> (/opt/facilmap/server/node_modules/mysql2/lib/connection.js:80:31)
facilmap_1  |        at Socket.emit (events.js:189:13)
facilmap_1  |        at Socket.EventEmitter.emit (domain.js:441:20)
facilmap_1  |        at addChunk (_stream_readable.js:288:12)
facilmap_1  |        at readableAddChunk (_stream_readable.js:269:11)
facilmap_1  |        at Socket.Readable.push (_stream_readable.js:224:10)
facilmap_1  |        at TCP.onStreamRead [as onread] (internal/stream_base_commons.js:145:17)
facilmap_1  |    From previous event:
facilmap_1  |        at ConnectionManager.connect (/opt/facilmap/server/node_modules/sequelize/lib/dialects/mysql/connection-manager.js:92:12)
facilmap_1  |        at sequelize.runHooks.then (/opt/facilmap/server/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:320:50)
facilmap_1  |        at processImmediate (timers.js:632:19)
facilmap_1  |        at process.topLevelDomainCallback (domain.js:120:23)
facilmap_1  |    From previous event:
facilmap_1  |        at ConnectionManager._connect (/opt/facilmap/server/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:320:8)
facilmap_1  |        at ConnectionManager.getConnection (/opt/facilmap/server/node_modules/sequelize/lib/dialects/abstract/connection-manager.js:250:46)
facilmap_1  |        at Promise.try (/opt/facilmap/server/node_modules/sequelize/lib/sequelize.js:554:34)
facilmap_1  |    From previous event:
facilmap_1  |        at Promise.resolve.retryParameters (/opt/facilmap/server/node_modules/sequelize/lib/sequelize.js:454:64)
facilmap_1  |        at /opt/facilmap/server/node_modules/retry-as-promised/index.js:39:21
facilmap_1  |        at retryAsPromised (/opt/facilmap/server/node_modules/retry-as-promised/index.js:29:10)
facilmap_1  |        at Sequelize.query (/opt/facilmap/server/node_modules/sequelize/lib/sequelize.js:454:28)
facilmap_1  |        at Sequelize.authenticate (/opt/facilmap/server/node_modules/sequelize/lib/sequelize.js:783:17)
facilmap_1  |        at Database.connect (/opt/facilmap/server/database/database.js:32:21)
facilmap_1  |        at Object.<anonymous> (/opt/facilmap/server/server.js:62:28)
facilmap_1  |        at Module._compile (internal/modules/cjs/loader.js:721:30)
facilmap_1  |        at Object.Module._extensions..js (internal/modules/cjs/loader.js:732:10)
facilmap_1  |        at Module.load (internal/modules/cjs/loader.js:620:32)
facilmap_1  |        at tryModuleLoad (internal/modules/cjs/loader.js:560:12)
facilmap_1  |        at Function.Module._load (internal/modules/cjs/loader.js:552:3)
facilmap_1  |        at Function.Module.runMain (internal/modules/cjs/loader.js:774:12)
facilmap_1  |        at executeUserCode (internal/bootstrap/node.js:342:17)
facilmap_1  |        at startExecution (internal/bootstrap/node.js:276:5)
facilmap_1  |        at startup (internal/bootstrap/node.js:227:5)
facilmap_1  |        at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
facilmap_1  |      code: 'ER_HOST_NOT_PRIVILEGED',
facilmap_1  |      errno: 1130,
facilmap_1  |      sqlState: '',
facilmap_1  |      sqlMessage:
facilmap_1  |       "Host '172.28.0.3' is not allowed to connect to this MariaDB server" } }
facilmap_1  | error Command failed with exit code 1.
cdauth commented 5 years ago

It seems really odd to me. I suspect that somehow something didn't get deleted when you tried to recreate the containers. Please try the following steps, in this order:

  1. Delete the containers: docker-compose rm -fs
  2. Verify that there are no more facilmap-related containers running: docker ps -a. Otherwise, remove those containers using docker rm.
  3. Verify that there are no more containers in the facilmap network: docker network inspect facilmap_default (under "Containers":, nothing should be listed)
  4. Remove the data directory: rm -rf /srv/data/facilmap
eauchat commented 5 years ago

Hey, thank you for taking the time to answer. So I did what you said exactly, and... well it worked! Not so sure why though, it's almost what I had done previously. The only difference I can see with what I had done a couple times before, is that I hadn't used -f option when removing the container, and I might have removed data directory before, but I had checked that it didn't exist before recreating the container.

There's one other thing that I changed when trying again this time, I modified the db password to make it contain more simple characters. I wonder if that could also be related.

Anyway, the facilmap server seem to be running all fine now and that's pretty cool :) Thanks for all your great work!!!

cdauth commented 5 years ago

I would say that you should always remove the data directory after removing the container. Not sure what's going on there internally, the way that volumes work can be a bit mysterious sometimes.