** Description changed:

- Not sure if it's relevant, by my mariadb data dir is on a secondary hard
- drive. /var/lib/mysql-upgrade/DATADIR.link points to the right path.
+ Upgrade fails if datadir is a symlink and the server has previously been
+ upgraded with datadir as a symlink
+ 
+ [Impact]
+ When upgrading, postinst makes a copy (with -d) of the datadir link to ensure 
it's preserved. This copy operation can fail in some situations if the 
destination already exists (because the package was previously upgraded with a 
similar situation), causing d/preinst to fail every time the user tries to 
upgrade the package unless they manually remove the old link every time.
+ 
+ The fix adds a -T to the copy operation, treating the destination as a
+ regular file to be overwritten
+ 
+ [Test case]
+ * Create a /var/lib/mysql that is a symlink to some other location
+ * Install an older version of mysql-server
+ * Upgrade to a newer version of mysql-server
+ 
+ [Regression potential]
+ This change has been in Yakkety for some time (5.7.15-0ubuntu2).
+ 
+ The change only affects user with datadirs that are symlinks, and only a
+ file copy operation for a file that's generally not used (it's backed up
+ just in case)
+ 
+ [Original Description]
+ Not sure if it's relevant, by my mariadb data dir is on a secondary hard 
drive. /var/lib/mysql-upgrade/DATADIR.link points to the right path.
  
  This is the terminal output for apt-get dist-upgrade:
  
  Selecting previously unselected package mariadb-server-10.0.
  (Reading database ... 274672 files and directories currently installed.)
  Preparing to unpack 
.../mariadb-server-10.0_10.0.20-0ubuntu0.15.04.1_amd64.deb ...
  cp: cannot overwrite directory ‘/var/lib/mysql-upgrade/DATADIR.link/mysql’ 
with non-directory
  dpkg: error processing archive 
/var/cache/apt/archives/mariadb-server-10.0_10.0.20-0ubuntu0.15.04.1_amd64.deb 
(--unpack):
-  subprocess new pre-installation script returned error exit status 1
+  subprocess new pre-installation script returned error exit status 1
  + . /usr/share/debconf/confmodule
  ++ '[' '!' '' ']'
  ++ PERL_DL_NONLAZY=1
  ++ export PERL_DL_NONLAZY
  ++ '[' '' ']'
  ++ exec /usr/share/debconf/frontend 
/var/lib/dpkg/info/mariadb-server-10.0.postinst abort-upgrade 
10.0.20-0ubuntu0.15.04.1
  + . /usr/share/debconf/confmodule
  ++ '[' '!' 1 ']'
  ++ '[' -z '' ']'
  ++ exec
  ++ '[' '' ']'
  ++ exec
  ++ DEBCONF_REDIR=1
  ++ export DEBCONF_REDIR
  + '[' -n '' ']'
  + export 
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/usr/sbin:/bin:/usr/bin
  + 
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/sbin:/usr/sbin:/bin:/usr/bin
  + ERR_LOGGER='logger -p daemon.err -t mysqld_safe -i'
  + set -o pipefail
  + MYSQL_BOOTSTRAP='/usr/sbin/mysqld --bootstrap --user=mysql 
--skip-grant-tables --default-storage-engine=myisam 
--plugin-load-add=auth_socket'
  + set +e
  + invoke stop
  + '[' -x /usr/sbin/invoke-rc.d ']'
  + invoke-rc.d mysql stop
  + set -e
  + case "$1" in
  + '[' abort-upgrade = configure ']'
  + db_stop
  + echo STOP
  + '[' -x /etc/init.d/mysql ']'
  + update-rc.d mysql defaults 19 21
  + '[' -x /etc/init.d/mysql ']'
  + echo 'Invoking mysql start'
  + logger -p daemon.err -t mysqld_safe -i
  + invoke-rc.d mysql start
  + exit 0
  Preparing to unpack .../mariadb-server_10.0.20-0ubuntu0.15.04.1_all.deb ...
  Unpacking mariadb-server (10.0.20-0ubuntu0.15.04.1) over (10.0.17-0ubuntu1) 
...
  Errors were encountered while processing:
-  
/var/cache/apt/archives/mariadb-server-10.0_10.0.20-0ubuntu0.15.04.1_amd64.deb
+  
/var/cache/apt/archives/mariadb-server-10.0_10.0.20-0ubuntu0.15.04.1_amd64.deb
  E: Sub-process /usr/bin/dpkg returned an error code (1)
  
  ProblemType: Package
  DistroRelease: Ubuntu 15.04
  Package: mariadb-server-10.0 10.0.17-0ubuntu1
  ProcVersionSignature: Ubuntu 3.19.0-22.22-generic 3.19.8-ckt1
  Uname: Linux 3.19.0-22-generic x86_64
  ApportVersion: 2.17.2-0ubuntu1.1
  Architecture: amd64
  Date: Tue Jul 14 08:07:15 2015
  DpkgTerminalLog:
-  Preparing to unpack 
.../mariadb-server-10.0_10.0.20-0ubuntu0.15.04.1_amd64.deb ...
-  cp: cannot overwrite directory ‘/var/lib/mysql-upgrade/DATADIR.link/mysql’ 
with non-directory
-  dpkg: error processing archive 
/var/cache/apt/archives/mariadb-server-10.0_10.0.20-0ubuntu0.15.04.1_amd64.deb 
(--unpack):
-   subprocess new pre-installation script returned error exit status 1
+  Preparing to unpack 
.../mariadb-server-10.0_10.0.20-0ubuntu0.15.04.1_amd64.deb ...
+  cp: cannot overwrite directory ‘/var/lib/mysql-upgrade/DATADIR.link/mysql’ 
with non-directory
+  dpkg: error processing archive 
/var/cache/apt/archives/mariadb-server-10.0_10.0.20-0ubuntu0.15.04.1_amd64.deb 
(--unpack):
+   subprocess new pre-installation script returned error exit status 1
  DuplicateSignature: package:mariadb-server-10.0:10.0.17-0ubuntu1:subprocess 
new pre-installation script returned error exit status 1
  ErrorMessage: subprocess new pre-installation script returned error exit 
status 1
  InstallationDate: Installed on 2015-01-15 (180 days ago)
  InstallationMedia: Ubuntu 14.10 "Utopic Unicorn" - Release amd64 (20141022.1)
  RelatedPackageVersions:
-  dpkg 1.17.25ubuntu1
-  apt  1.0.9.7ubuntu4
+  dpkg 1.17.25ubuntu1
+  apt  1.0.9.7ubuntu4
  SourcePackage: mariadb-10.0
  Title: package mariadb-server-10.0 10.0.17-0ubuntu1 failed to 
install/upgrade: subprocess new pre-installation script returned error exit 
status 1
  UpgradeStatus: Upgraded to vivid on 2015-05-27 (47 days ago)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1474212

Title:
  Upgrade fails when /var/lib/mysql is a soft link

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/mariadb-10.0/+bug/1474212/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to