#823651 pbuilder: fails with cryptic message when $TMPDIR/$TEMP != /tmp (i.e. libpam-tmpdir)

#823651#5
Date:
2016-05-07 02:03:28 UTC
From:
To:
Dear all,

the recent changes in /tmp handling seem to have made
cowbuilder/pbuilder unable to build any package:

$ cowbuilder --build foobar.dsc
...
 This package was created automatically by pbuilder to satisfy the
  build-dependencies of the package being currently built.
Depends: ....
dpkg-deb: building package 'pbuilder-satisfydepends-dummy' in '/tmp/satisfydepends-aptitude/pbuilder-satisfydepends-dummy.deb'.
dpkg-deb: error: failed to make temporary file (control member): No such file or directory
E: pbuilder-satisfydepends failed.

I am not sure where the fix should be, though.

Thanks

Norbert

#823651#10
Date:
2016-05-07 09:00:58 UTC
From:
To:
control: tag -1 moreinfo unreproducible

There have been no recent changes in /tmp handling.

As you can guess problems like "pbuilder's unable to build any package"
would be kind of spotted before releasing...

This error is the same as the one reported in #576425, a report about
pbuilder not working with libpam-tmpfs.  Are you using libpam-tmpfs?

If not please provide you /etc/pbuilderrc, ~/.pbuilderrc, a full log
with --debug.

#823651#17
Date:
2016-05-07 14:14:14 UTC
From:
To:
Hi Mattia,

No, not even installed.

/etc/pbuilderrc only contains
	MIRRORSITE=http://ftp.jaist.ac.jp/debian/
There is no ~/.pbuilderrc.

debug log created with runing as root
	cowbuilder --build --debug --buildresult . ...dsc
is attached.

All the best

Norbert
------------------------------------------------------------------------ PREINING, Norbert http://www.preining.info JAIST, Japan TeX Live & Debian Developer GPG: 0x860CDC13 fp: F7D8 A928 26E3 16A1 9FA0 ACF0 6CAC A448 860C DC13 ------------------------------------------------------------------------
#823651#22
Date:
2016-05-11 12:03:29 UTC
From:
To:
The problem is that TEMP is set to
	/tmp/user/0/
but this directory does not exist.

$ sudo /usr/sbin/cowbuilder --login
...
I: Obtaining the cached apt archive contents
I: entering the shell
root@wienerschnitzel:/# echo $TEMP
/tmp/user/0
root@wienerschnitzel:/# ls /tmp/user/0
ls: cannot access '/tmp/user/0': No such file or directory
root@wienerschnitzel:/#


This is *bad*, but maybe a problem of cowbuilder? I don't know.

Norbert

#823651#37
Date:
2016-05-11 12:46:07 UTC
From:
To:
Great.  I've been meaning to ask for this some days ago, but for me
these days are totally crazy for me, and eventually forget.

JOOI, how do you happen to have TEMP set like that if you don't use
libpam-tmpdir??

So, this is actually the same problem already reported in 2 other bugs
(that I finally merged); see #576425 and #725434.
Current "workaround" is to add a hook before the build to create that
directory.

Also, downgrading the bug to severity:minor…

#823651#42
Date:
2016-05-11 14:06:58 UTC
From:
To:
Hi Mattia,

Ahhh, no I see ... I searched for libpam-tmpfs (that i what you
mentioned in the first email), and that was not installed, indeed.
OTOH, libpam-tmpdir, yes, that is here.

Interestingly it is marked in aptitude as auto-installed, but
can be removed, and indeed, it came in as recommends from
libpam-ssh.

Well ok, I will cater for it in one way or the other (workaround
or removing libpam-tmpdir).

Sorry for the confusion

All the best

Norbert

#823651#47
Date:
2016-05-11 14:24:27 UTC
From:
To:
bummer.  my fault here :)

Also putting an 'unset TEMP' (and/or TMPDIR) in pbuilderrc should be
enough.

Someday I'll get around to understand what actually fails and fix it.
Probably just having pbuilder mkdir TEMP if not existing would be
enough, or maybe just unsetting that variable.  dunno, I need to
understand better what that thing is in first place...

#823651#52
Date:
2016-05-12 01:41:02 UTC
From:
To:
Hi Mattia,

Just FYI, unsetting only TEMP did not work, I needed also TMPDIR
(but I didn't try whether only TMPDIR also works ;-)

Norbert

#823651#57
Date:
2023-01-15 10:09:11 UTC
From:
To:
metoo, using pbuilder 0.231 on sid.

Regards
Harri

#823651#62
Date:
2023-11-03 15:54:00 UTC
From:
To:
On Debian bookworm:

sudo apt install libpam-tmpdir

is enough to break cowbuilder, which then calls pbuilder.

#823651#67
Date:
2023-11-03 22:18:46 UTC
From:
To:
Patrick Schleizer dixit:

Just unset TMP in a wrapper you do around cowbuilder.
Hasn’t this been reported multiple times already?

In fact, it’s best to only let a whitelist of environment
variables in so your package build is not unexpectedly
changed, so that’s good hygiene anyway.

bye,
//mirabilos