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

Invalid database url #1511

Open
David-Lor opened this issue Jan 6, 2024 · 4 comments
Open

Invalid database url #1511

David-Lor opened this issue Jan 6, 2024 · 4 comments

Comments

@David-Lor
Copy link

David-Lor commented Jan 6, 2024

Hello there,

I'm trying to run a syncstorage server in Docker, but I'm receiving this error when the server starts:

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: ApiError { kind: Db(DbError { kind: Common(SyncstorageDbError { kind: Internal("Invalid database url: mysql://syncserver:****@mozillasync_syncstorage_db:3306/syncstorage"), status: 500, backtrace:    0: <syncstorage_db_common::error::SyncstorageDbError as core::convert::From<syncstorage_db_common::error::SyncstorageDbErrorKind>>::from

Where **** is my user password, and it only contains upper/lower letters and numbers, no special characters or symbols. I've tried with and without specifying the port.

The database credentials and connection details are correct, as I can connect to it from other container:

bash-4.4# mysql -u syncserver -p'****' -h mozillasync_syncstorage_db -P 3306 -D syncstorage
mysql: [Warning] Using a password on the command line interface can be insecure.
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 10
Server version: 8.2.0 MySQL Community Server - GPL

Copyright (c) 2000, 2023, Oracle and/or its affiliates.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> use syncstorage;
Database changed

mysql> create table foo(id int primary key);
Query OK, 0 rows affected (0.43 sec)

mysql> drop table foo;
Query OK, 0 rows affected (1.79 sec)

Judging by the error Invalid database url, it would seem my URI is incorrect, but I don't see structural differences with the example provided here.

This is my dockercompose:

version: "3.4"

services:
  syncstorage:
    image: mozilla/syncstorage-rs:0.14.4
    volumes:
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    environment:
      SYNC_HOST: 0.0.0.0
      SYNC_MASTER_SECRET: ***
      SYNC_SYNCSTORAGE__DATABASE_URL: mysql://syncserver:***@syncstorage_db:3306/syncstorage
      SYNC_TOKENSERVER__DATABASE_URL: mysql://syncserver:***@syncstorage_db:3306/tokenserver
      SYNC_TOKENSERVER__RUN_MIGRATIONS: "true"
    depends_on:
      - syncstorage_db
    networks:
      - backend

  syncstorage_db:
    image: mysql:8.2.0
    volumes:
      - /home/docker/volumes/mozillasync_syncstorage_mysql_data:/var/lib/mysql
      - ./initdb.sql:/docker-entrypoint-initdb.d/1-syncserver-initdb.sql:ro
      - /etc/timezone:/etc/timezone:ro
      - /etc/localtime:/etc/localtime:ro
    environment:
      MYSQL_ROOT_PASSWORD: ***
      MYSQL_DATABASE: root
      MYSQL_USER: syncserver
      MYSQL_PASSWORD: ***
    networks:
      - backend

networks:
  backend:
    external:
      name: backend-overlay

┆Issue is synchronized with this Jira Task

@jackyzy823
Copy link

See #1495 and #1482

@WAdama
Copy link

WAdama commented Jan 8, 2024

At the moment you have to use version 0.13.7 for use with mysql/mariadb. This still works...

@azoller1
Copy link

azoller1 commented Feb 3, 2024

I still cant get past this invalid URL error even with version 0.13.7. Using similar compose file as referenced earlier in this thread

@jrconlin
Copy link
Member

jrconlin commented Feb 5, 2024

The error [is generated] in syncstorage-spanner, which indicates that sync believes you are using spanner for this. syncstorage-settings presumes you're using spanner if the database URL begins with spanner:// The default for this is set to mysql://root..., so you may have either an environment variable like SYNC_STORAGE__DATABASE_URL="spanner://..." (or if you're using a --config file database_url = "spanner://...")

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

5 participants