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

tokenserver Database Tables don't get populated #1450

Open
simpz opened this issue Jan 4, 2023 · 5 comments
Open

tokenserver Database Tables don't get populated #1450

simpz opened this issue Jan 4, 2023 · 5 comments

Comments

@simpz
Copy link

simpz commented Jan 4, 2023

Unless I've missed something in the documentation.

The Tokenserver Database tables don't get created unless you have:

tokenserver.run_migrations = true

set in the config file.

So the method needed to populate the tokenserver database fails:

INSERT IGNORE INTO services (id, service, pattern) VALUES ('1', 'sync-1.5', '{node}/1.5/{uid}');
INSERT INTO nodes (id, service, node, available, current_load, capacity, downed, backoff)
VALUES ('1', '1', '${DOMAIN}', '1', '0', '1', '0', '0') ON DUPLICATE KEY UPDATE node='${DOMAIN}';"

I notice,

tokenserver.run_migrations = true
is set in the docker compose yaml files. so this issue is known?

Either the option is confusingly named or this requirement should be documented.

Spent ages trying to figure out why my build of syncserver-rs wasn't working and never setting up the tokenserver db.

┆Issue is synchronized with this Jira Task

@jonasled
Copy link

I had the same problem, you use the latest tag for the docker image, which hasn't been updated for 2 years (see #1362) If you use the 0.13.2 tag everything should work.

@ictabc
Copy link

ictabc commented Feb 13, 2023

Dropped my tables, because I still can't get things working.

Set my docker image to 0.13.2, and restarted syncstorage-rs, tables get filled but not the services and nodes tables.

So it's either not fixed, or I still miss config items for my docker container.

@jonasled
Copy link

You can compare your compose file with mine, maybe it helps:

version: "3.2"

services:
  syncserver:
    image: mozilla/syncstorage-rs:0.13.2
    restart: always
    environment:
      SYNC_HOST: 0.0.0.0
      SYNC_MASTER_SECRET: MY_SECRET
      SYNC_SYNCSTORAGE__DATABASE_URL: "mysql://user:password@1.2.3.4:3306/storage"
      SYNC_RUN_MIGRATIONS: "true"

      SYNC_TOKENSERVER__ENABLED: "true"
      SYNC_TOKENSERVER__RUN_MIGRATIONS: "true"
      SYNC_TOKENSERVER__NODE_TYPE: mysql
      SYNC_TOKENSERVER__DATABASE_URL: "mysql://user:password@1.2.3.4:3306/token"
      SYNC_TOKENSERVER__FXA_EMAIL_DOMAIN: api.accounts.firefox.com
      SYNC_TOKENSERVER__FXA_OAUTH_SERVER_URL: https://oauth.accounts.firefox.com/v1
      SYNC_TOKENSERVER__FXA_METRICS_HASH_SECRET: MY_OTHER_SECRET
      SYNC_TOKENSERVER__ADDITIONAL_BLOCKING_THREADS_FOR_FXA_REQUESTS: 2

@ictabc
Copy link

ictabc commented Feb 13, 2023

Same settings, just doesn't fills the services and nodes table.

@ictabc
Copy link

ictabc commented Feb 13, 2023

The issue is that we don't configure anywhere what domain we use, so these can't be filled. Maybe services can be filled. But we also need the node, but that info isn't given as a variable in the docker settings. So I think this can't work at this time. We need to add an environment variable, for the nodes to be added. If that is fixed.

Re-did it manually again.

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