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

django db "duplicate column name" #345

Closed
davidancalagon opened this issue Feb 20, 2023 · 14 comments
Closed

django db "duplicate column name" #345

davidancalagon opened this issue Feb 20, 2023 · 14 comments

Comments

@davidancalagon
Copy link

Getting this issue when upgrading to the latest docker image:

2023-02-20 01:39:43.486762+00:00File "/usr/local/lib/python3.9/dist-packages/MySQLdb/connections.py", line 254, in query
2023-02-20 01:39:43.486780+00:00_mysql.connection.query(self, query)
2023-02-20 01:39:43.486796+00:00django.db.utils.OperationalError: (1060, "Duplicate column name 'embed_metadata'")
2023-02-20 01:39:43.654574+00:00s6-rc: warning: unable to start service tubesync-init: command exited 1

Seems to be doing a migration, and fails here every time at connections.py.

Any help is greatly appreciated.

@meeb
Copy link
Owner

meeb commented Feb 20, 2023

Odd. You can probably just drop the column and restart the container to fix this though. Something like:

ALTER TABLE sync_source DROP COLUMN embed_metadata;

and then immediately restart the container. Note this will reset all your sources to embed_metadata=False, but it should fix the issue you're experiencing.

If more people report this I'll investigate the issue further.

@davidancalagon
Copy link
Author

sync_media does not seem to have a column for embed_metadata; however, sync_source does. Dropping embed_metadata fixes that issue, but it then gives the same error regarding embed_thumbnail. Dropping that then causes an error with enable_sponsorblock. Once I drop all three of the aforementioned columns, I get the following:

2023-02-20 02:16:27.559061+00:00File "/usr/local/lib/python3.9/dist-packages/MySQLdb/connections.py", line 254, in query
2023-02-20 02:16:27.559210+00:00_mysql.connection.query(self, query)
2023-02-20 02:16:27.559232+00:00django.db.utils.OperationalError: (1074, "Column length too big for column 'sponsorblock_categories' (max = 255); use BLOB or TEXT instead")
2023-02-20 02:16:27.736331+00:00s6-rc: warning: unable to start service tubesync-init: command exited 1

@meeb
Copy link
Owner

meeb commented Feb 20, 2023

Ah right you are, sorry I pasted the wrong table name. I've edited the comment. As for the other issue I'll push a fix shortly.

@davidancalagon
Copy link
Author

Thanks very much, I appreciate the quick response!

@meeb
Copy link
Owner

meeb commented Feb 20, 2023

This should be fixed in :latest in 30 minutes or so once the image builds. Please test it then and let me know if this resolves your issue.

@davidancalagon
Copy link
Author

Pulled latest, now we have:

2023-02-20 03:40:18.000707+00:00File "/usr/local/lib/python3.9/dist-packages/MySQLdb/connections.py", line 254, in query
2023-02-20 03:40:18.000725+00:00_mysql.connection.query(self, query)
2023-02-20 03:40:18.000741+00:00django.db.utils.OperationalError: (4161, "Unknown data type: 'TextField'")
2023-02-20 03:40:18.174891+00:00s6-rc: warning: unable to start service tubesync-init: command exited 1

@davidkylenz
Copy link

davidkylenz commented Feb 20, 2023

I'm seeing the same issue using a mysql container and haven't touch the database schema:
django.db.utils.OperationalError: (1060, "Duplicate column name 'embed_metadata'")

@meeb
Copy link
Owner

meeb commented Feb 20, 2023

Thanks for the confirmation @davidkylenz .

@davidancalagon Just pushed another tweak, try :latest again once it's built.

@kuhnchris
Copy link
Contributor

Regarding the "duplicate column name" - did you guys use master on bare host or used the :latest docker tag?

@davidancalagon
Copy link
Author

I'm using :latest.

@davidancalagon
Copy link
Author

It appears the latest push fixed the issue. I thank you for all your hard work.

@meeb
Copy link
Owner

meeb commented Feb 21, 2023

@kuhnchris I'm guessing this only impacted people who use MySQL as a backend and also updated to the interim :latest between your two PRs being merged? If so this shouldn't impact anyone else.

@davidancalagon @davidkylenz you OK for this to be closed?

@davidancalagon
Copy link
Author

Yes, issue fully resolved on this end.

@davidkylenz
Copy link

Yep, all good.

@meeb meeb closed this as completed Feb 21, 2023
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

4 participants