Bug 1743644

Summary: dnf shell failes to commit transaction?
Product: [Fedora] Fedora Reporter: Paolo Antinori <pantinor>
Component: dnfAssignee: Marek Blaha <mblaha>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 30CC: dmach, jmracek, jrohel, mblaha, mhatina, packaging-team-maint, pkratoch, rpm-software-management, vmukhame
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: dnf-4.2.11-2.fc30 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-10-10 16:56:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Paolo Antinori 2019-08-20 11:14:19 UTC
Description of problem:
`dnf shell` seems not to commit transaction and fails if i invoke the `transaction list subcommand`


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


How reproducible:
dnf.noarch                                             4.2.7-2.fc30                           @updates


Steps to Reproduce:
1. sudo dnf shell
2. install pulseaudio-module-bluetooth-freeworld
3. remove pulseaudio-module-bluetooth
4. install ffmpeg
5. transaction run
6. transaction list

Actual results:

```
$ sudo dnf shell
[sudo] password for pantinor: 
RHEL7 CSB packages                                                                                                                                                                 0.0  B/s |   0  B     00:00    
Failed to download metadata for repo 'rhel7-csb'
Ignoring repositories: rhel7-csb
Last metadata expiration check: 0:02:01 ago on Tue 20 Aug 2019 13:04:43 CEST.
> install pulseaudio-module-bluetooth-freeworld
> remove pulseaudio-module-bluetooth
> install ffmpeg
Package ffmpeg-4.1.4-1.fc30.x86_64 is already installed.
> transaction run
===================================================================================================================================================================================================================
 Package                                                             Architecture                         Version                                       Repository                                            Size
===================================================================================================================================================================================================================
Installing:
 pulseaudio-module-bluetooth-freeworld                               x86_64                               1.2-1.fc30                                    rpmfusion-free-updates                                88 k
Installing dependencies:
 fdk-aac-free                                                        x86_64                               2.0.0-1.fc30                                  updates                                              376 k
Installing weak dependencies:
 libldac                                                             x86_64                               2.0.2.3-2.fc30                                fedora                                                37 k
Removing:
 pulseaudio-module-bluetooth                                         x86_64                               12.2-8.fc30                                   @unitedrpms                                          251 k
Removing unused dependencies:
 ldacbt                                                              x86_64                               2.0.2.3-1.fc30                                @unitedrpms                                           70 k

Transaction Summary
===================================================================================================================================================================================================================
Install  3 Packages
Remove   2 Packages

Total download size: 502 k
Is this ok [y/N]: y
Downloading Packages:
(1/3): libldac-2.0.2.3-2.fc30.x86_64.rpm                                                                                                                                           156 kB/s |  37 kB     00:00    
(2/3): fdk-aac-free-2.0.0-1.fc30.x86_64.rpm                                                                                                                                        561 kB/s | 376 kB     00:00    
(3/3): pulseaudio-module-bluetooth-freeworld-1.2-1.fc30.x86_64.rpm                                                                                                                  14 kB/s |  88 kB     00:06    
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                                                               66 kB/s | 502 kB     00:07     
Running transaction check
Transaction check succeeded.
Running transaction test
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Last metadata expiration check: 0:02:50 ago on Tue 20 Aug 2019 13:04:43 CEST.
> transaction list
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Traceback (most recent call last):
  File "/usr/bin/dnf", line 58, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 191, in user_main
    errcode = main(args)
  File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 65, in main
    return _main(base, args, cli_class, option_parser_class)
  File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 98, in _main
    return cli_run(cli, base)
  File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 114, in cli_run
    cli.run()
  File "/usr/lib/python3.7/site-packages/dnf/cli/cli.py", line 1135, in run
    return self.command.run()
  File "/usr/lib/python3.7/site-packages/dnf/cli/commands/shell.py", line 88, in run
    self.cmdloop()
  File "/usr/lib64/python3.7/cmd.py", line 138, in cmdloop
    stop = self.onecmd(line)
  File "/usr/lib/python3.7/site-packages/dnf/cli/commands/shell.py", line 110, in onecmd
    getattr(self, '_' + self.MAPPING[opts.command])(s_line[1::])
  File "/usr/lib/python3.7/site-packages/dnf/cli/commands/shell.py", line 263, in _transaction
    self._resolve()
  File "/usr/lib/python3.7/site-packages/dnf/cli/commands/shell.py", line 241, in _resolve
    self.cli.base.resolve(self.cli.demands.allow_erasing)
  File "/usr/lib/python3.7/site-packages/dnf/base.py", line 744, in resolve
    self._ds_callback.start()
AttributeError: 'NoneType' object has no attribute 'start'
```

