Vinzent03 / obsidian-git

Integrate Git version control with automatic backup and other advanced features in Obsidian.md
MIT License
6.74k stars 288 forks source link

[Bug]: Android sync "Cannot read properties of null" #379

Open BrunoAFK opened 1 year ago

BrunoAFK commented 1 year ago

Describe the bug

I was following steps from wiki https://github.com/denolehov/obsidian-git/wiki/Installation#mobile but after i did everything right i got error

TypeError: Cannot read properties of null (reading 'slice')

I'm using gitlab and syncing .obsidian folder too

Steps to reproduce

https://github.com/denolehov/obsidian-git/wiki/Installation#mobile

I'm using gitlab and syncing .obsidian folder too

Expected Behavior

That repo is synced

Operating system

Android

Plugin version

2.10.1

mathisgauthey commented 1 year ago

Same issue there when I'm not starting fresh on a new vault.

tomshaffner commented 1 year ago

Same issue here.

Of note though; in my case closing the app completely out of memory and reopening it and then pushing seemed to solve the issue.

tildejustin commented 1 year ago

I am having this issue when trying to push to remote.

BusterBlade5 commented 1 year ago

I have the same error. Did you manage to solve it? @tildejustin

BusterBlade5 commented 1 year ago

Any idea how to solve it? @denolehov

tildejustin commented 1 year ago

I redid my local install and cloned my repo through the app instead of mgit but was still having unfixable mergeconflict errors and wierd gitignore issues on mobile so I just gave up for the time being.

miaoerduo commented 1 year ago

same issue when pulling from remote.

makkuro-kuroe commented 1 year ago

I have had the same problem since today morning... Can I check the error trace from the mobile app?

I tried searching for "slice" in my vault, but I have no results.

PierreGtch commented 1 year ago

Same here (gitlab.com repo, android) except the error appeared with reading 'length'. Cloning the repo worked by following the instructions here, the error appeared when trying to commit.

LightTemplar commented 1 year ago

me too :(

LightTemplar commented 1 year ago

I've used an ADB debugger and got this message in the console:

Uncaught (in promise) TypeError: Cannot read properties of null (reading 'slice')
    at GitPackIndex.readSlice (plugin:obsidian-git:13460:35)
    at async readObjectPacked (plugin:obsidian-git:13560:22)
    at async _readObject (plugin:obsidian-git:13584:14)
    at async GitWalkerRepo.readdir (plugin:obsidian-git:14336:30)
    at async Promise.all (/index 0)
    at async unionWalkerFromReaddir (plugin:obsidian-git:14614:21)
    at async walk2 (plugin:obsidian-git:14624:46)
    at async Promise.all (/index 2)
    at async walk2 (plugin:obsidian-git:14628:28)
    at async Object.walk (plugin:obsidian-git:20599:12) 

I hope, it will help.

LightTemplar commented 1 year ago

I checked repo on the phone with termux and its git - git pull and git status works. So, the problem is in the plug-in.

BusterBlade5 commented 1 year ago

@LightTemplar I was hoping that the dev would maybe fix this. But I surrender and now I use Syncthing to sync with my phone and just deactivate the plugin in the mobile. At least there is an option to do that. And it works pretty nicely. I just use git on my pc.

Trel725 commented 1 year ago

Same here. Seems to be connected with size of pack files, created by isomorphic-git. https://github.com/isomorphic-git/isomorphic-git/issues/1163#issuecomment-1577646030

mathisgauthey commented 1 year ago

I ended up paying for Sync, student promo code. But don't know yet what I'll do next year.

LightTemplar commented 1 year ago

@mathisgauthey, I don't have problems with paying, I have problems with trusting someone with my data.

mathisgauthey commented 1 year ago

@mathisgauthey, I don't have problems with paying, I have problems with trusting someone with my data.

I would recommend that you check this post

That's what I used to do on Android for using Obsidian sync with a git repo before moving to obsidian sync !

It's a bit techy but it works fine.

LightTemplar commented 1 year ago

@mathisgauthey, that would work for me, thanks!