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

Migration "Applying users.0008_flip_objectpermission_assignments" to 4.0-beta1 fails #15726

Closed
tobiasge opened this issue Apr 16, 2024 · 3 comments
Labels
status: duplicate This issue has already been raised type: bug A confirmed report of unexpected behavior in the application

Comments

@tobiasge
Copy link
Member

Deployment Type

Self-hosted

NetBox Version

v4.0-beta1 (4e4c277)

Python Version

3.11

Steps to Reproduce

  1. Netbox setup with 3.7.5 (upgraded from 2.5)
  2. Migrate to v4.0-beta1 (4e4c277)

Expected Behavior

Successful run of all migrations

Observed Behavior

Migration Applying users.0008_flip_objectpermission_assignments fails with this error:

psycopg.errors.UndefinedObject: constraint "users_objectpermissi_objectpermission_id_2f7cc117_fk_users_obj" for table "users_group_object_permissions" does not exist
@tobiasge tobiasge added status: needs triage This issue is awaiting triage by a maintainer type: bug A confirmed report of unexpected behavior in the application labels Apr 16, 2024
@tobiasge
Copy link
Member Author

The table users_objectpermission_groups is renamed to users_group_object_permissions. The original table in our database looks like this:

netbox-local-test=> \d users_objectpermission_groups
                                   Table "public.users_objectpermission_groups"
       Column        |  Type   | Collation | Nullable |                          Default
---------------------+---------+-----------+----------+-----------------------------------------------------------
 id                  | integer |           | not null | nextval('users_objectpermission_groups_id_seq'::regclass)
 objectpermission_id | bigint  |           | not null |
 group_id            | integer |           | not null |
Indexes:
    "users_objectpermission_groups_pkey" PRIMARY KEY, btree (id)
    "users_objectpermission_g_objectpermission_id_grou_3b62a39c_uniq" UNIQUE CONSTRAINT, btree (objectpermission_id, group_id)
    "users_objectpermission_groups_group_id_fb7ba6e0" btree (group_id)
    "users_objectpermission_groups_objectpermission_id_2f7cc117" btree (objectpermission_id)
Foreign-key constraints:
    "users_objectpermissi_group_id_fb7ba6e0_fk_auth_grou" FOREIGN KEY (group_id) REFERENCES auth_group(id) DEFERRABLE INITIALLY DEFERRED

@a084ed22
Copy link

This is likely my same problem (#15698)

@tobiasge
Copy link
Member Author

Looks like it from the stack trace. Sorry for the duplicated report.

@jeremystretch jeremystretch added status: duplicate This issue has already been raised and removed status: needs triage This issue is awaiting triage by a maintainer labels Apr 16, 2024
@jeremystretch jeremystretch closed this as not planned Won't fix, can't repro, duplicate, stale Apr 16, 2024
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: duplicate This issue has already been raised type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

4 participants