Skip to content
This repository has been archived by the owner on Oct 25, 2023. It is now read-only.

Unexpected Exit? #890

Closed
FredeJ opened this issue Jan 21, 2021 · 3 comments
Closed

Unexpected Exit? #890

FredeJ opened this issue Jan 21, 2021 · 3 comments

Comments

@FredeJ
Copy link

FredeJ commented Jan 21, 2021

Hi,

I'm trying to run the dawa-replication-client in docker and I'm not seeing the success I was hoping for.

When running /usr/local/bin/dawa-replication-client replicate --database=postgresql://postgres:postgres@db:5432/postgres --replication-config my_config.json I get the following output:
info: Connecting to database using host=db, port=5432, database=postgres, user=postgres, password=<hidden>

Nothing is written to the database, as far as I can tell.

I tried adding a log statement after the try-catch block

 log('info', `Connecting to database using host=${host ? host : ''}, port=${port ? port : ''}, database=${database}, user=${user}, password=${password ? '<hidden>' : '(none)'}`);

    try {
      yield databasePools.create("pool", {
        connString: options['database'],
        pooled: false,
        noRetry: true
      });
    }
    catch(e) {
      log('error', `Failed to connect to database: ${e.message}`);
      process.exit(1);
    }
    log('info','test'); // Added by me

This log statement is never reached.

My configuration file looks like this:

 {
    "replication_url": "https://dawa.aws.dk/replikering",
    "replication_schema": "dawa_replication",
    "entities": [
         {
            "name": "postnummer",
            "attributes": [
              "nr",
              "navn"
            ]
          },
          {
            "name": "navngivenvej",
            "attributes": [
              "id",
              "navn",
              "adresseringsnavn",
              "administrerendekommune"
            ]
          },
          {
            "name": "kommune",
            "attributes": [
              "kode",
              "navn"
            ]
          },
          {
            "name": "adgangsadresse",
            "attributes": [
              "id",
              "kommunekode",
              "husnr",
              "supplerendebynavn",
              "postnr",
              "navngivenvej_id"
            ]
          },
          {
            "name": "adresse",
            "attributes": [
              "id",
              "adgangsadresseid",
              "etage",
              "dør"
            ]
          }
    ],
    "bindings": {
        "postnummer": {
            "table":"postnummer"
        },
        "navngivenvej": {
            "table":"navngivenvej"
        },
        "kommune": {
            "table":"kommune"
        },
        "adgangsadresse": {
            "table":"adgangsadresse"
        },
        "adresse": {
            "table":"adresse"
        }
    }
}

The database is running (and I would assume that I would get an error if it wasn't?).

If I try to run the following dockerfile:

from node
RUN npm install -g @dawadk/replication-client
WORKDIR /code
COPY my_config.json /code/
CMD ["/usr/local/bin/dawa-replication-client", "replicate", "--database=postgresql://postgres:postgres@db:5432/postgres", "--replication-config", "my_config.json"]

It just exits with code 0, after writing the above message. The example config from the webpage provides the same result. Any ideas what's going on? I would expect the replication client to just keep running and checking for updates?

@TheDukeDK
Copy link

I am seeing the exact same behavior :-(

@TheDukeDK
Copy link

Seems to be related the node version. Using node:12.21-stretch seems to work.

@andershessellund
Copy link
Contributor

I have released a new version 1.3.37, which should work with new node versions.

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

No branches or pull requests

3 participants