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

Naturalization of names resulting in >100 characters causes shcema migration to fail #4166

Closed
jeremystretch opened this issue Feb 14, 2020 · 0 comments
Assignees
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application

Comments

@jeremystretch
Copy link
Member

Environment

  • Python version: 3.6.9
  • NetBox version: 2.7.5

Steps to Reproduce

  1. Start with a v2.7.4 installation
  2. Create a site named "1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a"
  3. Upgrade to v2.7.5 and run apply database schema migrations

Expected Behavior

All migrations should complete successfully.

Observed Behavior

The migration 0095_primary_model_ordering fails with the following error:

django.db.utils.DataError: value too long for type character varying(100)

This happens because the name "1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a" expands to a string greater than 100 characters in length, which is the maximum length for the database field. The naturalization function accepts an argument to cut the naturalized string to a specific length, however the parameter is not being passed by the migration function.

It should be noted that this can be reproduced with any model using naturalized ordering if the source name is constructed in such a way that its naturalized version exceeds 100 characters.

@jeremystretch jeremystretch added type: bug A confirmed report of unexpected behavior in the application status: accepted This issue has been accepted for implementation labels Feb 14, 2020
@jeremystretch jeremystretch self-assigned this Feb 14, 2020
@lock lock bot locked as resolved and limited conversation to collaborators May 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
status: accepted This issue has been accepted for implementation type: bug A confirmed report of unexpected behavior in the application
Projects
None yet
Development

No branches or pull requests

1 participant