archive uploader tries to move the changelog to the current working directory

Bug #595957 reported by Michael Nelson
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
High
Aaron Bentley

Bug Description

It looks like the code in:

lp.archiveuploader.dscfile.DSCFile.unpackAndCheckSource() calls findAndMoveChangelog() to move the changelog from the temp directory into the *current working directory*.

Looking at the code, it stores the changes file there and then uploads it later to the librarian from that location (during storeInDatabase).

We should store the file somewhere else for uploading to the librarian.

Related branches

Revision history for this message
Michael Nelson (michael.nelson) wrote :

BTW: this was only noticed because moving to the current working directory fails for source package recipe build uploads:

http://launchpadlibrarian.net/50538687/upload_51_log.txt

description: updated
Changed in soyuz:
status: Confirmed → Triaged
Revision history for this message
Michael Nelson (michael.nelson) wrote :

One idea for why this only affects SPRecipe builds is that it is only SPRecipeBuilds that call process-upload on a source package when the CWD is the LP code root directory.

Revision history for this message
Aaron Bentley (abentley) wrote :

All references to process-upload that I can find (including on lp-production-configs) invoke it as "scripts/process-upload.py". This suggests they all call process-upload when the CWD is the LP code root directory. Perhaps germanium has looser permissions on its launchpad tree?

Revision history for this message
Michael Nelson (michael.nelson) wrote :

Aaron, that was what I thought initially, but I had a losa check germanium's launchpad root for a changelog and:

{{{
17:02 < Chex> noodles: germanium:/srv/launchpad.net/codelines/current$ ls -la changelog : cannot access changelog: No such file or directory
}}}

Whereas on dogfood and my local directory where I was testing the SPRecipeBuilds there is a changelog in the launchpad root for the last SPRecipe build that I'd run).

Additionally, afaik prior to SPRecipeBuilds process-upload was only called with sourcepackages with a cron invoked with: "/srv/launchpad.net/codelines/current/scripts/process-upload.py" as the lp_queue user.

I think it's a bug (or just wrong) that the file is being saved to the CWD just to be uploaded. If there's a quick permission fix to enable the SPRecipe builds to be uploaded - great (although I don't think it should be granting write access to the lp code root!), but otherwise I think we should instead update unpackAndCheckSource() to check the changelog by moving it to a separate *tmp* directory, and upload it to the librarian from there.

Revision history for this message
Aaron Bentley (abentley) wrote : Re: [Bug 595957] Re: archive uploader tries to move the changelog to the current working directory

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 06/21/2010 03:03 AM, Michael Nelson wrote:
> Additionally, afaik prior to SPRecipeBuilds process-upload was only
> called with sourcepackages with a cron invoked with:
> "/srv/launchpad.net/codelines/current/scripts/process-upload.py" as the
> lp_queue user.

Ah. It's misleading, then, that the behaviour is defined in a base class.

> I think it's a bug (or just wrong) that the file is being saved to the
> CWD just to be uploaded.

Agreed.

> If there's a quick permission fix to enable the
> SPRecipe builds to be uploaded - great (although I don't think it should
> be granting write access to the lp code root!)

I think that granting write access to the lp code root would be the only
possible permission fix.

We could update the way we invoke the script so that it runs in a temp
directory. That would be a hack, but it would mirror the way it works
on germanium, so I'd expect it to work.

>, but otherwise I think we
> should instead update unpackAndCheckSource() to check the changelog by
> moving it to a separate *tmp* directory, and upload it to the librarian
> from there.

Yes, I think this is the right solution.

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwfZ8YACgkQ0F+nu1YWqI2SsACfb+ggRV6aN0xJ5qI2HR1o1NVR
hIQAmwbXhas9WIvhHQ48HPqKl9y13bk7
=Bsjk
-----END PGP SIGNATURE-----

Revision history for this message
Ursula Junque (ursinha) wrote : Bug fixed by a commit
Changed in soyuz:
assignee: nobody → Aaron Bentley (abentley)
milestone: none → 10.07
tags: added: qa-needstesting
Changed in soyuz:
status: Triaged → Fix Committed
Revision history for this message
Julian Edwards (julian-edwards) wrote :

Just uploaded some stuff on dogfood to test this, and I'm still getting a changelog file in the CWD.

tags: added: qa-bad
removed: qa-needstesting
Curtis Hovey (sinzui)
Changed in soyuz:
status: Fix Committed → Fix Released
Revision history for this message
Launchpad QA Bot (lpqabot) wrote :
Changed in soyuz:
milestone: 10.07 → 10.08
tags: added: qa-needstesting
removed: qa-bad
Ursula Junque (ursinha)
Changed in soyuz:
status: Fix Released → Fix Committed
tags: added: qa-ok
removed: qa-needstesting
Changed in soyuz:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers