Package: rsyslog-pgsql
Version: 8.2102.0-2
Severity: minor

Dear Maintainer,

The postinst script fails under certain conditions due to the lack of
error handling in dbc_postinst_cleanup with a non-zero exit code:

Output with `set -x` set:

#+BEGIN_SRC

+ IFS=                                     
+ printf %s\n RESET rsyslog-pgsql/app-password-confirm          
+ IFS=                                                       

+ read -r _db_internal_line
+ IFS=                                                    

+ RET=10 rsyslog-pgsql/app-password-confirm doesn't exist     
+ return 10                                                
+ true                                       
+ db_fset rsyslog-pgsql/app-password-confirm seen false
+ _db_cmd FSET rsyslog-pgsql/app-password-confirm seen false
+ _db_internal_IFS=                        

+ IFS=                                                       
+ printf %s\n FSET rsyslog-pgsql/app-password-confirm seen false
+ IFS=

+ read -r _db_internal_line                
+ IFS=                                                          

+ RET=10 rsyslog-pgsql/app-password-confirm doesn't exist
+ return 10
+ true                                                    
+ db_reset rsyslog-pgsql/internal/skip-preseed
+ _db_cmd RESET rsyslog-pgsql/internal/skip-preseed
+ _db_internal_IFS=

+ IFS=       
+ printf %s\n RESET rsyslog-pgsql/internal/skip-preseed
+ IFS=       

+ read -r _db_internal_line
+ IFS=

+ RET=10 rsyslog-pgsql/internal/skip-preseed doesn't exist
+ return 10
+ db_reset rsyslog-pgsql/internal/reconfiguring
+ _db_cmd RESET rsyslog-pgsql/internal/reconfiguring
+ _db_internal_IFS=

+ IFS=
+ printf %s\n RESET rsyslog-pgsql/internal/reconfiguring
+ IFS=

+ read -r _db_internal_line
+ IFS=

+ RET=10 rsyslog-pgsql/internal/reconfiguring doesn't exist
+ return 10
+ return 10
dpkg: error processing package rsyslog-pgsql (--configure):
 installed rsyslog-pgsql package post-installation script subprocess returned 
error exit status 10

#+END_SRC

the last successful running part of the postinst script is the calling
of dbc_forget_app_password(), dbc_postinst_cleanup() is where 10 as an
exit code is returned and where the script fails.

As far as I can tell the error occurs because:

* db_reset $dbc_package/internal/reconfiguring returns 10, but the
  script fails to catch this by either appending || true nor by
  returning 0 at the end of the function.
* I also noticed that on systems where the postinst script is broken
  debconf does not hold any entries corresponding to the package;
  which may point into the right direction for a possible fix.

-- System Information:
Debian Release: 11.3
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable-security'), (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 5.10.0-13-amd64 (SMP w/2 CPU threads)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_GB:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages rsyslog-pgsql depends on:
ii  dbconfig-common        2.0.19
ii  debconf [debconf-2.0]  1.5.77
ii  libc6                  2.31-13+deb11u3
ii  libpq5                 13.5-0+deb11u1
ii  rsyslog                8.2102.0-2
ii  ucf                    3.0043

Versions of packages rsyslog-pgsql recommends:
ii  postgresql-client                         13+225
ii  postgresql-client-13 [postgresql-client]  13.5-0+deb11u1

Versions of packages rsyslog-pgsql suggests:
ii  postgresql  13+225

-- debconf information excluded

Reply via email to