ifuse icon indicating copy to clipboard operation
ifuse copied to clipboard

Input/Output error when mounting documents apps

Open corsac-s opened this issue 4 years ago • 25 comments

Hi, I'm trying to mount the document folder of an app with Itunes File Sharing support (OnlyOffice Document here but any app I tried has the issue). Mounting works fine but any access to the mounted folder exhibits an I/O error (the first time after a few seconds long timeout).

This is with the Debian sid version (I'm the maintainer), which is based on a 2018 snapshot (1.1.4~git20181007.3b00243-1) with libimobiledevice 1.2.1~git20191129.9f79242-1 and libusbmuxd 2.0.1.

I wanted to try with more recent libraries but as I understand the projects are in the middle of a large refactoring so I'll wait a bit before trying the various stuff (do you intend to make tags and tarball releases, by the way?) but wanted to document it a bit.

If you need any log please ask. I've tried to pass --debug to ifuse but it didn't show anything more (maybe it needs to be built with debugging enabled as well?).

corsac-s avatar Jun 09 '20 18:06 corsac-s

I tested ifuse, it definitely works. Maybe you try again with the new releases which we are putting together as we speak.

nikias avatar Jun 09 '20 18:06 nikias

That's good to know. I'll try them once things have settled down a bit (and hopefully there will be tags?)

corsac-s avatar Jun 09 '20 18:06 corsac-s

Tags and the whole thing

nikias avatar Jun 09 '20 20:06 nikias

So, I tried with:

  • ifuse cce061d
  • libimobiledevice bc32998
  • libusbmuxd 9860981

and I still have I/O errors with ifuse when using --documents. Any pointer on how to debug this further would be helpful.

corsac-s avatar Jun 10 '20 21:06 corsac-s

I noticed that actually it's the mount operation that fails but it's never propagated:

mount("ifuse", "/tmp/fuse", "fuse.ifuse", MS_NOSUID|MS_NODEV, "fd=5,rootmode=40000,user_id=1000"...) = -1 EPERM (Operation not permitted)

The ifuse return code is 0 and somehow the mount appear in the list:

ifuse on /tmp/fuse type fuse.ifuse (rw,nosuid,nodev,relatime,user_id=1000,group_id=1000)

I'll keep investigating.

corsac-s avatar Jun 12 '20 09:06 corsac-s

Other fuse filesystems mounts work fine as user. ifuse works fine when run as root. This behaviour has changed recently (not sure when) but it might be related to some specific underlying changes in the distribution and/or the kernel so I'll keep looking

corsac-s avatar Jun 12 '20 09:06 corsac-s

But there's definitely something fishy here because:

  • other type of fuse mounting (gvfs, sshfs etc.) work fine as non-root
  • ifuse without --document works fine as non-root.

Still investigating

corsac-s avatar Jun 14 '20 15:06 corsac-s

So I discovered you can pass -f on the command line to keep ifuse in the foreground and have some debug output.

When mounting in /tmp/fuse/ it seems to work (for --documents) while mounting below my homedir (/home/corsac/tmp/fuse for example) it doesnt, and shows:

ifuse ~/tmp/fuse --documents com.onlyoffice.Documents -f
Unknown AFC status 32.

When running ls in a different terminal.

Mounting as root under my homedir works fine (I need to be root to access it but it does work fine)

corsac-s avatar Jun 14 '20 17:06 corsac-s

I tried with the recently released tags for libplist/libusbmuxd/libimobiledevice/ifuse and I still have the same behavior:

  • mounting “standard” iphone share works fine as user, as root, in homedir or in /tmp
  • mounting an application documents doesn't work as user in homedir but works as root or when mounting in /tmp (and when using ifuse -f it should AFC status 32)

Status 32 is not present in https://github.com/libimobiledevice/ifuse/blob/master/src/ifuse.c#L122 but the libimobiledevice API documentation (https://www.libimobiledevice.org/docs/html/afc_8h.html#a913481f73acbd6026a4663bd7ec3f6c9) indicates it's AFC_E_NOT_ENOUGH_DATA

corsac-s avatar Jun 16 '20 16:06 corsac-s

It seems to have been fixed! Building ifuse, libimobiledevice, libplist, and libusbmuxd from source has allowed me to mount the documents folder of an application that was previously unmountable as a non-root user. Thank you!

I've tried to rebuild libimobiledevices against the OpenSSL backends and it seems to work better. I'm trying to have some kind of official statements from Debian ftpmasters that it's ok to do that but I'm still waiting.

Meanwhile, it might be worth having an explicit statement from libimobiledevice authors that it's ok to link that LGPL library with OpenSSL.

corsac-s avatar Jul 19 '20 15:07 corsac-s

Same issue

Unknown AFC status 32.

It works with Linux Mint 19.3 (Ubuntu 18.0.4 apt build) for me, but now it's broken with Linux Mint 20.0 (Ubuntu 20.0.4 apt build)

Mount and list folders/files still works over Nemo GUI, but it hangs on read or copy files (Both Linux Mint versions)

ghost avatar Aug 13 '20 16:08 ghost

Same problem here. ifuse --documents worked fine 18.04, but stopped after upgrading to 20.04. With -f, it also prints Unknown AFC status 32.

martinvonwittich avatar Nov 02 '20 21:11 martinvonwittich

@martinvonwittich Are you building ifuse, libimobiledevice, libplist, and libusbmuxd from source?

I'm running a 20.04-based distribution and (after building from source, libimobiledevice/master), it is working for me.

@martinvonwittich Are you building ifuse, libimobiledevice, libplist, and libusbmuxd from source?

I'm running a 20.04-based distribution and (after building from source, libimobiledevice/master), it is working for me.

No, I was using the standard packages provided by Ubuntu 20.04. I temporarily downgraded to the ones from Ubuntu 18.04 to resolve the issue:

martin@martin ~ % LANG=C apt-cache policy ifuse
ifuse:
  Installed: 1.1.3-0.1
  Candidate: 1.1.4~git20181007.3b00243-1
  Version table:
     1.1.4~git20181007.3b00243-1 500
        500 http://de.archive.ubuntu.com/ubuntu focal/universe amd64 Packages
 *** 1.1.3-0.1 100
        100 /var/lib/dpkg/status

martinvonwittich avatar Dec 08 '20 11:12 martinvonwittich

Same problem on Arch 5.9.14, ifuse 1.1.4, libimobiledevice 1.3.0

Glamhoth avatar Jan 22 '21 16:01 Glamhoth

Have the same error, Unknown AFC status 32., on Arch Linux 5.10.10, ifuse 1.1.4 and libimobiledeivce 1.3.0 (installed with package manager). Building from source works fine.

thomasfsteeples avatar Jan 27 '21 13:01 thomasfsteeples

I have two Ubuntu computers, one desktop and one laptop. The desktop is newer with Ubuntu 20.04 LTS and preinstalled libimobiledevce version 1.2.1 and libusbmuxd version 2.0.1. And the laptop is older with Ubuntu 18.04 LTS and preinstalled with libimobiledevce version 1.2.1 and libusbmuxd version 1.1.0. My iPhone just works fine with my laptop but not with my desktop. I mean reading and writing application data. I don't know whether this is caused by version mismatch between libraries on Ubuntu 20.04 LTS. Just my guess. If this is really so, this should be fixed by the Ubuntu package maintainers. I just grew out of the habit of compiling everything myself and relies on the pre-built packages instead.

LeeiFrankJaw avatar Jan 30 '21 16:01 LeeiFrankJaw

I can now confirm this is a version problem that comes with Ubuntu 20.04 LTS. The following is what I did to resolve all my problem. I downloaded all the relevant .deb files from https://packages.ubuntu.com/ and did as follows.

dpkg -i libusbmuxd4_1.1.0~git20171206.c724e70f-0.1_amd64.deb
dpkg -r --force-depends libusbmuxd6
dpkg -i libusbmuxd4_1.1.0~git20171206.c724e70f-0.1_amd64.deb
dpkg -i usbmuxd_1.1.0-2ubuntu0.1_amd64.deb
dpkg -i libimobiledevice6_1.2.1~git20171128.5a854327+dfsg-0.1_amd64.deb
# Optional, if you have the utility package installed.
dpkg -i libimobiledevice-utils_1.2.1~git20171128.5a854327+dfsg-0.1_amd64.deb
# Optional, if you want to use ifuse.  I generally just use nautilus instead.
dpkg -i ifuse_1.1.3-0.1_amd64.deb
# Hold the binoic packages to prevent warning.
apt-mark hold libimobiledevice6 usbmuxd libimobiledevice-utils ifuse 

Everything works fine now as it did on my laptop with Ubuntu 18.04 LTS.

LeeiFrankJaw avatar Jan 30 '21 18:01 LeeiFrankJaw

Ran into the same bug on my Ubuntu 20.04 LTS.

Followed @LeeiFrankJaw's rollback instructions above, ~~and everything works now.~~

Nevermind it only worked slightly better and I'm still having problems with the Nautilus interface. Mounting manually with ifuse works though, so - close enough.

Also, applying this rollback introduces a dependency problem with checkra1n, so I had to uninstall it for the time being.

SmiVan avatar Jun 24 '21 01:06 SmiVan

Had the same issue on Arch Linux 5.12.14-zen1-1-zen
Installing the -git version from the AUR fixed the issue.

Bad3r avatar Jul 11 '21 09:07 Bad3r

Will there be a new release so we don't need to rebuild all -git packages? Thanks.

AlynxZhou avatar Jan 22 '22 06:01 AlynxZhou

Same issue here. Installing the ifuse-git package on Arch Linux solved it for me as well.

K4LCIFER avatar Aug 12 '22 06:08 K4LCIFER

Same issue here. Installing the ifuse-git package on Arch Linux solved it for me as well.

Same

afaikiac avatar Sep 02 '22 23:09 afaikiac

installing ifuse-git leaves me with this error

image

SoPat712 avatar Dec 05 '22 23:12 SoPat712