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

Increase name field size in packageurl.contrib.django.models.PackageURLMixin #73

Open
JonoYang opened this issue Feb 10, 2022 · 0 comments
Assignees

Comments

@JonoYang
Copy link
Collaborator

I have a django webapp that uses packageurl.contrib.django.models.PackageURLMixin and I get the following error when I try to save a package with a very long name.

Traceback (most recent call last):
  File "/home/jono/nexb/src/dejacode/lib/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
psycopg2.errors.StringDataRightTruncation: value too long for type character varying(100)


The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "./manage.py", line 10, in <module>
    execute_from_command_line(sys.argv)
  File "/home/jono/nexb/src/dejacode/lib/python3.6/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/home/jono/nexb/src/dejacode/lib/python3.6/site-packages/django/core/management/__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/jono/nexb/src/dejacode/lib/python3.6/site-packages/django/core/management/base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/jono/nexb/src/dejacode/lib/python3.6/site-packages/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "/home/jono/nexb/src/dejacode/component_catalog/management/commands/setpurls.py", line 88, in handle
    Package.objects.filter(pk=package.pk).update(**package_url_dict)
  File "/home/jono/nexb/src/dejacode/lib/python3.6/site-packages/django/db/models/query.py", line 783, in update
    rows = query.get_compiler(self.db).execute_sql(CURSOR)
  File "/home/jono/nexb/src/dejacode/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1559, in execute_sql
    cursor = super().execute_sql(result_type)
  File "/home/jono/nexb/src/dejacode/lib/python3.6/site-packages/django/db/models/sql/compiler.py", line 1175, in execute_sql
    cursor.execute(sql, params)
  File "/home/jono/nexb/src/dejacode/lib/python3.6/site-packages/django/db/backends/utils.py", line 98, in execute
    return super().execute(sql, params)
  File "/home/jono/nexb/src/dejacode/lib/python3.6/site-packages/django/db/backends/utils.py", line 66, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  File "/home/jono/nexb/src/dejacode/lib/python3.6/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "/home/jono/nexb/src/dejacode/lib/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/home/jono/nexb/src/dejacode/lib/python3.6/site-packages/django/db/utils.py", line 90, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/home/jono/nexb/src/dejacode/lib/python3.6/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
django.db.utils.DataError: value too long for type character varying(100)
@JonoYang JonoYang self-assigned this Feb 10, 2022
JonoYang added a commit that referenced this issue Feb 10, 2022
JonoYang added a commit that referenced this issue Feb 10, 2022
Signed-off-by: Jono Yang <[email protected]>
JonoYang added a commit that referenced this issue Feb 11, 2022
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

1 participant