note that after the apparently successful `transaction run` if i close the interactive shell there, I cannot find the new packages installed


Expected results:


Additional info:

Comment 1 Marek Blaha 2019-08-29 07:58:08 UTC
One of the problems here is, that the transaction was NOT successful and packages were not installed. The error occurred in the "transaction test" phase. Unfortunately the shell command hides transaction errors from the user so you do not see why it failed - this should be fixed by PR https://github.com/rpm-software-management/dnf/pull/1468

The other problem is the strange crash in 'transaction list' command. I tried to reproduce it but without any success so far.

Comment 2 Paolo Antinori 2019-09-02 15:08:30 UTC
Thank you Marek for your update.

I've manually patched shell.py according to your PR and I can now see the error logged, although the "Error Summary section is still empty and if I perform a transaction list command at the end, I still get the same stacktrace error:

```
17:06:33 (/home/pantinor)$ sudo dnf shell 
RHEL7 CSB packages                                                                                                                                                                 0.0  B/s |   0  B     00:00    
Failed to download metadata for repo 'rhel7-csb'
Ignoring repositories: rhel7-csb
Last metadata expiration check: 0:54:23 ago on Mon 02 Sep 2019 16:12:13 CEST.
> install pulseaudio-module-bluetooth-freeworld
> remove pulseaudio-module-bluetooth
> install ffmpeg
Package ffmpeg-4.1.4-1.fc30.x86_64 is already installed.
> transaction run
===================================================================================================================================================================================================================
 Package                                                             Architecture                         Version                                       Repository                                            Size
===================================================================================================================================================================================================================
Installing:
 pulseaudio-module-bluetooth-freeworld                               x86_64                               1.2-1.fc30                                    rpmfusion-free-updates                                88 k
Installing dependencies:
 fdk-aac-free                                                        x86_64                               2.0.0-1.fc30                                  updates                                              376 k
Installing weak dependencies:
 libldac                                                             x86_64                               2.0.2.3-2.fc30                                fedora                                                37 k
Removing:
 pulseaudio-module-bluetooth                                         x86_64                               12.2-9.fc30                                   @updates                                             228 k

Transaction Summary
===================================================================================================================================================================================================================
Install  3 Packages
Remove   1 Package

Total size: 502 k
Is this ok [y/N]: y
Downloading Packages:
[SKIPPED] fdk-aac-free-2.0.0-1.fc30.x86_64.rpm: Already downloaded                                                                                                                                                
[SKIPPED] libldac-2.0.2.3-2.fc30.x86_64.rpm: Already downloaded                                                                                                                                                   
[SKIPPED] pulseaudio-module-bluetooth-freeworld-1.2-1.fc30.x86_64.rpm: Already downloaded                                                                                                                         
Running transaction check
Transaction check succeeded.
Running transaction test
Error: Transaction check error:
  file /usr/lib64/libldacBT_abr.so.2.0.2.3 from install of libldac-2.0.2.3-2.fc30.x86_64 conflicts with file from package ldacbt-2.0.2.3-1.fc30.x86_64
  file /usr/lib64/libldacBT_enc.so.2.0.2.3 from install of libldac-2.0.2.3-2.fc30.x86_64 conflicts with file from package ldacbt-2.0.2.3-1.fc30.x86_64
  file /usr/lib64/libfdk-aac.so.2.0.0 from install of fdk-aac-free-2.0.0-1.fc30.x86_64 conflicts with file from package fdk-aac-2.0.0-3.fc30.x86_64

Error Summary
-------------

The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Last metadata expiration check: 0:54:55 ago on Mon 02 Sep 2019 16:12:13 CEST.
> transaction list
The downloaded packages were saved in cache until the next successful transaction.
You can remove cached packages by executing 'dnf clean packages'.
Traceback (most recent call last):
  File "/usr/bin/dnf", line 58, in <module>
    main.user_main(sys.argv[1:], exit_code=True)
  File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 191, in user_main
    errcode = main(args)
  File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 65, in main
    return _main(base, args, cli_class, option_parser_class)
  File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 98, in _main
    return cli_run(cli, base)
  File "/usr/lib/python3.7/site-packages/dnf/cli/main.py", line 114, in cli_run
    cli.run()
  File "/usr/lib/python3.7/site-packages/dnf/cli/cli.py", line 1135, in run
    return self.command.run()
  File "/usr/lib/python3.7/site-packages/dnf/cli/commands/shell.py", line 88, in run
    self.cmdloop()
  File "/usr/lib64/python3.7/cmd.py", line 138, in cmdloop
    stop = self.onecmd(line)
  File "/usr/lib/python3.7/site-packages/dnf/cli/commands/shell.py", line 110, in onecmd
    getattr(self, '_' + self.MAPPING[opts.command])(s_line[1::])
  File "/usr/lib/python3.7/site-packages/dnf/cli/commands/shell.py", line 263, in _transaction
    self._resolve()
  File "/usr/lib/python3.7/site-packages/dnf/cli/commands/shell.py", line 241, in _resolve
    self.cli.base.resolve(self.cli.demands.allow_erasing)
  File "/usr/lib/python3.7/site-packages/dnf/base.py", line 744, in resolve
    self._ds_callback.start()
AttributeError: 'NoneType' object has no attribute 'start'

-------------
```

