The proposal to merge ~ogayot/curtin:system-install-log-stderr into 
curtin:master has been updated.

Description changed to:

If a subcommand fails as part of a `curtin system-install` invocation, curtin 
tries to show its output. Sadly, the output of the subcommand is not captured, 
so there is nothing to show.

Example:

Mar 08 14:23:46 ubuntu-server subiquity_log.1543[10940]: Running command 
['umount', '/target/dev'] with allowed return codes [0] (capture=False)
Mar 08 14:23:46 ubuntu-server systemd[1]: target-proc.mount: Deactivated 
successfully.
Mar 08 14:23:46 ubuntu-server subiquity_log.1543[10940]: system install failed 
for ['openssh-server']: Unexpected error while running command.
Mar 08 14:23:46 ubuntu-server subiquity_log.1543[10940]: Command: ['unshare', 
'--fork', '--pid', '--mount-proc=/target/proc', '--', 'chroot', '/target', 
'apt-get', '--quiet', '--assume-yes', 
'--option=Dpkg::options::=--force-unsafe-io', 
'--option=Dpkg::Options::=--force-confold', 'install', 'openssh-server']
Mar 08 14:23:46 ubuntu-server subiquity_log.1543[10940]: Exit code: 100
Mar 08 14:23:46 ubuntu-server subiquity_log.1543[10940]: Reason: -
Mar 08 14:23:46 ubuntu-server subiquity_log.1543[10940]: Stdout: ''
Mar 08 14:23:46 ubuntu-server subiquity_log.1543[10940]: Stderr: ''
Mar 08 14:23:46 ubuntu-server subiquity_log.1543[10940]: finish: 
cmd-system-install: FAIL: curtin command system-install
Mar 08 14:23:46 ubuntu-server curtin_event.1543.10[10940]: finish: 
cmd-system-install: FAIL: curtin command system-install

NOTE that in the example above, the output of curtin system-install was 
redirected to the journal.

This change captures the output of subcommands so that there is something to 
show if a subcommand fails:

system install failed for ['openssh-server']: Unexpected error while running 
command.
Command: ['unshare', '--fork', '--pid', '--mount-proc=/target/proc', '--', 
'chroot', '/target', 'apt-get', '--quiet', '--assume-yes', 
'--option=Dpkg::options::=--force-unsafe-io', 
'--option=Dpkg::Options::=--force-confold', 'install', 'openssh-server']
Exit code: 100
Reason: -
Stdout: Reading package lists...
        Building dependency tree...
        Reading state information...
        openssh-server is already the newest version (1:9.6p1-3ubuntu2).
        0 upgraded, 0 newly installed, 0 to remove and 130 not upgraded.
        1 not fully installed or removed.
        After this operation, 0 B of additional disk space will be used.
        Setting up openssh-server (1:9.6p1-3ubuntu2) ...
        needrestart is being skipped since dpkg has failed

Stderr: E: Can not write log (Is /dev/pts mounted?) - posix_openpt (19: No such 
device)
        Failed to connect to bus: No data available
        dpkg: error processing package openssh-server (--configure):
         installed openssh-server package post-installation script subprocess 
returned error exit status 1
        Errors were encountered while processing:
         openssh-server
        E: Sub-process /usr/bin/dpkg returned an error code (1)

For more details, see:
https://code.launchpad.net/~ogayot/curtin/+git/curtin/+merge/462051
-- 
Your team curtin developers is requested to review the proposed merge of 
~ogayot/curtin:system-install-log-stderr into curtin:master.


-- 
Mailing list: https://launchpad.net/~curtin-dev
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~curtin-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to