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

Issue with --create-database argument #62

Open
Leiyiliro opened this issue Apr 18, 2023 · 0 comments
Open

Issue with --create-database argument #62

Leiyiliro opened this issue Apr 18, 2023 · 0 comments

Comments

@Leiyiliro
Copy link

Leiyiliro commented Apr 18, 2023

I am trying to run the mbslave init --create-database

The code here:

def create_database(config: Config) -> None:

seems to try to connect to the "musicbrainz" database before it is created, and I get the error FATAL: database "musicbrainz" does not exist:
image

Traceback (most recent call last):
  File "/usr/local/bin/mbslave", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/local/lib/python3.11/site-packages/mbdata/replication.py", line 803, in main
    args.func(config, args)
  File "/usr/local/lib/python3.11/site-packages/mbdata/replication.py", line 625, in mbslave_init_main
    create_database(config)
  File "/usr/local/lib/python3.11/site-packages/mbdata/replication.py", line 583, in create_database
    db = connect_db(config, superuser=True, no_db=True)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/mbdata/replication.py", line 209, in connect_db
    return cfg.connect_db(set_search_path=set_search_path, superuser=superuser, no_db=no_db)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/mbdata/replication.py", line 202, in connect_db
    db = psycopg2.connect(**self.database.create_psycopg2_kwargs(superuser=superuser, no_db=no_db))
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/psycopg2/__init__.py", line 122, in connect
    conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
psycopg2.OperationalError: FATAL:  database "musicbrainz" does not exist
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

1 participant