[From nobody Thu Jul 23 11:19:05 2026
Received: (at submit) by bugs.debian.org; 10 Nov 2022 01:01:12 +0000
X-Spam-Checker-Version: SpamAssassin 3.4.6-bugs.debian.org_2005_01_02
 (2021-04-09) on buxtehude.debian.org
X-Spam-Level: 
X-Spam-Status: No, score=-12.1 required=4.0 tests=BAYES_00,DKIM_SIGNED,
 DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FOURLA,HAS_PACKAGE,PGPSIGNATURE,
 RCVD_IN_SBLXBL,RCVD_IN_SBLXBL_CBL,SPF_HELO_NONE,SPF_PASS autolearn=ham
 autolearn_force=no version=3.4.6-bugs.debian.org_2005_01_02
X-Spam-Bayes: score:0.0000 Tokens: new, 187; hammy, 150; neutral, 232; spammy,
 0. spammytokens: hammytokens:0.000-+--bookworm,
 0.000-+--H*ct:application, 0.000-+--H*ct:protocol,
 0.000-+--H*ct:micalg, 0.000-+--H*ct:signed
Return-path: &lt;sandals@crustytoothpaste.net&gt;
Received: from ring.crustytoothpaste.net
 ([2600:3c04::f03c:92ff:fe9e:c6d8]:55024)
 by buxtehude.debian.org with esmtps
 (TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256)
 (Exim 4.94.2) (envelope-from &lt;sandals@crustytoothpaste.net&gt;)
 id 1osvwO-007bSt-8U
 for submit@bugs.debian.org; Thu, 10 Nov 2022 01:01:12 +0000
Received: from tapette.crustytoothpaste.net (unknown
 [IPv6:2001:470:b056:101:e59a:3ed0:5f5c:31f3])
 (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits))
 (No client certificate requested)
 by ring.crustytoothpaste.net (Postfix) with ESMTPSA id 0FA355A1AC;
 Thu, 10 Nov 2022 00:54:36 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=crustytoothpaste.net;
 s=default; t=1668041676;
 bh=DkO1WRuC7ZGELUyRLxyoOJ4urDBtRWD1HXwRaNOA9zw=;
 h=Date:From:To:Subject:Content-Type:Content-Disposition:From:
 Reply-To:Subject:Date:To:CC:Resent-Date:Resent-From:Resent-To:
 Resent-Cc:In-Reply-To:References:Content-Type:Content-Disposition;
 b=xjzYPFFsydfvOc7S5qvOLhP2MNGk/gR9zv2bkdHGGse8gb6hhujJKqxXoL2mAPoMy
 O7jN4wkb8TH3pKlwF52z5tY/NnlkVfRpuc3tAsPGrIrI2qm2F2eUqzJCXo1mELg4B+
 /2PnV7m4xdsdgSdZ337noZGwyd18rpNy9RrbVwLEpz1OB6LEajae883PfKgiKIeDTR
 MQBIMtvJSqrp3ktHWoxO2h9YFskV3sy/kQBQJWsgXswo/rBnUjCMJhl4dDkELoMgPn
 6XLTVcjyPeT7Gf2uqXDeRudDw2obRuNqelcr3BAczD0VOliHwrHBsNjFEmuEvOiBaG
 BzNTpYlpwH7pNgwYSGBXQuBb9xUL8svK5g/GZkj+nLvs+VLu54KOZ4MP92qZzxmor9
 G8JVbaye2vCjMfoLg8j6v7RThWlryWF2PEQZsuS2r0UBQU7Tf+J6QosHWln6SV/auY
 t+Rl4AfK4HBmg6gTlD0qL6wA3G10yfNiJ5PzDKZw/mxvj1b08Ih
