hanwen / go-mtpfs

Mount MTP devices over FUSE
Other
680 stars 85 forks source link

failed to access mountpoint: Transport endpoint is not connected #154

Open suntong opened 4 years ago

suntong commented 4 years ago

Trying to mount my new phone with go-mtpfs for the first time while all other methods failed, but got into the "failed to access mountpoint: Transport endpoint is not connected" error from fusermount. Here are the details:

$ sudo go-mtpfs -debug "usb,data,mtp,fuse" -allow-other /mnt/phone/
2020/10/25 11:53:09 MTP request OpenSession [883707387]
send: 0x10 bytes with ep 0x1:
0000: 1000 0000 0100 0210 0000 0000 fb4d ac34  .............M.4
recv: 0xc bytes with ep 0x81:
0000: 0c00 0000 0300 0120 0000 0000            ....... ....
2020/10/25 11:53:09 MTP response OK []
2020/10/25 11:53:09 MTP request GetStorageIDs []
send: 0xc bytes with ep 0x1:
0000: 0c00 0000 0100 0410 0100 0000            ............
recv: 0x10 bytes with ep 0x81:
0000: 1000 0000 0200 0410 0100 0000 0000 0000  ................
2020/10/25 11:53:09 MTP data 0x10 bytes
recv: 0xc bytes with ep 0x81:
0000: 0c00 0000 0300 0120 0100 0000            ....... ....
2020/10/25 11:53:09 MTP response OK []
2020/10/25 11:53:09 MTP decoded &mtp.Uint32Array{Values:[]uint32{}}
2020/10/25 11:53:09 MTP request GetDeviceInfo []
send: 0xc bytes with ep 0x1:
0000: 0c00 0000 0100 0110 0200 0000            ............
recv: 0x17d bytes with ep 0x81:
0000: 7d01 0000 0200 0110 0200 0000 6400 0600  }...........d...
0010: 0000 6400 266d 0069 0063 0072 006f 0073  ..d.&m.i.c.r.o.s
0020: 006f 0066 0074 002e 0063 006f 006d 003a  .o.f.t...c.o.m.:
0030: 0020 0031 002e 0030 003b 0020 0061 006e  . .1...0.;. .a.n
0040: 0064 0072 006f 0069 0064 002e 0063 006f  .d.r.o.i.d...c.o
0050: 006d 003a 0020 0031 002e 0030 003b 0000  .m.:. .1...0.;..
0060: 0000 0021 0000 0001 1002 1003 1004 1005  ...!............
0070: 1006 1007 1008 1009 100a 100b 100c 100d  ................
0080: 1010 1014 1015 1016 1017 1019 101a 101b  ................
0090: 1001 9802 9803 9804 9805 9810 9811 98c1  ................
00a0: 95c2 95c3 95c4 95c5 9506 0000 0002 4003  ..............@.
00b0: 4004 4005 4006 4007 4005 0000 0001 d402  @.@.@.@.@.......
00c0: d403 5001 5007 d400 0000 001c 0000 0000  ..P.P...........
00d0: 3001 3004 3005 3008 3009 300b 3001 3802  0.0.0.0.0.0.0.8.
00e0: 3804 3807 3808 380b 380d 3801 b902 b903  8.8.8.8.8.8.....
00f0: b982 b983 b984 b905 ba10 ba11 ba14 ba82  ................
0100: ba06 b911 3812 3807 5800 6900 6100 6f00  ....8.8.X.i.a.o.
0110: 6d00 6900 0000 0d52 0065 0064 006d 0069  m.i....R.e.d.m.i
0120: 0020 0031 0030 0058 0020 0034 0047 0000  . .1.0.X. .4.G..
0130: 0004 3100 2e00 3000 0000 2141 0046 0038  ..1...0...!A.F.8
0140: 0037 0039 0041 0043 0037 0031 0037 0042  .7.9.A.C.7.1.7.B
0150: 0044 0041 0032 0037 0045 0044 0039 0030  .D.A.2.7.E.D.9.0
0160: 0032 0032 0036 0033 0039 0032 0032 0045  .2.2.6.3.9.2.2.E
0170: 0039 0037 0045 0045 0032 0000 00         .9.7.E.E.2...
2020/10/25 11:53:09 MTP data 0x17d bytes
recv: 0xc bytes with ep 0x81:
0000: 0c00 0000 0300 0120 0200 0000            ....... ....
2020/10/25 11:53:09 MTP response OK []
2020/10/25 11:53:09 MTP decoded &mtp.DeviceInfo{StandardVersion:0x64, MTPVendorExtensionID:0x6, MTPVersion:0x64, MTPExtension:"microsoft.com: 1.0; android.com: 1.0;", FunctionalMode:0x0, OperationsSupported:[]uint16{0x1001, 0x1002, 0x1003, 0x1004, 0x1005, 0x1006, 0x1007, 0x1008, 0x1009, 0x100a, 0x100b, 0x100c, 0x100d, 0x1010, 0x1014, 0x1015, 0x1016, 0x1017, 0x1019, 0x101a, 0x101b, 0x9801, 0x9802, 0x9803, 0x9804, 0x9805, 0x9810, 0x9811, 0x95c1, 0x95c2, 0x95c3, 0x95c4, 0x95c5}, EventsSupported:[]uint16{0x4002, 0x4003, 0x4004, 0x4005, 0x4006, 0x4007}, DevicePropertiesSupported:[]uint16{0xd401, 0xd402, 0x5003, 0x5001, 0xd407}, CaptureFormats:[]uint16{}, PlaybackFormats:[]uint16{0x3000, 0x3001, 0x3004, 0x3005, 0x3008, 0x3009, 0x300b, 0x3801, 0x3802, 0x3804, 0x3807, 0x3808, 0x380b, 0x380d, 0xb901, 0xb902, 0xb903, 0xb982, 0xb983, 0xb984, 0xba05, 0xba10, 0xba11, 0xba14, 0xba82, 0xb906, 0x3811, 0x3812}, Manufacturer:"Xiaomi", Model:"Redmi 10X 4G", DeviceVersion:"1.0", SerialNumber:"AF8...EE2"}
/usr/bin/fusermount: failed to access mountpoint /mnt/phone: Transport endpoint is not connected
2020/10/25 11:53:09 mount failed: fusermount exited with code 256

