resource-get fails if /tmp and /var are on different file systems

Bug #1751291 reported by George Kraft
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Canonical Juju
Fix Released
High
Vinodhini

Bug Description

If resource-get is called on a system where /tmp and /var are on different file systems, it fails with an error:

ERROR could not download resource: could not replace existing resource directory: rename /tmp/juju-resource-595581070/flannel-amd64 /var/lib/juju/agents/unit-flannel-0/resources/flannel-amd64: invalid cross-device link

The user reporting this used the manual provider. More details in the original report: https://github.com/juju-solutions/charm-flannel/issues/42

Revision history for this message
George Kraft (cynerva) wrote :

User is running Juju 2.3.3:

$ juju version
2.3.3-xenial-amd64

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 1751291] Re: resource-get fails if /tmp and /var are on different file systems

I poked around a bit. The code assumes that it can rename the resource into
place from temp.
It should probably handle moving between filesystems or downloading into
the target dir under a temp name.

John
=:->

On Feb 26, 2018 18:05, "George Kraft" <email address hidden> wrote:

> User is running Juju 2.3.3:
>
> $ juju version
> 2.3.3-xenial-amd64
>
> --
> You received this bug notification because you are subscribed to juju.
> Matching subscriptions: juju bugs
> https://bugs.launchpad.net/bugs/1751291
>
> Title:
> resource-get fails if /tmp and /var are on different file systems
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/juju/+bug/1751291/+subscriptions
>

John A Meinel (jameinel)
Changed in juju:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Gábor Mészáros (gabor.meszaros) wrote :

I got hit by this issue when deploying contrail-controller application.

tags: added: 4010 cpe-onsite
Revision history for this message
Gábor Mészáros (gabor.meszaros) wrote :

The issue probably is that resources context Move uses os.Rename system call (resource/context/context.go:#139:
func (deps contextDeps) Move(target, source string) error {
        // Note that we follow the io.Copy() argument arder here
        // (os.Rename does not).
        return os.Rename(source, target)
}

This under ubuntu does not support moving files across file systems. From man 2 rename:
  EXDEV oldpath and newpath are not on the same mounted filesystem. (Linux permits a filesystem to be mounted at multiple
          points, but rename() does not work across different mount points, even if the same filesystem is mounted on both.)

Tim Penhey (thumper)
tags: added: resources
Ian Booth (wallyworld)
Changed in juju:
milestone: none → 2.4-beta2
Ian Booth (wallyworld)
Changed in juju:
assignee: nobody → Vinodhini (vinu-b)
Changed in juju:
milestone: 2.4-beta2 → none
Revision history for this message
Jason Hobbs (jason-hobbs) wrote :

Subscribed to field-high SLA - this is being hit onsite.

Ian Booth (wallyworld)
Changed in juju:
importance: Medium → High
Ian Booth (wallyworld)
Changed in juju:
milestone: none → 2.3.8
milestone: 2.3.8 → 2.4-rc1
Revision history for this message
Sandor Zeestraten (szeestraten) wrote :

Hey Vinodhini, I think the comment in #6 was supposed to be in #1634390.

Revision history for this message
Vinodhini (vinu-b) wrote :

Thats correct. Thanks Sandor.

Ian Booth (wallyworld)
Changed in juju:
status: Triaged → In Progress
Revision history for this message
Vinodhini (vinu-b) wrote :
Changed in juju:
status: In Progress → Fix Committed
Changed in juju:
status: Fix Committed → Fix Released
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.