Why is mount -a not mounting fuse drive properly when executed remotely (via Fabric)?

Posted by Jim D on Server Fault See other posts from Server Fault or by Jim D
Published on 2011-03-15T15:40:15Z Indexed on 2011/03/15 16:12 UTC
Read the original article Hit count: 295

Filed under:
|

This is a weird bug and I'm not sure where it's coming from. Here's a quick run down of what I'm doing.

I'm trying to mount a FUSE drive to an Amazon EC2 instance running Ubuntu 10.10 using s3fs (FUSE over Amazon). s3fs is compiled from source according to the instructions etc. I've also added an entry to /etc/fstab so that the drive mounts on boot. Here's what /etc/fstab looks like:

# /etc/fstab: static file system information.
# <file system>                                 <mount point>   <type>  <options>       <dump>  <pass>
proc                                            /proc           proc    nodev,noexec,nosuid 0       0
LABEL=uec-rootfs                                       /               ext4    defaults        0       0
/dev/sda2   /mnt    auto    defaults,nobootwait,comment=cloudconfig 0   2
/dev/sda3   none    swap    sw,comment=cloudconfig  0   0
s3fs#mybucket /mnt/s3/mybucket fuse default_acl=public-read,use_cache=/tmp,allow_other 0 0

So the good news is that this works fine. On reboot the connection mounts correctly. I can also do:

$ sudo umount /mnt/s3/mybucket 
$ sudo mount -a
$ mountpoint /mnt/s3/mybucket 
/mnt/s3/mybucket is a mountpoint

Great, right?

Well here's the problem. I'm using Fabric to automate the process of building and managing this instance. I noticed I was getting this error message when using Fabric to build s3fs and set up the mount process:

mountpoint: /mnt/s3/mybucket: Transport endpoint is not connected

I isolated it down the the problem and built a fabric task that reproduces the problem:

def remount_s3fs():
    sudo("mount -a")

Which does:

[ec2-xx-xx-xx-xx.compute-1.amazonaws.com] Executing task 'remount_s3fs'
[ec2-xx-xx-xx-xx.compute-1.amazonaws.com] sudo: mount -a

[And yes, I was sure to unmount it before running this task.] When I check the mount using mountpoint I get:

$ mountpoint /mnt/s3/mybucket
mountpoint: /mnt/s3/mybucket: Transport endpoint is not connected

Done.

But if I run sudo mount -a at the command line, it works. Hrm.

Here is that fab task output again, this time in full debug mode:

[ec2-xx-xx-xx-xx.compute-1.amazonaws.com] Executing task 'remount_s3fs'
[ec2-xx-xx-xx-xx.compute-1.amazonaws.com] sudo: sudo -S -p 'sudo password:'  /bin/bash -l -c "mount -a"

Again, I get that transport endpoint not connected error. I've also tried copying and pasting the exact command run into my ssh session (i.e. sudo -S -p 'sudo password:' /bin/bash -l -c "mount -a") and it works fine.

So...that's my problem. Any ideas?

© Server Fault or respective owner

Related posts about fuse

Related posts about fabric

  • Windows Azure Learning Plan - Application Fabric

    as seen on SQL Blog - Search for 'SQL Blog'
    This is one in a series of posts on a Windows Azure Learning Plan. You can find the main post here. This one deals with the Application Fabric for Windows Azure. It serves three main purposes - Access Control, Caching, and as a Service Bus.   Overview and Training Overview… >>> More

  • fabric and svn password

    as seen on Stack Overflow - Search for 'Stack Overflow'
    Assuming that I cannot run something like this with Fabric: run("svn update --password 'password' .") how's the proper way to pass to Fabric the password for the remote interactive command line? I am not sure, but the svn server we're using might have some restrictions to not allow --non-interactive… >>> More

  • Python Fabric error

    as seen on Stack Overflow - Search for 'Stack Overflow'
    I'm running fabric (Django deployment to apache) and everything seems to work fine until I get to the task for installing the site: def install_site(): "Add the virtualhost file to apache" require('release', provided_by=[deploy, setup]) sudo('cd %(path)/releases/%(release)/%(release);… >>> More

  • How to set target hosts in Fabric file

    as seen on Stack Overflow - Search for 'Stack Overflow'
    I want to use Fabric to deploy my web app code to development, staging and production servers. My fabfile: def deploy_2_dev(): deploy('dev') def deploy_2_staging(): deploy('staging') def deploy_2_prod(): deploy('prod') def deploy(server): print 'env.hosts:', env.hosts env.hosts = [server] … >>> More

  • fabric deploy problem

    as seen on Stack Overflow - Search for 'Stack Overflow'
    Hi, I'm trying to deploy a django app with fabric and get the following error: Alexs-MacBook:fabric alex$ fab config:instance=peergw deploy -H <ip> - u <username> -p <password> [192.168.2.93] run: cat /etc/issue Traceback (most recent call last): File "build/bdist.macosx-10… >>> More