-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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
"user_favorite_tag" table not created after "superset db upgrade" when upgrade superset 3.0.1 to 4.0.2 on docker #29836
Comments
Hey @jinmengcheng! I'm here to help you with any bugs, questions, or contributions you may have regarding the Superset upgrade. Let's work together to solve this issue! To resolve the issue of the
The def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table(
"user_favorite_tag",
sa.Column("user_id", sa.Integer(), nullable=False),
sa.Column("tag_id", sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(
["tag_id"],
["tag.id"],
),
sa.ForeignKeyConstraint(
["user_id"],
["ab_user.id"],
),
)
# ### end Alembic commands ### Additionally, ensure that the user_favorite_tag_table = Table(
"user_favorite_tag",
Model.metadata, # pylint: disable=no-member
Column("user_id", Integer, ForeignKey("ab_user.id")),
Column("tag_id", Integer, ForeignKey("tag.id")),
) If the table is still not created, ensure that there are no errors in the migration script and that the database connection is properly configured [1][2][3]. |
Anyone can help on this issue? |
Having the exact same issue with a Superset instance deployed in k8s via helm chart. |
I do believe @michael-s-molina / @mistercrunch / @eschutho are looking at migration issues a bit, in case they spot anything here that can be resolved systemically. |
thanks @rusackas , waiting for good news. |
@ruifpedro I am also running superset on K8S via helm chart, upgrading superset on K8S is not a happy thing |
Note that when |
Hi @mistercrunch thanks for help on chekcing the db upgrade issue, below is a log list showing full logs of my superset_init job when I running "TAG=4.0.2 docker compose -f docker-compose-non-dev.yml up" command line to launch superset via docker, from the log seems everything worked fine, from the screenshot(docker-init.sh), step 1 applying DB migration will run "superset db upgrade" command
|
Looks like migrations are up to date here. Maybe you're hitting another instance of the app that's on a different/earlier version - some zombie process? Hard to tell, but you should be able troubleshoot that. |
@mistercrunch if I change a newly created database, "user_favorite_tag" will make, but migration from an old DB(3.0.1), the table missed, it's very easy to reproduce if we launch superset from helm docker, I thought it's a migration issue. Anyway, is there any command line or any tools can help fix this issue rather than manually create the table? |
From inside the box that's running superset, run
|
Hi @mistercrunch thanks for your reply and sorry reply late here due some personal businesses, I checked superset db current, it's pointing the head please see screenshot on "superset db current" and "superset db history" command line.
|
Oh that's like if you had some sort of zombie process or pod that would happen to be serving the new version of the app against some other/older version of the database. Could happen if you're juggling with multiple instances of the app or the database and have zombie processes or deployments lying around. I guess you could stop all processes, confirm you get no responses at all, and then restarting the app, and make sure it's pointing to the right / upgraded database. |
@mistercrunch zombie process or zombie docker pod would not happened in my case, each time I will stop docker by running "docker compose down" command to stop all pods and double check by running "docker ps" to check if there are alive or zombie docker pods |
I'm kind of clueless on my side at this point. Don't have any idea other than suggesting to go back and double check assumptions one-by-one.
|
Bug description
Hi Superset developers:
I am trying to upgrade superset 3.0.1 to 4.0.2, main features looks good so far, but there is a small problem when I am trying to use Tag system, please check the screenshot as attached, favorite tag feature seems not available, after check log, error trace shows "user_favorite_tag" table not exists, it seems "superset db upgrade" not patched revision "e0f6f91c2055" to DB, but the "superset db history" shows "e0f6f91c2055" has been applied, would you please take a look?
ENV:
Docker
MacOS/Safari
superset version: 3.0.1 -> 4.0.2
[SQL: SELECT user_favorite_tag.tag_id AS user_favorite_tag_tag_id
FROM user_favorite_tag
WHERE user_favorite_tag.tag_id IN (%(tag_id_1_1)s, %(tag_id_1_2)s, %(tag_id_1_3)s, %(tag_id_1_4)s, %(tag_id_1_5)s) AND user_favorite_tag.user_id = %(user_id_1)s]
How to reproduce the bug
Screenshots/recordings
No response
Superset version
4.0.2
Python version
3.9
Node version
16
Browser
Chrome
Additional context
No response
Checklist
The text was updated successfully, but these errors were encountered: