[Bug]: Migration (from netbox-secretstore) fails
kirk444 opened this issue · comments
NetBox Secrets plugin version
1.7.5
NetBox version
3.4.7
Steps to Reproduce
Existing netbox 3.4.7 with netbox-secretstore 1.4.1.
Install netbox-secrets 1.7.5:
Add 'netbox-secrets' to local_requirements.txt && ./venv/bin/pip install -r local_requirements.txt
Add 'netbox_secrets' to configuration.py
Run migration ./venv/bin/python netbox/manage.py migrate
Run collectstatic ./venv/bin/python netbox/manage.py collectstatic --no-input
Install netbox-secretstore migration version:
./venv/bin/pip install git+https://github.com/Onemind-Services-LLC/netbox-secretstore@migration/nb34
./venv/bin/python manage.py migrate
Fails with:
SystemCheckError: System check identified some issues:
ERRORS:
netbox_secrets.Secret.tags: (fields.E304) Reverse accessor 'Tag.secret_set' for 'netbox_secrets.Secret.tags' clashes with reverse accessor for 'netbox_secretstore.Secret.tags'.
HINT: Add or change a related_name argument to the definition for 'netbox_secrets.Secret.tags' or 'netbox_secretstore.Secret.tags'.
netbox_secrets.SecretRole.tags: (fields.E304) Reverse accessor 'Tag.secretrole_set' for 'netbox_secrets.SecretRole.tags' clashes with reverse accessor for 'netbox_secretstore.SecretRole.tags'.
HINT: Add or change a related_name argument to the definition for 'netbox_secrets.SecretRole.tags' or 'netbox_secretstore.SecretRole.tags'.
netbox_secrets.UserKey.user: (fields.E304) Reverse accessor 'User.user_key' for 'netbox_secrets.UserKey.user' clashes with reverse accessor for 'netbox_secretstore.UserKey.user'.
HINT: Add or change a related_name argument to the definition for 'netbox_secrets.UserKey.user' or 'netbox_secretstore.UserKey.user'.
netbox_secrets.UserKey.user: (fields.E305) Reverse query name for 'netbox_secrets.UserKey.user' clashes with reverse query name for 'netbox_secretstore.UserKey.user'.
HINT: Add or change a related_name argument to the definition for 'netbox_secrets.UserKey.user' or 'netbox_secretstore.UserKey.user'.
netbox_secretstore.Secret.tags: (fields.E304) Reverse accessor 'Tag.secret_set' for 'netbox_secretstore.Secret.tags' clashes with reverse accessor for 'netbox_secrets.Secret.tags'.
HINT: Add or change a related_name argument to the definition for 'netbox_secretstore.Secret.tags' or 'netbox_secrets.Secret.tags'.
netbox_secretstore.SecretRole.tags: (fields.E304) Reverse accessor 'Tag.secretrole_set' for 'netbox_secretstore.SecretRole.tags' clashes with reverse accessor for 'netbox_secrets.SecretRole.tags'.
HINT: Add or change a related_name argument to the definition for 'netbox_secretstore.SecretRole.tags' or 'netbox_secrets.SecretRole.tags'.
netbox_secretstore.UserKey.user: (fields.E304) Reverse accessor 'User.user_key' for 'netbox_secretstore.UserKey.user' clashes with reverse accessor for 'netbox_secrets.UserKey.user'.
HINT: Add or change a related_name argument to the definition for 'netbox_secretstore.UserKey.user' or 'netbox_secrets.UserKey.user'.
netbox_secretstore.UserKey.user: (fields.E305) Reverse query name for 'netbox_secretstore.UserKey.user' clashes with reverse query name for 'netbox_secrets.UserKey.user'.
HINT: Add or change a related_name argument to the definition for 'netbox_secretstore.UserKey.user' or 'netbox_secrets.UserKey.user'.
Expected Behavior
I expected the command to complete without errors, so I could proceed with the next step.
Observed Behavior
SystemCheckError: System check identified some issues:
ERRORS:
netbox_secrets.Secret.tags: (fields.E304) Reverse accessor 'Tag.secret_set' for 'netbox_secrets.Secret.tags' clashes with reverse accessor for 'netbox_secretstore.Secret.tags'.
HINT: Add or change a related_name argument to the definition for 'netbox_secrets.Secret.tags' or 'netbox_secretstore.Secret.tags'.
netbox_secrets.SecretRole.tags: (fields.E304) Reverse accessor 'Tag.secretrole_set' for 'netbox_secrets.SecretRole.tags' clashes with reverse accessor for 'netbox_secretstore.SecretRole.tags'.
HINT: Add or change a related_name argument to the definition for 'netbox_secrets.SecretRole.tags' or 'netbox_secretstore.SecretRole.tags'.
netbox_secrets.UserKey.user: (fields.E304) Reverse accessor 'User.user_key' for 'netbox_secrets.UserKey.user' clashes with reverse accessor for 'netbox_secretstore.UserKey.user'.
HINT: Add or change a related_name argument to the definition for 'netbox_secrets.UserKey.user' or 'netbox_secretstore.UserKey.user'.
netbox_secrets.UserKey.user: (fields.E305) Reverse query name for 'netbox_secrets.UserKey.user' clashes with reverse query name for 'netbox_secretstore.UserKey.user'.
HINT: Add or change a related_name argument to the definition for 'netbox_secrets.UserKey.user' or 'netbox_secretstore.UserKey.user'.
netbox_secretstore.Secret.tags: (fields.E304) Reverse accessor 'Tag.secret_set' for 'netbox_secretstore.Secret.tags' clashes with reverse accessor for 'netbox_secrets.Secret.tags'.
HINT: Add or change a related_name argument to the definition for 'netbox_secretstore.Secret.tags' or 'netbox_secrets.Secret.tags'.
netbox_secretstore.SecretRole.tags: (fields.E304) Reverse accessor 'Tag.secretrole_set' for 'netbox_secretstore.SecretRole.tags' clashes with reverse accessor for 'netbox_secrets.SecretRole.tags'.
HINT: Add or change a related_name argument to the definition for 'netbox_secretstore.SecretRole.tags' or 'netbox_secrets.SecretRole.tags'.
netbox_secretstore.UserKey.user: (fields.E304) Reverse accessor 'User.user_key' for 'netbox_secretstore.UserKey.user' clashes with reverse accessor for 'netbox_secrets.UserKey.user'.
HINT: Add or change a related_name argument to the definition for 'netbox_secretstore.UserKey.user' or 'netbox_secrets.UserKey.user'.
netbox_secretstore.UserKey.user: (fields.E305) Reverse query name for 'netbox_secretstore.UserKey.user' clashes with reverse query name for 'netbox_secrets.UserKey.user'.
HINT: Add or change a related_name argument to the definition for 'netbox_secretstore.UserKey.user' or 'netbox_secrets.UserKey.user'.
As mentioned in the faq, please install version v1.6.x first for the migration to work. If you still face issues, please update your description with the new logs
Sorry, but I don't know how to do that, I tried setting the local_requirements.txt to require "== 1.6.0" but it fails:
ERROR: Could not find a version that satisfies the requirement netbox-secrets==1.6.0 (from versions: 1.7.3, 1.7.4, 1.7.5)
ERROR: No matching distribution found for netbox-secrets==1.6.0
Is there documnetation for installing from a github release somewhere?
You can try doing pip install git+https://github.com/Onemind-Services-LLC/netbox-secrets@v1.6.0
Thanks, I was able to "pip install v.1.6.0.tar.gz" after downloading from github as well. In any case, it fails with the same error:
SystemCheckError: System check identified some issues:
ERRORS:
netbox_secrets.Secret.tags: (fields.E304) Reverse accessor 'Tag.secret_set' for 'netbox_secrets.Secret.tags' clashes with reverse accessor for 'netbox_secretstore.Secret.tags'.
HINT: Add or change a related_name argument to the definition for 'netbox_secrets.Secret.tags' or 'netbox_secretstore.Secret.tags'.
netbox_secrets.SecretRole.tags: (fields.E304) Reverse accessor 'Tag.secretrole_set' for 'netbox_secrets.SecretRole.tags' clashes with reverse accessor for 'netbox_secretstore.SecretRole.tags'.
HINT: Add or change a related_name argument to the definition for 'netbox_secrets.SecretRole.tags' or 'netbox_secretstore.SecretRole.tags'.
netbox_secrets.UserKey.user: (fields.E304) Reverse accessor 'User.user_key' for 'netbox_secrets.UserKey.user' clashes with reverse accessor for 'netbox_secretstore.UserKey.user'.
HINT: Add or change a related_name argument to the definition for 'netbox_secrets.UserKey.user' or 'netbox_secretstore.UserKey.user'.
netbox_secrets.UserKey.user: (fields.E305) Reverse query name for 'netbox_secrets.UserKey.user' clashes with reverse query name for 'netbox_secretstore.UserKey.user'.
HINT: Add or change a related_name argument to the definition for 'netbox_secrets.UserKey.user' or 'netbox_secretstore.UserKey.user'.
netbox_secretstore.Secret.tags: (fields.E304) Reverse accessor 'Tag.secret_set' for 'netbox_secretstore.Secret.tags' clashes with reverse accessor for 'netbox_secrets.Secret.tags'.
HINT: Add or change a related_name argument to the definition for 'netbox_secretstore.Secret.tags' or 'netbox_secrets.Secret.tags'.
netbox_secretstore.SecretRole.tags: (fields.E304) Reverse accessor 'Tag.secretrole_set' for 'netbox_secretstore.SecretRole.tags' clashes with reverse accessor for 'netbox_secrets.SecretRole.tags'.
HINT: Add or change a related_name argument to the definition for 'netbox_secretstore.SecretRole.tags' or 'netbox_secrets.SecretRole.tags'.
netbox_secretstore.UserKey.user: (fields.E304) Reverse accessor 'User.user_key' for 'netbox_secretstore.UserKey.user' clashes with reverse accessor for 'netbox_secrets.UserKey.user'.
HINT: Add or change a related_name argument to the definition for 'netbox_secretstore.UserKey.user' or 'netbox_secrets.UserKey.user'.
netbox_secretstore.UserKey.user: (fields.E305) Reverse query name for 'netbox_secretstore.UserKey.user' clashes with reverse query name for 'netbox_secrets.UserKey.user'.
HINT: Add or change a related_name argument to the definition for 'netbox_secretstore.UserKey.user' or 'netbox_secrets.UserKey.user'.```
I guess I have to modify the other repo for maling migration pass. I do not think there is anything wrong with this one
Please use v1.7.6 and reinstall the migration branch. Make sure secretstore version is v1.4.4. Your issue happened because I did not change the version on the migration branch and when you probably ran the pip install, it did not make any changes
Thank you for your assistance, I can confirm that with the v1.7.6 netbox-secrets, and v1.4.4 netbox-secretstore (migration branch) the migration process worked as documented without any further issues.