obsidian-git icon indicating copy to clipboard operation
obsidian-git copied to clipboard

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

Open BrunoAFK opened this issue 2 years ago • 18 comments

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

BrunoAFK avatar Nov 17 '22 20:11 BrunoAFK

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

mathisgauthey avatar Nov 23 '22 07:11 mathisgauthey

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.

tomshaffner avatar Dec 29 '22 23:12 tomshaffner

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

tildejustin avatar Feb 01 '23 03:02 tildejustin

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

BusterBlade5 avatar Feb 07 '23 05:02 BusterBlade5

Any idea how to solve it? @denolehov

BusterBlade5 avatar Feb 07 '23 05:02 BusterBlade5

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.

tildejustin avatar Feb 07 '23 05:02 tildejustin

same issue when pulling from remote.

miaoerduo avatar Mar 09 '23 06:03 miaoerduo

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.

makkuro-kuroe avatar Apr 01 '23 21:04 makkuro-kuroe

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.

PierreGtch avatar Apr 21 '23 08:04 PierreGtch

me too :(

LightTemplar avatar May 14 '23 22:05 LightTemplar

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 avatar May 16 '23 01:05 LightTemplar

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.

LightTemplar avatar May 16 '23 02:05 LightTemplar

@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.

BusterBlade5 avatar May 16 '23 19:05 BusterBlade5

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

Trel725 avatar Jun 13 '23 12:06 Trel725

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

mathisgauthey avatar Jun 13 '23 16:06 mathisgauthey

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

LightTemplar avatar Jun 13 '23 20:06 LightTemplar

@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.

mathisgauthey avatar Jun 13 '23 20:06 mathisgauthey

@mathisgauthey, that would work for me, thanks!

LightTemplar avatar Jun 13 '23 20:06 LightTemplar