Comment 3 Marek Blaha 2019-09-03 05:33:58 UTC
Thanks Paolo for the report. Now, after installing ldacbt package from unitedrpms repo, I'm able to reproduce the tracaback and I'll work on fixing it.

The solution for your problem could be removing the ldacbt package, which has undeclared file conflict with libldac required by pulseaudio-module-bluetooth-freeworld. Then you should be able to proceed. This conflict should be added to ldacbt package by its maintainer to prevent package managers to try to install both of them together.

Comment 4 Marek Blaha 2019-09-03 07:22:41 UTC
The traceback is already fixed - see https://bugzilla.redhat.com/show_bug.cgi?id=1736879

Comment 5 Paolo Antinori 2019-09-03 11:39:50 UTC
Thank you Marek for you help.
With your first fix I was able to understand which deps were giving me the conflict.
I've solved my direct problem but I'm also available to validate or perform tests if needed.

thank again

paolo

Comment 6 Fedora Update System 2019-10-02 08:31:58 UTC
FEDORA-2019-049b4836a6 has been submitted as an update to Fedora 30. https://bodhi.fedoraproject.org/updates/FEDORA-2019-049b4836a6

Comment 7 Fedora Update System 2019-10-03 01:52:35 UTC
dnf-4.2.11-2.fc30, dnf-plugins-core-4.0.10-1.fc30, libdnf-0.35.5-2.fc30, librepo-1.10.6-1.fc30 has been pushed to the Fedora 30 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2019-049b4836a6

Comment 8 Fedora Update System 2019-10-10 16:56:00 UTC
dnf-4.2.11-2.fc30, dnf-plugins-core-4.0.10-1.fc30, libdnf-0.35.5-2.fc30, librepo-1.10.6-1.fc30 has been pushed to the Fedora 30 stable repository. If problems still persist, please make note of it in this bug report.