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

"musicbrainz.alternative_release_type" does not exist #35

Closed
agawronski opened this issue Nov 22, 2021 · 5 comments
Closed

"musicbrainz.alternative_release_type" does not exist #35

agawronski opened this issue Nov 22, 2021 · 5 comments

Comments

@agawronski
Copy link

~/ftp.musicbrainz.org/pub/musicbrainz/data/fullexport/20211120-001843$ mbslave import mbdump.tar.bz2 mbdump-derived.tar.bz2
Importing data from mbdump.tar.bz2

  • Loading alternative_release_type to musicbrainz.alternative_release_type
    Traceback (most recent call last):
    File "/home/ubuntu/.local/bin/mbslave", line 8, in
    sys.exit(main())
    File "/home/ubuntu/.local/lib/python3.8/site-packages/mbdata/replication.py", line 592, in main
    args.func(config, args)
    File "/home/ubuntu/.local/lib/python3.8/site-packages/mbdata/replication.py", line 253, in mbslave_import_main
    load_tar(filename, db, config, config.schemas.ignored_schemas, config.tables.ignored_tables)
    File "/home/ubuntu/.local/lib/python3.8/site-packages/mbdata/replication.py", line 245, in load_tar
    cursor.copy_from(tar.extractfile(member), fulltable)
    psycopg2.errors.UndefinedTable: relation "musicbrainz.alternative_release_type" does not exist

Seems to be related to the issue mentioned here:
https://community.metabrainz.org/t/database-replication-issue-with-mbdata-25-0-4/548110

@echoxxzz
Copy link

echoxxzz commented Jan 9, 2022

Same problem here.

If I just edit that line it's failing at and change:
cursor.copy_from(tar.extractfile(member), fulltable)
to:
cursor.copy_from(tar.extractfile(member), table)

it works now. I just cannot get the copy_from method to import into tables using "schema.table" naming scheme.

@echoxxzz
Copy link

psycopg/psycopg2#1294

Looks like there was a change to the psycopg2 module and you cannot pass the schema into the copy_from method anymore.
The suggestion is to use the copy_expert() method instead.

@lincoln017
Copy link

I downgraded my psycopg2 module from 2.9.3 to 2.8.5 and everything worked fine -- no other changes necessary,.

@BriantOliveira
Copy link

I downloaded psycopg2 2.8.5, and I'm still getting this issue :/

@ozturkberkay
Copy link

ozturkberkay commented Nov 19, 2022

Using copy_expert worked: cursor.copy_expert(f"COPY {fulltable} FROM STDIN", tar.extractfile(member)).
Beware of this error though...

@lalinsky lalinsky closed this as completed Dec 2, 2022
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

6 participants