Date: Thu, 10 Nov 2022 00:54:34 +0000
From: &quot;brian m. carlson&quot; &lt;sandals@crustytoothpaste.net&gt;
To: Debian Bug Tracking System &lt;submit@bugs.debian.org&gt;
Subject: mysql-server-8.0: fails to restart on upgrade with libpam-tmpdir
Message-ID: &lt;Y2xLylfKj34Fbaou@tapette.crustytoothpaste.net&gt;
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-sha512;
 protocol=&quot;application/pgp-signature&quot;; boundary=&quot;gImHcSpn5qs1eHNh&quot;
Content-Disposition: inline
X-Reportbug-Version: 11.5.1
User-Agent: Mutt/2.2.7 (2022-08-07)
X-Greylist: delayed 391 seconds by postgrey-1.36 at buxtehude;
 Thu, 10 Nov 2022 01:01:11 UTC
Delivered-To: submit@bugs.debian.org


--gImHcSpn5qs1eHNh
Content-Type: text/plain; charset=utf-8
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Package: mysql-server-8.0
Version: 8.0.30-1+b2
Severity: normal

On my systems, I use libpam-tmpdir, which provides each user with a
private temporary directory owned and accessible only by them under
/tmp/user/UID (e.g., /tmp/user/1000).  PAM sets the TMPDIR variable to
this value upon creating a session.

When I upgrade mysql-server-8.0, it is obviously as root, so TMPDIR is
set to /tmp/user/0.  This value does not work since MySQL doesn't run as
root, and so MySQL fails to start after upgrade in such a configuration,
like so:

  2022-09-28T19:02:43.113663Z 0 [System] [MY-010116] [Server] /usr/sbin/mys=
qld (mysqld 8.0.30-1) starting as process 134423
  2022-09-28T19:02:43.156068Z 1 [System] [MY-011012] [Server] Starting upgr=
ade of data directory.
  2022-09-28T19:02:43.156091Z 1 [System] [MY-013576] [InnoDB] InnoDB initia=
lization has started.
  mysqld: Can't create/write to file '/tmp/user/0/ibafhFAQ' (OS errno 13 - =
Permission denied)
  2022-09-28T19:02:44.224787Z 1 [ERROR] [MY-012576] [InnoDB] Unable to crea=
te temporary file inside &quot;/tmp/user/0&quot;; errno: 13
  2022-09-28T19:02:44.224823Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initial=
ization aborted with error Generic error.
  2022-09-28T19:02:44.224856Z 1 [ERROR] [MY-011013] [Server] Failed to init=
ialize DD Storage Engine.
  2022-09-28T19:02:44.225102Z 0 [ERROR] [MY-010020] [Server] Data Dictionar=
y initialization failed.
  2022-09-28T19:02:44.225217Z 0 [ERROR] [MY-010119] [Server] Aborting
  2022-09-28T19:02:44.226017Z 0 [System] [MY-010910] [Server] /usr/sbin/mys=
qld: Shutdown complete (mysqld 8.0.30-1)  (Debian).
  2022-10-17T13:26:08.726136Z 0 [System] [MY-010116] [Server] /usr/sbin/mys=
qld (mysqld 8.0.30-1+b1) starting as process 36399
  2022-10-17T13:26:08.755895Z 1 [System] [MY-013576] [InnoDB] InnoDB initia=
lization has started.
  mysqld: Can't create/write to file '/tmp/user/0/ibJujAnM' (OS errno 13 - =
Permission denied)
  2022-10-17T13:26:09.299586Z 1 [ERROR] [MY-012576] [InnoDB] Unable to crea=
te temporary file inside &quot;/tmp/user/0&quot;; errno: 13
  2022-10-17T13:26:09.299605Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initial=
ization aborted with error Generic error.
  2022-10-17T13:26:09.299625Z 1 [ERROR] [MY-010334] [Server] Failed to init=
ialize DD Storage Engine
  2022-10-17T13:26:09.299737Z 0 [ERROR] [MY-010020] [Server] Data Dictionar=
y initialization failed.
  2022-10-17T13:26:09.299751Z 0 [ERROR] [MY-010119] [Server] Aborting
  2022-10-17T13:26:09.300393Z 0 [System] [MY-010910] [Server] /usr/sbin/mys=
