package should handle empty dbfile better

Bug #2008144 reported by timeless
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
dbconfig-common (Ubuntu)
New
Undecided
Unassigned

Bug Description

I performed a `do-release-upgrade` from `bionic` to `focal` and had `roundcube` partially configured w/ `mysql` (or maria or whatever, dunno, it was ages ago).

Some excerpts from `/var/log/dist-upgrade/screenlog.0`:

```
Unpacking dbconfig-common (2.0.9) over (2.0.4ubuntu1) ...
```

```
creating database backup in /var/cache/dbconfig-common/backups/roundcube_1.2~beta+dfsg.1-0ubuntu1.2019-03-05-21.12.19.
applying upgrade sql for 1.2~beta+dfsg.1-0ubuntu1 -> 1.2.0-1.
error encountered processing /usr/share/dbconfig-common/data/roundcube/upgrade/mysql/1.2.0-1:
mysql said: ERROR 1060 (42S21) at line 2: Duplicate column name 'failed_login'
An error occurred while upgrading the database:

mysql said: ERROR 1060 (42S21) at line 2: Duplicate column name 'failed_login'
```

```
dbconfig-common: writing config to /etc/dbconfig-common/roundcube.conf
applying upgrade sql for 1.3.6+dfsg.1-1 -> 1.4.1-1.
error encountered processing /usr/share/dbconfig-common/data/roundcube/upgrade/mysql/1.4.1-1:
mysql said: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
ESC[?1049hESC[?1hESC=ESC[1;25rESC[4lESC[?25lESC[mESC[37mESC[40mESC[1;25rESC[HESC[JESC[1;1HESC[1mESC[37mESC[45m
```

Here's what I saw on my screen:

```
Package configuration

  ┌────────────────────────────────────────────────────────────────────────┤ Configuring roundcube-core ├─────────────────────────────────────────────────────────────────────────┐
  │ │
  │ An error occurred while upgrading the database:
  │
  │ mysql said: ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2)
  │
  │ Fortunately, should hold a backup of the database, made just before the upgrade (unless the error occurred during backup creation, in which case no changes will have been
  │ applied yet). Your options are:
  │ * abort - Causes the operation to fail; you will need to downgrade,
  │ reinstall, reconfigure this package, or otherwise manually intervene
  │ to continue using it. This will usually also impact your ability to
  │ install other packages until the installation failure is resolved.
  │ * retry - Prompts once more with all the configuration questions
  │ (including ones you may have missed due to the debconf priority
  │ setting) and makes another attempt at performing the operation.
  │ * retry (skip questions) - Immediately attempts the operation again,
  │ skipping all questions. This is normally useful only if you have
  │
  │ <Ok>
  │ │
  └───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────┘
```

According to:
https://github.com/deepin-community/dbconfig-common/blob/792a7961fb442be3e8aed39cc2b1f93a3073b8a6/debian/dbconfig-common.templates#L175

the relevant text is:
```
Fortunately, ${dbfile} should hold a backup of the database, made just before
```

Whatever part of `dbconfig-common` is responsible for displaying this text should confirm it has a `${dbfile}` before it goes off and displays this text (or perhaps before it goes down the path that leads to displaying this text).

My current version is:
dbconfig-common 2.0.22~pgdg18.04+1

```
# lsb_release -rd
Description: Ubuntu 20.04.5 LTS
Release: 20.04
```

```
# apt-cache policy dbconfig-common
dbconfig-common:
  Installed: 2.0.22~pgdg18.04+1
  Candidate: 2.0.22~pgdg18.04+1
  Version table:
 *** 2.0.22~pgdg18.04+1 100
        100 /var/lib/dpkg/status
     2.0.13 500
        500 http://us-east1.gce.archive.ubuntu.com/ubuntu focal/universe amd64 Packages
```

(But note that this may not have been the current version at the time of the instance... it's a bit hard for me to tell from the logs I have. That said, I doubt that the code has significantly changed.)

Expected results
1. Ensure strings that should have values have values before using them
2. Include quotes around such strings (even seeing ` "" ` is better than seeing ` ` as it hints that there's a problem)

Actual results
```
Fortunately, should hold a backup of the database, made just before the upgrade (unless the error occurred during backup creation, in which case no changes will have been
applied yet). Your options are:
```

Revision history for this message
Seth Arnold (seth-arnold) wrote :

Weird, launchpad ate the tell-tale double spaces!

"Fortunately, should hold a backup of the database"
originally looked like:
"Fortunately, should hold a backup of the database"

(two spaces after ","). timeless shared the pastebins with me while fighting this.

Revision history for this message
Seth Arnold (seth-arnold) wrote :

Heh, it looks like it ate the double-spaces in my comment, too.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.