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

Publishing collection with certain version returns a 500 error #3287

Open
tonyskapunk opened this issue Nov 14, 2023 · 0 comments
Open

Publishing collection with certain version returns a 500 error #3287

tonyskapunk opened this issue Nov 14, 2023 · 0 comments

Comments

@tonyskapunk
Copy link

tonyskapunk commented Nov 14, 2023

Bug Report

SUMMARY

Using a SemVer with metadata returns a 500 when publishing a collection

The version used is: 1.2.1699989185+202311141913.gitc0825d0

STEPS TO REPRODUCE

Create a collection with version: 1.2.1699989185+202311141913.gitc0825d0 and attempt to publish it to galaxy.

EXPECTED RESULTS

No error should be returned and the collection should be published.

ACTUAL RESULTS
Remove previous tarfile(s).
No config file found; using defaults
Created collection for tonyskapunk.beat at /github/workspace/tonyskapunk-beat-1.2.1699989185+202311141913.gitc0825d0.tar.gz
ERROR! Error when publishing collection to cmd_arg (https://galaxy.ansible.com/api/) (HTTP Code: 500, Message: Internal Server Error Code: Unknown)
No config file found; using defaults
Publishing collection artifact '/github/workspace/tonyskapunk-beat-1.2.1699989185+202311141913.gitc0825d0.tar.gz' to cmd_arg https://galaxy.ansible.com/api/

I have an instance of galaxy (Ansible Hub) running 4.7.3 (this is the UI version) where I see the same problems, in there the logs of the HUB API shows:

pulp [588dc810413c4bdd811886cee20e65e0]: django.request:ERROR: Internal Server Error: /api/galaxy/v3/plugin/ansible/content/staging/collections/artifacts/
Traceback (most recent call last):
  File "/usr/lib/python3.9/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(32)


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

Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/usr/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/usr/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/rest_framework/viewsets.py", line 125, in view
    return self.dispatch(request, *args, **kwargs)
  File "/usr/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch
    response = self.handle_exception(exc)
  File "/usr/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/usr/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
    raise exc
  File "/usr/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch
    response = handler(request, *args, **kwargs)
  File "/usr/lib/python3.9/site-packages/galaxy_ng/app/api/v3/viewsets/collection.py", line 138, in create
    models.CollectionImport.objects.create(
  File "/usr/lib/python3.9/site-packages/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/django/db/models/query.py", line 453, in create
    obj.save(force_insert=True, using=self.db)
  File "/usr/lib64/python3.9/contextlib.py", line 79, in inner
    return func(*args, **kwds)
  File "/usr/lib/python3.9/site-packages/django_lifecycle/mixins.py", line 169, in save
    save(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/django/db/models/base.py", line 739, in save
    self.save_base(using=using, force_insert=force_insert,
  File "/usr/lib/python3.9/site-packages/django/db/models/base.py", line 776, in save_base
    updated = self._save_table(
  File "/usr/lib/python3.9/site-packages/django/db/models/base.py", line 881, in _save_table
    results = self._do_insert(cls._base_manager, using, fields, returning_fields, raw)
  File "/usr/lib/python3.9/site-packages/django/db/models/base.py", line 919, in _do_insert
    return manager._insert(
  File "/usr/lib/python3.9/site-packages/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/django/db/models/query.py", line 1270, in _insert
    return query.get_compiler(using=using).execute_sql(returning_fields)
  File "/usr/lib/python3.9/site-packages/django/db/models/sql/compiler.py", line 1416, in execute_sql
    cursor.execute(sql, params)
  File "/usr/lib/python3.9/site-packages/django/db/backends/utils.py", line 66, in execute
    return self._execute_with_wrappers(sql, params, many=False, executor=self._execute)
  File "/usr/lib/python3.9/site-packages/django/db/backends/utils.py", line 75, in _execute_with_wrappers
    return executor(sql, params, many, context)
  File "/usr/lib/python3.9/site-packages/django/db/backends/utils.py", line 84, in _execute
    return self.cursor.execute(sql, params)
  File "/usr/lib/python3.9/site-packages/django/db/utils.py", line 90, in __exit__
    raise dj_exc_value.with_traceback(traceback) from exc_value
  File "/usr/lib/python3.9/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(32)

Thanks!

tonyskapunk added a commit to redhatci/ansible-collection-redhatci-ocp that referenced this issue Nov 16, 2023
Due to ansible/galaxy#3287 can't run the GHA
ansible/ansible-publish-action without failing, despite the error 500,
the collection is published, we are ignoring the 500 until fixed.
tonyskapunk added a commit to redhatci/ansible-collection-redhatci-ocp that referenced this issue Nov 20, 2023
* Change versioning

The current versioning is considered pre-release. Switching to use a
slightly different format to make every release a patch release.

The version of the patch release is now the epoch of the latest commit
date merged into main

Before: 0.2.1-{%Y%m%D%H%M}git{SHA}
Now: 0.2.{%s}+{%Y%m%D%H%M}.git{SHA}

The + delimits the version from metadata for the release

* Build and push manually

Due to ansible/galaxy#3287 can't run the GHA
ansible/ansible-publish-action without failing, despite the error 500,
the collection is published, we are ignoring the 500 until fixed.
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