qld: Shutdown complete (mysqld 8.0.30-1+b1)  (Debian).
  2022-11-09T21:40:40.722163Z 0 [System] [MY-010116] [Server] /usr/sbin/mys=
qld (mysqld 8.0.30-1+b2) starting as process 110969
  2022-11-09T21:40:40.731948Z 1 [System] [MY-013576] [InnoDB] InnoDB initia=
lization has started.
  mysqld: Can't create/write to file '/tmp/user/0/iby1UOtJ' (OS errno 13 - =
Permission denied)
  2022-11-09T21:40:41.516120Z 1 [ERROR] [MY-012576] [InnoDB] Unable to crea=
te temporary file inside &quot;/tmp/user/0&quot;; errno: 13
  2022-11-09T21:40:41.516155Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initial=
ization aborted with error Generic error.
  2022-11-09T21:40:41.516191Z 1 [ERROR] [MY-010334] [Server] Failed to init=
ialize DD Storage Engine
  2022-11-09T21:40:41.516337Z 0 [ERROR] [MY-010020] [Server] Data Dictionar=
y initialization failed.
  2022-11-09T21:40:41.516362Z 0 [ERROR] [MY-010119] [Server] Aborting
  2022-11-09T21:40:41.517553Z 0 [System] [MY-010910] [Server] /usr/sbin/mys=
qld: Shutdown complete (mysqld 8.0.30-1+b2)  (Debian).

It's probably appropriate to sanitize the environment somewhat before
starting MySQL to avoid this problem.  For example, in my testing, `sudo
env -u TMPDIR dpkg-reconfigure mysql-server-8.0` causes the server to
restart properly, but there may be other environment variables that may
result in undesired behaviour.

Note that all of this is from another system, so none of the usual
information is relevant below.

-- System Information:
Debian Release: bookworm/sid
  APT prefers stable-security
  APT policy: (500, 'stable-security'), (500, 'unstable'), (500, 'stable'),=
 (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 6.0.0-2-amd64 (SMP w/20 CPU threads; PREEMPT)
Kernel taint flags: TAINT_USER, TAINT_WARN
Locale: LANG=3Den_CA.UTF-8, LC_CTYPE=3Den_CA.UTF-8 (charmap=3DUTF-8), LANGU=
AGE=3Den_CA:en
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages mysql-server-8.0 depends on:
ii  adduser                    3.129
ii  debconf [debconf-2.0]      1.5.79
pn  mysql-client-8.0           &lt;none&gt;
ii  mysql-common               5.8+1.0.8
pn  mysql-server-core-8.0      &lt;none&gt;
ii  passwd                     1:4.12.3+dfsg1-3
ii  perl                       5.36.0-4
ii  psmisc                     23.5-3
ii  sysvinit-utils [lsb-base]  3.05-6

Versions of packages mysql-server-8.0 recommends:
pn  libhtml-template-perl  &lt;none&gt;
pn  mecab-ipadic-utf8      &lt;none&gt;

Versions of packages mysql-server-8.0 suggests:
ii  bsd-mailx [mailx]  8.1.2-0.20220412cvs-1
pn  tinyca             &lt;none&gt;

--=20
brian m. carlson (he/him or they/them)
Toronto, Ontario, CA

--gImHcSpn5qs1eHNh
Content-Type: application/pgp-signature; name=&quot;signature.asc&quot;

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.2.40 (GNU/Linux)

iHUEABYKAB0WIQQILOaKnbxl+4PRw5F8DEliiIeigQUCY2xLygAKCRB8DEliiIei
gV7aAP43Li0/HJsALoLYV7FsSJ3OKXUePCj0OQzTj9ETApnE2gEAkgzAnCAqUn8P
v6ZikYy0caeRTyjbt32w7UcTnUmlXAE=
=q5cY
-----END PGP SIGNATURE-----

--gImHcSpn5qs1eHNh--
]