$ ls -l /mnt/ | grep phone
ls: cannot access '/mnt/phone': Transport endpoint is not connected
d????????? ? ?    ?       ?                ? phone

$ fusermount -u /mnt/phone
fusermount: entry for /mnt/phone not found in /etc/mtab

$ mtp-files | head 
libmtp version: 1.1.17

Device 0 (VID=2717 and PID=ff40) is a Xiaomi Mi-2s (id2) (MTP).
mtp-files: Successfully connected
Error 1: Get Storage information failed.
Android device detected, assigning default bug flags
Listing File Information on Device with name: (NULL)
OK.

$ dmesg | grep 'usb 2-1'
[3771860.557024] usb 2-1.3: new high-speed USB device number 4 using ehci-pci
[3771860.586003] usb 2-1.3: New USB device found, idVendor=2717, idProduct=ff40, bcdDevice= 4.04
[3771860.586006] usb 2-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[3771860.586007] usb 2-1.3: Product: Redmi 10X 4G
[3771860.586008] usb 2-1.3: Manufacturer: Xiaomi
[3771860.586009] usb 2-1.3: SerialNumber: acf2...05

I've got mtp-files list endless files before, but don't know why it is displaying "Get Storage information failed" error instead now. I've unplugged and re-plugged the phone to PC several times. Here is what I had before:

. . .
File ID: 19325
   Filename: .nomedia
   File size 0 (0x0000000000000000) bytes
   Parent ID: 19169
   Storage ID: 0x00020001
   Filetype: Undefined filetype
File ID: 19326
   Filename: .nomedia
   File size 0 (0x0000000000000000) bytes
   Parent ID: 19214
   Storage ID: 0x00020001
   Filetype: Undefined filetype
File ID: 19327
   Filename: .nomedia
   File size 0 (0x0000000000000000) bytes
   Parent ID: 19209
   Storage ID: 0x00020001
   Filetype: Undefined filetype
File ID: 19328
   Filename: .nomedia
. . .

I have no idea what the problems were, but I want just to mount my phone and navigate in its storage more conveniently through my file manager. Thx!

$ apt-cache policy go-mtpfs
go-mtpfs:
  Installed: 0.0~git20180209.d6f8f3c-1
  Candidate: 0.0~git20180209.d6f8f3c-1
  Version table:
 *** 0.0~git20180209.d6f8f3c-1 500
        500 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages
        100 /var/lib/dpkg/status

$ lsb_release -a 
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 20.04 LTS
Release:        20.04
Codename:       focal
hanwen commented 4 years ago

/usr/bin/fusermount: failed to access mountpoint /mnt/phone: Transport endpoint is not connected

are you trying to mount in place where a previous mount already exists? Try mounting on a freshly created directory.

