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

Fix broken queries on rerun #867

Merged
merged 1 commit into from
Jul 23, 2024
Merged

Fix broken queries on rerun #867

merged 1 commit into from
Jul 23, 2024

Conversation

dkubek
Copy link
Member

@dkubek dkubek commented Jun 6, 2024

After the update to the leapp db table names, the rerun command fails. This commit fixes the issue by using the current schema.

jira: https://issues.redhat.com/browse/RHEL-40363

@pirat89 pirat89 added this to the 8.10/9.5 milestone Jul 2, 2024
@matejmatuska
Copy link
Member

/packit copr-build

Copy link

Based on your Packit configuration the settings of the @oamg/leapp Copr project would need to be updated as follows:

field old value new value
chroots ['fedora-40-aarch64', 'fedora-39-aarch64', 'epel-9-x86_64', 'epel-8-x86_64', 'fedora-39-x86_64', 'fedora-40-x86_64', 'fedora-rawhide-x86_64', 'fedora-rawhide-aarch64', 'epel-7-x86_64'] ['epel-7-ppc64le', 'epel-7-x86_64', 'epel-8-x86_64', 'epel-9-x86_64', 'fedora-39-aarch64', 'fedora-39-x86_64', 'fedora-40-aarch64', 'fedora-40-x86_64', 'fedora-rawhide-aarch64', 'fedora-rawhide-x86_64']

Diff of chroots:

+epel-7-ppc64le

Packit was unable to update the settings above as it is missing admin permissions on the @oamg/leapp Copr project.

To fix this you can do one of the following:

  • Grant Packit admin permissions on the @oamg/leapp Copr project on the permissions page.
  • Change the above Copr project settings manually on the settings page to match the Packit configuration.
  • Update the Packit configuration to match the Copr project settings.

Please retrigger the build, once the issue above is fixed.

@matejmatuska
Copy link
Member

@dkubek Please rebase to fix packit

Copy link
Member

@matejmatuska matejmatuska left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested with local builds, since packit is broken until rebase.
Without this patch (both 7to8 and 8to9):

[root@leapp-20240719132659 ~]# /root/tmp_leapp_py3/leapp3 rerun FirstBoot
Traceback (most recent call last):
  File "/root/tmp_leapp_py3/leapp3", line 6, in <module>
    sys.exit(leapp.cli.main())
  File "/root/tmp_leapp_py3/leapp/cli/__init__.py", line 51, in main
    cli.command.execute('leapp version {}'.format(VERSION))
  File "/root/tmp_leapp_py3/leapp/utils/clicmd.py", line 111, in execute
    args.func(args)
  File "/root/tmp_leapp_py3/leapp/utils/clicmd.py", line 133, in called
    self.target(args)
  File "/root/tmp_leapp_py3/leapp/cli/commands/rerun/__init__.py", line 46, in rerun
    clone_context(last_context, context, db)
  File "/root/tmp_leapp_py3/leapp/utils/audit/contextclone.py", line 105, in clone_context
    _dup_metadata(db=db, oldcontext=oldcontext, newcontext=newcontext)
  File "/root/tmp_leapp_py3/leapp/utils/audit/contextclone.py", line 74, in _dup_metadata
    for row in _fetch_table_for_context(db, 'metadata', oldcontext):
  File "/root/tmp_leapp_py3/leapp/utils/audit/contextclone.py", line 7, in _fetch_table_for_context
    '''.format(table=table), (context,))
sqlite3.OperationalError: no such column: context

With this patch (7to8):

root@leapp-20240719142215 ~]# /root/tmp_leapp_py3/leapp3 rerun FirstBoot

==> Processing phase `FirstBoot`
====> * satellite_upgrader
        Execute installer in the freshly booted system, to finalize Satellite configuration
====> * enable_rhsm_target_repos
        On the upgraded target system, set release and enable repositories that were used during the upgrade
====> * insights_auto_register
        Automatically registers system into Red Hat Insights
====> * network_manager_update_connections
        Update NetworkManager connections.
====> * remove_systemd_resume_service
        Remove systemd service to launch Leapp.

Debug output written to /var/log/leapp/leapp-upgrade.log

============================================================
                      REPORT OVERVIEW
============================================================
...

With this patch (8to9):

[root@leapp-20240719142203 ~]# /root/tmp_leapp_py3/leapp3 rerun FirstBoot

==> Processing phase `FirstBoot`
====> * enable_rhsm_target_repos
        On the upgraded target system, set release and enable repositories that were used during the upgrade
====> * satellite_upgrader
        Execute installer in the freshly booted system, to finalize Satellite configuration
====> * insights_auto_register
        Automatically registers system into Red Hat Insights
====> * remove_systemd_resume_service
        Remove systemd service to launch Leapp.

Debug output written to /var/log/leapp/leapp-upgrade.log

============================================================
                      REPORT OVERVIEW
============================================================
...

LGTM, but waiting for the rebase and test results

After the update to the leapp db table names, the rerun command fails.
This commit fixes the issue by using the current schema.
@Rezney
Copy link
Member

Rezney commented Jul 23, 2024

/packit copr-build

1 similar comment
@Rezney
Copy link
Member

Rezney commented Jul 23, 2024

/packit copr-build

@Rezney
Copy link
Member

Rezney commented Jul 23, 2024

The currently failing tests passed in the previous run (no change pushed since) and the time-outing AWS tests are not relevant to this change. Merging.

@Rezney Rezney merged commit fcd13bc into oamg:master Jul 23, 2024
17 of 21 checks passed
@pirat89 pirat89 added the changelog-checked The merger/reviewer checked the changelog draft document and updated it when relevant label Aug 16, 2024
pirat89 added a commit to pirat89/leapp that referenced this pull request Aug 16, 2024
## Packaging
- Start building for EL 9 in the upstream repository on COPR (oamg#855)

## Framework
### Enhancements
- Minor update in the summary overview to highlight what is present in the pre-upgrade report (oamg#858)
- Store metadata about actors, workflows, and dialogs inside leapp audit db (oamg#847, oamg#867)

## Leapp (tool)
### Enhancements
- Implement singleton leapp execution to prevent multiple running leapp instances on the system in the same time (oamg#851)

## stdlib
### Fixes
- Close properly all file descriptors when executing shell commands via `run` (oamg#880)

## Modifications
- Code is now Python3.12 compatible (oamg#855)
@pirat89 pirat89 mentioned this pull request Aug 16, 2024
pirat89 added a commit that referenced this pull request Aug 16, 2024
## Packaging
- Start building for EL 9 in the upstream repository on COPR (#855)

## Framework
### Enhancements
- Minor update in the summary overview to highlight what is present in the pre-upgrade report (#858)
- Store metadata about actors, workflows, and dialogs inside leapp audit db (#847, #867)

## Leapp (tool)
### Enhancements
- Implement singleton leapp execution to prevent multiple running leapp instances on the system in the same time (#851)

## stdlib
### Fixes
- Close properly all file descriptors when executing shell commands via `run` (#880)

## Modifications
- Code is now Python3.12 compatible (#855)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-checked The merger/reviewer checked the changelog draft document and updated it when relevant
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants