rschroll / rmfuse

FUSE access to the reMarkable Cloud
MIT License
95 stars 8 forks source link

ERROR:root:Attempt to get non-existent Item #24

Closed traysh closed 3 years ago

traysh commented 3 years ago

Today I tryed again to use rmfuse, but now I get a different error, see bellow.

Disclaimer: I used other unnoficial APIs before, so I might have an inconsistent reMarkable cloud. Yet, it works elsewhere.

output when trying to access the mounted cloud:

traysh@konqi ~ % ls /media/remarkable
ls: cannot access '/media/remarkable': No such file or directory

rmfuse -vvv /media/remarkable output:

FUSE library version: 3.10.3
unique: 2, opcode: INIT (26), nodeid: 0, insize: 56, pid: 0
INIT: 7.32
flags=0x03fffffb
max_readahead=0x00020000
   INIT: 7.31
   flags=0x0040b039
   max_readahead=0x00020000
   max_write=0x00100000
   max_background=0
   congestion_threshold=0
   time_gran=1
   unique: 2, success, outsize: 80
unique: 4, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 26589
unique: 6, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 26584
unique: 8, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 91827
unique: 10, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 92201
unique: 12, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 92200
ERROR:root:Attempt to get non-existent Item 
   unique: 4, error: -2 (No such file or directory), outsize: 16
ERROR:root:Attempt to get non-existent Item 
   unique: 6, error: -2 (No such file or directory), outsize: 16
unique: 14, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 26584
ERROR:root:Attempt to get non-existent Item 
   unique: 8, error: -2 (No such file or directory), outsize: 16
ERROR:root:Attempt to get non-existent Item 
   unique: 10, error: -2 (No such file or directory), outsize: 16
ERROR:root:Attempt to get non-existent Item 
   unique: 12, error: -2 (No such file or directory), outsize: 16
ERROR:root:Attempt to get non-existent Item 
   unique: 14, error: -2 (No such file or directory), outsize: 16
unique: 16, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 26584
ERROR:root:Attempt to get non-existent Item 
   unique: 16, error: -2 (No such file or directory), outsize: 16
unique: 18, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 26584
ERROR:root:Attempt to get non-existent Item 
   unique: 18, error: -2 (No such file or directory), outsize: 16
unique: 20, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 26584
ERROR:root:Attempt to get non-existent Item 
   unique: 20, error: -2 (No such file or directory), outsize: 16
unique: 22, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 26584
ERROR:root:Attempt to get non-existent Item 
   unique: 22, error: -2 (No such file or directory), outsize: 16
unique: 24, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 26584
ERROR:root:Attempt to get non-existent Item 
   unique: 24, error: -2 (No such file or directory), outsize: 16
unique: 26, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 26584
ERROR:root:Attempt to get non-existent Item 
   unique: 26, error: -2 (No such file or directory), outsize: 16
unique: 28, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 26584
ERROR:root:Attempt to get non-existent Item 
   unique: 28, error: -2 (No such file or directory), outsize: 16
unique: 30, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 26584
ERROR:root:Attempt to get non-existent Item 
   unique: 30, error: -2 (No such file or directory), outsize: 16
unique: 32, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 26584
ERROR:root:Attempt to get non-existent Item 
   unique: 32, error: -2 (No such file or directory), outsize: 16
unique: 34, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 26584
ERROR:root:Attempt to get non-existent Item 
   unique: 34, error: -2 (No such file or directory), outsize: 16
unique: 36, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 26584
ERROR:root:Attempt to get non-existent Item 
   unique: 36, error: -2 (No such file or directory), outsize: 16
unique: 38, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 26584
ERROR:root:Attempt to get non-existent Item 
   unique: 38, error: -2 (No such file or directory), outsize: 16
unique: 40, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 26584
ERROR:root:Attempt to get non-existent Item 
   unique: 40, error: -2 (No such file or directory), outsize: 16
unique: 42, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 26584
ERROR:root:Attempt to get non-existent Item 
   unique: 42, error: -2 (No such file or directory), outsize: 16
unique: 44, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 26584
ERROR:root:Attempt to get non-existent Item 
   unique: 44, error: -2 (No such file or directory), outsize: 16
unique: 46, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 26584
ERROR:root:Attempt to get non-existent Item 
   unique: 46, error: -2 (No such file or directory), outsize: 16
unique: 48, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 26584
ERROR:root:Attempt to get non-existent Item 
   unique: 48, error: -2 (No such file or directory), outsize: 16
unique: 50, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 26584
ERROR:root:Attempt to get non-existent Item 
   unique: 50, error: -2 (No such file or directory), outsize: 16
unique: 52, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 26584
ERROR:root:Attempt to get non-existent Item 
   unique: 52, error: -2 (No such file or directory), outsize: 16
unique: 54, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 26584
ERROR:root:Attempt to get non-existent Item 
   unique: 54, error: -2 (No such file or directory), outsize: 16
unique: 56, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 26584
ERROR:root:Attempt to get non-existent Item 
   unique: 56, error: -2 (No such file or directory), outsize: 16
unique: 58, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 26584
ERROR:root:Attempt to get non-existent Item 
   unique: 58, error: -2 (No such file or directory), outsize: 16
unique: 60, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 26584
ERROR:root:Attempt to get non-existent Item 
   unique: 60, error: -2 (No such file or directory), outsize: 16
unique: 62, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 91827
ERROR:root:Attempt to get non-existent Item 
   unique: 62, error: -2 (No such file or directory), outsize: 16
unique: 64, opcode: GETATTR (3), nodeid: 1, insize: 56, pid: 91827
ERROR:root:Attempt to get non-existent Item 
   unique: 64, error: -2 (No such file or directory), outsize: 16
rschroll commented 3 years ago

This is very weird. It looks like it is failing to find the root directory. But this is provided directly by rmfuse/rmcl; it doesn't get this at all from the cloud API.

Can you let me know your OS, Python version, FUSE version, and whether you're using pyfuse3 or llfuse?

If you are able, can you try running the following script? It will try to print out all the items it can find in the cloud account. You can post the output here, if you are comfortable, or email it to me at my user name at gmail. It will contain document names; feel free to redact them if you like.

The output will be in the form

'id-string': <Document "document-name">

The main thing I'm curious about is, do any documents have a name of empty string? (There should be exactly one, a "VirtualFolder".) Also, most of the id-strings should be UUIDs (~40 hexadecimal digits); the only two that aren't should be '' (empty string, corresponding to that same element as before) and 'trash'. If you see something unusual along these lines, you can just report it without listing the whole output, if you prefer.

Here's the script. You should be able to run it from within the same environment that rmfuse runs.

from pprint import pprint
import trio

from rmcl import api

async def list_items():
    client = await api.get_client()
    await client.update_items()
    pprint(client.by_id)

trio.run(list_items)
rschroll commented 3 years ago

I just found and fixed two bugs. One of them, related to modification dates prior to 1970 was causing a sudden crash, which could be what you're seeing. The other won't fix a crash, but it does fix the debug output with the -vv option. I haven't released a new version yet. If you're able to run from git, please pull from master and let me know how it goes.

traysh commented 3 years ago

This is very weird. It looks like it is failing to find the root directory. But this is provided directly by rmfuse/rmcl; it doesn't get this at all from the cloud API.

Can you let me know your OS, Python version, FUSE version, and whether you're using pyfuse3 or llfuse?

I'm running Arch Linux 😎

traysh@konqi /tmp/apague % pacman -Q python
python 3.9.5-2
traysh@konqi /tmp/apague % pacman -Q | grep fuse3
fuse3 3.10.3-1
python-pyfuse3 3.2.0-2

The main thing I'm curious about is, do any documents have a name of empty string? (There should be exactly one, a "VirtualFolder".) Also, most of the id-strings should be UUIDs (~40 hexadecimal digits); the only two that aren't should be '' (empty string, corresponding to that same element as before) and 'trash'. If you see something unusual along these lines, you can just report it without listing the whole output, if you prefer.

Here's the script. You should be able to run it from within the same environment that rmfuse runs.

sure, output is bellow:

traysh@konqi /tmp/apague % python script.py                                                                                          │   28     _site_packages=$(python -sSc 'import site; print(site.getsitepackages()[0])')                                             
Traceback (most recent call last):                                                                                                   │   29                                                                                                                               
  File "/tmp/apague/script.py", line 11, in <module>                                                                                 │~  30     cd "$srcdir"/rmfuse                                                                                                       
    trio.run(list_items)                                                                                                             │   31     python setup.py install -O1 --skip-build --root="$pkgdir"                                                                 
  File "/usr/lib/python3.9/site-packages/trio/_core/_run.py", line 1932, in run                                                      │   32     install -Dm0644 LICENSE.txt "$pkgdir"/usr/share/licenses/$pkgname/LICENSE                                                 
    raise runner.main_task_outcome.error                                                                                             │   33                                                                                                                               
  File "/tmp/apague/script.py", line 8, in list_items                                                                                │   34     # vendoring xdg.py due to conflicts with python-pyxdg                                                                     
    await client.update_items()                                                                                                      │   35     install -Dm0644 "$srcdir"/xdg.py "$pkgdir$_site_packages"/rmfuse/xdg.py                                                   
  File "/usr/lib/python3.9/site-packages/rmcl/api.py", line 238, in update_items                                                     │~  36     rm "$pkgdir$_site_packages"/rmfu*.egg-info/requires.txt                                                                   
    self.by_id[i.parent].children.append(i)                                                                                          │   37 }                                                                                                                             
KeyError: '913e25c2-eea5-40df-aa1a-ad5ae8722f60
rschroll commented 3 years ago

You've managed to get a document with a parent that doesn't exist. I don't know quite how, but I was able to reproduce the problem on my end. The new version of rmcl (0.4.2) contains a fix, so updating that should be all you need to do. I just pushed a commit that moves rmfuse up to this version, so updating rmfuse (from git) should also work.

If this doesn't fix things, please reopen the issue. If it does, let me know and I'll release a new version of rmfuse.

traysh commented 3 years ago

yes, it worked by updating rmcl to 0.4.2

thank you very much