Also, why are you using sudo ?

suntong commented 4 years ago

Try mounting on a freshly created directory

Perfect! Solved! Thanks!

suntong commented 4 years ago

Ops, I can only get the directory list, and even that is not without problem. When trying to copy files out, I get Input/output error. Here are the detailed logs:

2020/10/25 23:00:48 Dispatch 764: OPEN, NodeId: 97. data: {O_RDONLY,0x8000} 
2020/10/25 23:00:48 Serialize 764: OPEN code: OK value: {Fh 2 }
2020/10/25 23:00:48 Dispatch 766: READ, NodeId: 97. data: {Fh 2 off 0 sz 131072  L 0 RDONLY,0x8000} 
2020/10/25 23:00:48 Dispatch 768: READ, NodeId: 97. data: {Fh 2 off 131072 sz 131072  L 0 RDONLY,0x8000} 
2020/10/25 23:00:48 MTP request ANDROID_GET_PARTIAL_OBJECT64 [83 0 0 131072]
send: 0x1c bytes with ep 0x1:
0000: 1c00 0000 0100 c195 7900 0000 5300 0000  ........y...S...
0010: 0000 0000 0000 0000 0000 0200            ............
recv: 0xc bytes with ep 0x81:
0000: 0c00 0000 0300 0920 7900 0000            ....... y...
2020/10/25 23:00:48 MTP response InvalidObjectHandle []
2020/10/25 23:00:48 AndroidGetPartialObject64 failed: InvalidObjectHandle
2020/10/25 23:00:48 Serialize 766: READ code: 5=input/output error value: 
2020/10/25 23:00:48 MTP request ANDROID_GET_PARTIAL_OBJECT64 [83 131072 0 131072]
send: 0x1c bytes with ep 0x1:
2020/10/25 23:00:48 Dispatch 770: READ, NodeId: 97. data: {Fh 2 off 0 sz 4096  L 0 RDONLY,0x8000} 
0000: 1c00 0000 0100 c195 7a00 0000 5300 0000  ........z...S...
0010: 0000 0200 0000 0000 0000 0200            ............
recv: 0xc bytes with ep 0x81:
0000: 0c00 0000 0300 0920 7a00 0000            ....... z...
2020/10/25 23:00:48 MTP response InvalidObjectHandle []
2020/10/25 23:00:48 AndroidGetPartialObject64 failed: InvalidObjectHandle
2020/10/25 23:00:48 Serialize 768: READ code: 5=input/output error value: 
2020/10/25 23:00:48 MTP request ANDROID_GET_PARTIAL_OBJECT64 [83 0 0 4096]
send: 0x1c bytes with ep 0x1:
0000: 1c00 0000 0100 c195 7b00 0000 5300 0000  ........{...S...
0010: 0000 0000 0000 0000 0010 0000            ............
recv: 0xc bytes with ep 0x81:
0000: 0c00 0000 0300 0920 7b00 0000            ....... {...
2020/10/25 23:00:48 MTP response InvalidObjectHandle []
2020/10/25 23:00:48 AndroidGetPartialObject64 failed: InvalidObjectHandle
2020/10/25 23:00:48 Serialize 770: READ code: 5=input/output error value: 
2020/10/25 23:00:48 Dispatch 772: FLUSH, NodeId: 97. data: {Fh 2} 
2020/10/25 23:00:48 Serialize 772: FLUSH code: OK value: 
2020/10/25 23:00:48 Dispatch 774: RELEASE, NodeId: 97. data: {Fh 2 0x8000  L0} 
2020/10/25 23:00:48 Serialize 774: RELEASE code: OK value: 
2020/10/25 23:00:48 Dispatch 776: OPEN, NodeId: 93. data: {O_RDONLY,0x8000} 
2020/10/25 23:00:48 Serialize 776: OPEN code: OK value: {Fh 2 }
2020/10/25 23:00:48 Dispatch 778: READ, NodeId: 93. data: {Fh 2 off 0 sz 131072  L 0 RDONLY,0x8000} 
2020/10/25 23:00:48 MTP request ANDROID_GET_PARTIAL_OBJECT64 [92 0 0 131072]
send: 0x1c bytes with ep 0x1:
0000: 1c00 0000 0100 c195 7c00 0000 5c00 0000  ........|...\...
0010: 0000 0000 0000 0000 0000 0200            ............
2020/10/25 23:00:48 Dispatch 780: READ, NodeId: 93. data: {Fh 2 off 131072 sz 131072  L 0 RDONLY,0x8000} 
recv: 0xc bytes with ep 0x81:
0000: 0c00 0000 0300 0920 7c00 0000            ....... |...
2020/10/25 23:00:48 MTP response InvalidObjectHandle []
2020/10/25 23:00:48 AndroidGetPartialObject64 failed: InvalidObjectHandle
2020/10/25 23:00:48 Serialize 778: READ code: 5=input/output error value: 
2020/10/25 23:00:48 Dispatch 782: READ, NodeId: 93. data: {Fh 2 off 0 sz 4096  L 0 RDONLY,0x8000} 
2020/10/25 23:00:48 MTP request ANDROID_GET_PARTIAL_OBJECT64 [92 0 0 4096]
send: 0x1c bytes with ep 0x1:
0000: 1c00 0000 0100 c195 7d00 0000 5c00 0000  ........}...\...
0010: 0000 0000 0000 0000 0010 0000            ............
recv: 0xc bytes with ep 0x81:
0000: 0c00 0000 0300 0920 7d00 0000            ....... }...
2020/10/25 23:00:48 MTP response InvalidObjectHandle []
2020/10/25 23:00:48 AndroidGetPartialObject64 failed: InvalidObjectHandle
2020/10/25 23:00:48 Serialize 782: READ code: 5=input/output error value: 
2020/10/25 23:00:48 Dispatch 784: FLUSH, NodeId: 93. data: {Fh 2} 
2020/10/25 23:00:48 MTP request ANDROID_GET_PARTIAL_OBJECT64 [92 131072 0 131072]
send: 0x1c bytes with ep 0x1:
0000: 1c00 0000 0100 c195 7e00 0000 5c00 0000  ........~...\...
0010: 0000 0200 0000 0000 0000 0200            ............
recv: 0xc bytes with ep 0x81:
0000: 0c00 0000 0300 0920 7e00 0000            ....... ~...
2020/10/25 23:00:48 MTP response InvalidObjectHandle []
2020/10/25 23:00:48 AndroidGetPartialObject64 failed: InvalidObjectHandle
2020/10/25 23:00:48 Serialize 780: READ code: 5=input/output error value: 
2020/10/25 23:00:48 Serialize 784: FLUSH code: OK value: 
2020/10/25 23:00:48 Dispatch 786: RELEASE, NodeId: 93. data: {Fh 2 0x8000  L0} 
2020/10/25 23:00:48 Serialize 786: RELEASE code: OK value: 
2020/10/25 23:00:48 Dispatch 788: OPEN, NodeId: 95. data: {O_RDONLY,0x8000} 
2020/10/25 23:00:48 Serialize 788: OPEN code: OK value: {Fh 2 }
2020/10/25 23:00:48 Dispatch 790: READ, NodeId: 95. data: {Fh 2 off 0 sz 131072  L 0 RDONLY,0x8000} 
2020/10/25 23:00:48 Dispatch 792: READ, NodeId: 95. data: {Fh 2 off 131072 sz 131072  L 0 RDONLY,0x8000} 
2020/10/25 23:00:48 MTP request ANDROID_GET_PARTIAL_OBJECT64 [85 0 0 131072]
send: 0x1c bytes with ep 0x1:
0000: 1c00 0000 0100 c195 7f00 0000 5500 0000  ...........U...
0010: 0000 0000 0000 0000 0000 0200            ............
recv: 0xc bytes with ep 0x81:
0000: 0c00 0000 0300 0920 7f00 0000            ....... ...
2020/10/25 23:00:48 MTP response InvalidObjectHandle []
2020/10/25 23:00:48 AndroidGetPartialObject64 failed: InvalidObjectHandle
2020/10/25 23:00:48 Serialize 790: READ code: 5=input/output error value: 
2020/10/25 23:00:48 Dispatch 794: READ, NodeId: 95. data: {Fh 2 off 0 sz 4096  L 0 RDONLY,0x8000} 
2020/10/25 23:00:48 MTP request ANDROID_GET_PARTIAL_OBJECT64 [85 131072 0 131072]
send: 0x1c bytes with ep 0x1:
0000: 1c00 0000 0100 c195 8000 0000 5500 0000  ............U...
0010: 0000 0200 0000 0000 0000 0200            ............
recv: 0xc bytes with ep 0x81:
0000: 0c00 0000 0300 0920 8000 0000            ....... ....
2020/10/25 23:00:48 MTP response InvalidObjectHandle []
2020/10/25 23:00:48 AndroidGetPartialObject64 failed: InvalidObjectHandle
2020/10/25 23:00:48 Serialize 792: READ code: 5=input/output error value: 
2020/10/25 23:00:48 MTP request ANDROID_GET_PARTIAL_OBJECT64 [85 0 0 4096]
send: 0x1c bytes with ep 0x1:
0000: 1c00 0000 0100 c195 8100 0000 5500 0000  ............U...
0010: 0000 0000 0000 0000 0010 0000            ............
recv: 0xc bytes with ep 0x81:
0000: 0c00 0000 0300 0920 8100 0000            ....... ....
2020/10/25 23:00:48 MTP response InvalidObjectHandle []
2020/10/25 23:00:48 AndroidGetPartialObject64 failed: InvalidObjectHandle
2020/10/25 23:00:48 Serialize 794: READ code: 5=input/output error value: 
2020/10/25 23:00:48 Dispatch 796: FLUSH, NodeId: 95. data: {Fh 2} 
2020/10/25 23:00:48 Serialize 796: FLUSH code: OK value: 
2020/10/25 23:00:48 Dispatch 798: RELEASE, NodeId: 95. data: {Fh 2 0x8000  L0} 
2020/10/25 23:00:48 Serialize 798: RELEASE code: OK value: 
2020/10/25 23:00:48 Dispatch 800: OPEN, NodeId: 88. data: {O_RDONLY,0x8000} 
2020/10/25 23:00:48 Serialize 800: OPEN code: OK value: {Fh 2 }
2020/10/25 23:00:48 Dispatch 802: READ, NodeId: 88. data: {Fh 2 off 0 sz 131072  L 0 RDONLY,0x8000} 
2020/10/25 23:00:48 MTP request ANDROID_GET_PARTIAL_OBJECT64 [91 0 0 131072]
send: 0x1c bytes with ep 0x1:
0000: 1c00 0000 0100 c195 8200 0000 5b00 0000  ............[...
0010: 0000 0000 0000 0000 0000 0200            ............
2020/10/25 23:00:48 Dispatch 804: READ, NodeId: 88. data: {Fh 2 off 131072 sz 131072  L 0 RDONLY,0x8000} 
recv: 0xc bytes with ep 0x81:
0000: 0c00 0000 0300 0920 8200 0000            ....... ....
2020/10/25 23:00:48 MTP response InvalidObjectHandle []
2020/10/25 23:00:48 AndroidGetPartialObject64 failed: InvalidObjectHandle
2020/10/25 23:00:48 Serialize 802: READ code: 5=input/output error value: 
2020/10/25 23:00:48 MTP request ANDROID_GET_PARTIAL_OBJECT64 [91 131072 0 131072]
2020/10/25 23:00:48 Dispatch 806: READ, NodeId: 88. data: {Fh 2 off 0 sz 4096  L 0 RDONLY,0x8000} 
send: 0x1c bytes with ep 0x1:
0000: 1c00 0000 0100 c195 8300 0000 5b00 0000  ............[...
0010: 0000 0200 0000 0000 0000 0200            ............
recv: 0xc bytes with ep 0x81:
0000: 0c00 0000 0300 0920 8300 0000            ....... ....
2020/10/25 23:00:48 MTP response InvalidObjectHandle []
2020/10/25 23:00:48 AndroidGetPartialObject64 failed: InvalidObjectHandle
2020/10/25 23:00:48 Serialize 804: READ code: 5=input/output error value: 
2020/10/25 23:00:48 MTP request ANDROID_GET_PARTIAL_OBJECT64 [91 0 0 4096]
send: 0x1c bytes with ep 0x1:
0000: 1c00 0000 0100 c195 8400 0000 5b00 0000  ............[...
0010: 0000 0000 0000 0000 0010 0000            ............
recv: 0xc bytes with ep 0x81:
0000: 0c00 0000 0300 0920 8400 0000            ....... ....
2020/10/25 23:00:48 MTP response InvalidObjectHandle []
2020/10/25 23:00:48 AndroidGetPartialObject64 failed: InvalidObjectHandle
2020/10/25 23:00:48 Serialize 806: READ code: 5=input/output error value: 
2020/10/25 23:00:48 Dispatch 808: FLUSH, NodeId: 88. data: {Fh 2} 
2020/10/25 23:00:48 Serialize 808: FLUSH code: OK value: 
2020/10/25 23:00:48 Dispatch 810: RELEASE, NodeId: 88. data: {Fh 2 0x8000  L0} 
2020/10/25 23:00:48 Serialize 810: RELEASE code: OK value: 

What's wrong?