FUSE error: Transport endpoint is not connected
LinuxMountFuseLinux Problem Overview
I'm trying to implement the FUSE filesystem. I am receiving this error:
> cannot access MountDir: Transport endpoint is not connected
This the relevant parts of the program. There are two directories, MirrorDir
and MountDir
, that exist withing the same directory as all of the code. I am calling the program like this:
./myFS -o nonempty -o allow_other MirrorDir MountDir
Can anyone see what I am doing wrong?
static struct fuse_operations xmp_oper = {
.getattr = xmp_getattr,
.readdir = xmp_readdir,
.open = xmp_open,
.read = xmp_read,
};
int main(int argc, char *argv[]) {
int fuse_stat;
char* mirrorDir;
mirrorDir = malloc(sizeof(strlen(argv[argc-2]+1)));
if (mirrorDir == NULL) {
perror("main calloc");
abort();
}
// Pull the rootdir out of the argument list and save it in my internal data
mirrorDir = realpath(argv[argc-2], NULL);
argv[argc-2] = argv[argc-1];
argv[argc-1] = NULL;
argc--;
// turn over control to fuse
fprintf(stderr, "about to call fuse_main\n");
fuse_stat = fuse_main(argc, argv, &xmp_oper, mirrorDir);
fprintf(stderr, "fuse_main returned %d\n", fuse_stat);
return fuse_stat;
}
Linux Solutions
Solution 1 - Linux
This typically is caused by the mount directory being left mounted due to a crash of your filesystem. Go to the parent directory of the mount point and enter fusermount -u YOUR_MNT_DIR
.
If this doesn't do the trick, do sudo umount -l YOUR_MNT_DIR
.
Solution 2 - Linux
I mounted a ssh file system (sshfs command line) and left it mounted and I had same problem, fusermount -u YOUR_MNT_DIR
solved my problem. Thanks
Solution 3 - Linux
In Azure, I tried to mount my container using user managed identities. I kept getting Transport endpoint is not connected
until the Storage Blob Data Contributor
permission was added to the managed identity.
Solution 4 - Linux
You may check your /etc/hosts to verify it the master node is with a fully qualified name. More details in https://community.cloudera.com/t5/CDH-Manual-Installation/Setting-the-NameNode-port-8020-to-listen-outside-of-localhost/td-p/2257 and in https://stackoverflow.com/questions/22193051/how-to-configure-hosts-file-for-hadoop-ecosystem
Solution 5 - Linux
I encountered this problem like "Transport endpoint is not connected" or "Permission denied" when I use rclone
to mount Microsoft OneDrive to a Ubuntu system. I am a normal user of the system, so by default my home directory is accessible only to me. When I created the mountpoint directory, it is also accessible only to me. The rclone forum moderator just misled me to wrong directions and finally rudely closed my question when he realized he was unable to answer, so I have to solve the problem myself. After days' of investigation, I finally figure out that these error messages are related to the file access privilege mode. Since I am a normal user but fusermount
runs as root, it cannot access the mountpoint directory while mounting, and cannot access my home directory while unmounting, so it complaints. The solution is very simple: open the file access privilege of both the mountpoint directory and home directory to everyone by setting their mode bits to 777.