Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2143695 - 0077_move_remote_url_credentials.py fails on Remotes that have @ in path, not netloc
Summary: 0077_move_remote_url_credentials.py fails on Remotes that have @ in path, not...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Pulp
Version: 6.12.0
Hardware: Unspecified
OS: Unspecified
medium
high
Target Milestone: 6.13.0
Assignee: satellite6-bugs
QA Contact: Vladimír Sedmík
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-11-17 14:59 UTC by Ian Ballou
Modified: 2023-05-03 13:23 UTC (History)
9 users (show)

Fixed In Version: pulpcore-3.18.12-1, pulpcore-3.21.4-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2158578 (view as bug list)
Environment:
Last Closed: 2023-05-03 13:23:05 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github pulp pulpcore issues 3409 0 None closed 0077_move_remote_url_credentials.py fails on Remotes that have @ in path, not netloc 2022-11-17 15:56:59 UTC
Red Hat Issue Tracker SAT-13946 0 None None None 2022-11-18 00:24:42 UTC
Red Hat Knowledge Base (Solution) 6987082 0 None None None 2022-11-22 14:14:34 UTC
Red Hat Product Errata RHSA-2023:2097 0 None None None 2023-05-03 13:23:18 UTC

Description Ian Ballou 2022-11-17 14:59:40 UTC
Description of problem:

Migration 0077 fails when you have a remote that has an @ somewhere in the path

  Applying core.0077_move_remote_url_credentials...Traceback (most recent call last):
  File "/usr/bin/pulpcore-manager", line 33, in <module>
    sys.exit(load_entry_point('pulpcore==3.18.10', 'console_scripts', 'pulpcore-manager')())
  File "/usr/lib/python3.9/site-packages/pulpcore/app/manage.py", line 11, in manage
    execute_from_command_line(sys.argv)
  File "/usr/lib/python3.9/site-packages/django/core/management/__init__.py", line 419, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python3.9/site-packages/django/core/management/__init__.py", line 413, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python3.9/site-packages/django/core/management/base.py", line 354, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/lib/python3.9/site-packages/django/core/management/base.py", line 398, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python3.9/site-packages/django/core/management/base.py", line 89, in wrapped
    res = handle_func(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/django/core/management/commands/migrate.py", line 244, in handle
    post_migrate_state = executor.migrate(
  File "/usr/lib/python3.9/site-packages/django/db/migrations/executor.py", line 117, in migrate
    state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
  File "/usr/lib/python3.9/site-packages/django/db/migrations/executor.py", line 147, in _migrate_all_forwards
    state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
  File "/usr/lib/python3.9/site-packages/django/db/migrations/executor.py", line 227, in apply_migration
    state = migration.apply(state, schema_editor)
  File "/usr/lib/python3.9/site-packages/django/db/migrations/migration.py", line 126, in apply
    operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
  File "/usr/lib/python3.9/site-packages/django/db/migrations/operations/special.py", line 190, in database_forwards
    self.code(from_state.apps, schema_editor)
  File "/usr/lib/python3.9/site-packages/pulpcore/app/migrations/0077_move_remote_url_credentials.py", line 19, in move_remote_url_credentials
    _, url_split = url.netloc.rsplit("@", maxsplit=1)
ValueError: not enough values to unpack (expected 2, got 1)



Version-Release number of selected component (if applicable):


How reproducible:
100%

Steps to Reproduce:

   - Have a remote https://download.copr.fedorainfracloud.org/results/@caddy/caddy/epel-8-x86_64/
   - Try to migrate 0077


Actual results:
Migration fails

Expected results:
Migration completes

Additional info:

This could become an upgrade blocker. However, having and @ symbol in the remote in an unexpected place is likely rare.

Comment 1 Daniel Alley 2022-11-17 16:00:35 UTC
Thanks @evgeni for the quick fix

Comment 2 Evgeni Golov 2022-11-17 18:20:26 UTC
> This could become an upgrade blocker. However, having and @ symbol in the remote in an unexpected place is likely rare.

I tend to disagree. Copr does that, and I would think there are quite a few users that pick some upstream RPMs via Copr into their environment.

Comment 3 Vladimír Sedmík 2023-02-01 21:46:13 UTC
Verified in 6.13.0 snap 8 (python39-pulpcore-3.21.4-2.el8pc.noarch).

Steps:
1) Sync a repo with '@' in upstream_url to a 6.12.0 Satellite. (Used https://download.copr.fedorainfracloud.org/results/@caddy/caddy/epel-8-x86_64/)
2) Upgrade it to 6.13.0.

Result:
The upgrade succeeded including migrations, repo is available on the upgraded Satellite.

Comment 7 errata-xmlrpc 2023-05-03 13:23:05 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (Important: Satellite 6.13 Release), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2023:2097


Note You need to log in before you can comment on or make changes to this bug.