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

Bug #1751291 reported by George Kraft on 2018-02-23
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
juju
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

George Kraft (cynerva) wrote :

User is running Juju 2.3.3:

$ juju version
2.3.3-xenial-amd64

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) on 2018-03-13
Changed in juju:
importance: Undecided → Medium
status: New → Triaged

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

tags: added: 4010 cpe-onsite

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) on 2018-04-25
tags: added: resources
Ian Booth (wallyworld) on 2018-04-25
Changed in juju:
milestone: none → 2.4-beta2
Ian Booth (wallyworld) on 2018-04-27
Changed in juju:
assignee: nobody → Vinodhini (vinu-b)
Changed in juju:
milestone: 2.4-beta2 → none
Jason Hobbs (jason-hobbs) wrote :

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

Ian Booth (wallyworld) on 2018-05-11
Changed in juju:
importance: Medium → High
Ian Booth (wallyworld) on 2018-05-11
Changed in juju:
milestone: none → 2.3.8
milestone: 2.3.8 → 2.4-rc1
Sandor Zeestraten (szeestraten) wrote :

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

Vinodhini (vinu-b) wrote :

Thats correct. Thanks Sandor.

Ian Booth (wallyworld) on 2018-05-15
Changed in juju:
status: Triaged → In Progress
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  Edit
Everyone can see this information.

Other bug subscribers