# Runtime error with cache remote and lsjson

**URL:** <https://forum.rclone.org/t/runtime-error-with-cache-remote-and-lsjson/6305>\
**Category:** Suspected Bug\
**Created:** [July 31, 2018, 9:00am UTC](https://forum.rclone.org/t/runtime-error-with-cache-remote-and-lsjson/6305 "2018-07-31T09:00:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bobolyne](https://forum.rclone.org/letter_avatar_proxy/v4/letter/b/57b2e6/32.png) [@bobolyne](https://forum.rclone.org/u/bobolyne)\
**Post date:** [July 31, 2018, 9:00am UTC](https://forum.rclone.org/t/runtime-error-with-cache-remote-and-lsjson/6305/1 "2018-07-31T09:00:24Z")

</div>

I’m getting segmentation fault when trying to run `lsjson` on a cache remote. The first time I run `lsjson` the remote content is printed but any subsequent call to `lsjson` will result in SIGSEGV. No errors when I run `ls` or `lsd`. Tested rclone v1.42 and rclone v1.42-061-gbbda4ab1β on linux/amd64. Tested on v1.41 and it works properly.

```
2018/07/31 02:32:26 DEBUG : rclone: Version "v1.42" starting with parameters ["rclone" "lsjson" "drive-cache:" "-vv"]
2018/07/31 02:32:26 DEBUG : Using config file from "/home/.config/rclone/rclone.conf"
2018/07/31 02:32:26 DEBUG : drive-cache: wrapped gdrive:Videos at root 
2018/07/31 02:32:26 INFO : drive-cache: Cache DB path: /home/.cache/rclone/cache-backend/drive-cache.db
2018/07/31 02:32:26 INFO : drive-cache: Cache chunk path: /home/.cache/rclone/cache-backend/drive-cache
2018/07/31 02:32:26 INFO : drive-cache: Chunk Memory: true
2018/07/31 02:32:26 INFO : drive-cache: Chunk Size: 5M
2018/07/31 02:32:26 INFO : drive-cache: Chunk Total Size: 5G
2018/07/31 02:32:26 INFO : drive-cache: Chunk Clean Interval: 1m0s
2018/07/31 02:32:26 INFO : drive-cache: Workers: 4
2018/07/31 02:32:26 INFO : drive-cache: File Age: 6h0m0s
2018/07/31 02:32:26 DEBUG : Adding path "cache/expire" to remote control registry
2018/07/31 02:32:26 DEBUG : Adding path "cache/stats" to remote control registry
[
2018/07/31 02:32:26 DEBUG : Cache remote drive-cache:: list ''
2018/07/31 02:32:26 DEBUG : : list: warm 4 from cache for: , expiring on: 2018-07-31 08:25:18.068008691 -0600 MDT
2018/07/31 02:32:26 DEBUG : : list: cached entries: [Films Other TV Shows temp]
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x18 pc=0x557495d68fc4]

goroutine 63 [running]:
github.com/ncw/rclone/backend/cache.(*Directory).ID(0xc42022dab0, 0x557496948d00, 0xc42022dab0)
	<autogenerated>:1 +0x34
github.com/ncw/rclone/cmd/lsjson.glob..func1.1.1(0x0, 0x0, 0xc420700f00, 0x4, 0x4, 0x0, 0x0, 0x4, 0x0)
	/build/rclone/src/rclone-1.42/.gopath/src/github.com/ncw/rclone/cmd/lsjson/lsjson.go:147 +0x7b9
github.com/ncw/rclone/fs/walk.walk.func2(0xc4204e6f50, 0xc4204086c0, 0x557496938b80, 0x55749694dc80, 0xc420344dc0, 0x5574958c8f00, 0xc4204e6f70, 0xc420307f40, 0xc4204e6f60, 0xc4202c0e40, ...)
	/build/rclone/src/rclone-1.42/.gopath/src/github.com/ncw/rclone/fs/walk/walk.go:134 +0x291
created by github.com/ncw/rclone/fs/walk.walk
	/build/rclone/src/rclone-1.42/.gopath/src/github.com/ncw/rclone/fs/walk/walk.go:114 +0x265

```

Here’s my config file:

```
[gdrive]
type = drive
client_id = 
client_secret = 
token = {"access_token":"XXX","token_type":"Bearer","refresh_token":"YYY","expiry":"2018-07-31T03:25:17.148094023-06:00"}

[drive-cache]
type = cache
remote = gdrive:Videos
plex_url = 
plex_username = 
plex_password = 
chunk_size = 5M
info_age = 6h
chunk_total_size = 5G
```

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [July 31, 2018, 10:25am UTC](https://forum.rclone.org/t/runtime-error-with-cache-remote-and-lsjson/6305/2 "2018-07-31T10:25:36Z")

</div>

Hmm, that is a bug!

Can you try this fix?

[https://beta.rclone.org/branch/v1.42-063-g42d88be6-fix-cache-nil-dir/](https://beta.rclone.org/branch/v1.42-063-g42d88be6-fix-cache-nil-dir/) (uploaded in 15-30 mins)

---

<div class="post-metadata">

**Author:** ![bobolyne](https://forum.rclone.org/letter_avatar_proxy/v4/letter/b/57b2e6/32.png) [@bobolyne](https://forum.rclone.org/u/bobolyne)\
**Post date:** [July 31, 2018, 7:36pm UTC](https://forum.rclone.org/t/runtime-error-with-cache-remote-and-lsjson/6305/3 "2018-07-31T19:36:38Z")

</div>

That seems to have fixed it. Thanks 🙂

---

<div class="post-metadata">

**Author:** ![ncw](https://forum.rclone.org/user_avatar/forum.rclone.org/ncw/32/18_2.png) [@ncw](https://forum.rclone.org/u/ncw)\
**Post date:** [August 5, 2018, 8:42am UTC](https://forum.rclone.org/t/runtime-error-with-cache-remote-and-lsjson/6305/4 "2018-08-05T08:42:58Z")

</div>

Thanks for testing 🙂 I’ve merged that fix to master.

[https://beta.rclone.org/v1.42-067-gffd11662/](https://beta.rclone.org/v1.42-067-gffd11662/) (uploaded in 15-30 mins)

It will be in [the latest beta](https://beta.rclone.org) in 15-30 mins and in v1.43 🙂

---

<div class="post-metadata">

**Author:** ![system](https://forum.rclone.org/uploads/default/original/2X/3/39ad3235f6ffec76ccd0c81616bd55697b4c300d.png) [@system](https://forum.rclone.org/u/system)\
**Post date:** [March 4, 2020, 12:46am UTC](https://forum.rclone.org/t/runtime-error-with-cache-remote-and-lsjson/6305/5 "2020-03-04T00:46:30Z")

</div>

Closed on March 4, 2020, 12:46am UTC


