Rclone lsjson invalid JSON produced (no ] at the end)

What is the problem you are having with rclone?

rclone lsjson -R of a cifs mounted directory doesn't end with ]

What is your rclone version (output from rclone version)

rclone v1.53.4
- os/arch: linux/amd64
- go version: go1.15.6

Which OS you are using and how many bits (eg Windows 7, 64 bit)

Ubuntu 20.04 Linux 64 bit

Which cloud storage system are you using? (eg Google Drive)

"Local" (actually mounted cifs)

The command you were trying to run (eg rclone copy /tmp remote:tmp)

export GODEBUG=asyncpreemptoff=1
rclone lsjson -R /mnt/spi > file.json
[4 directories that say: 2021/02/02 11:25:49 ERROR : DIRECTORY NAME: error listing: failed to read directory entry: readdirent: permission denied]

admin@entrvm0038:~$ tail -1 file.json

Note the lack of new line, ] at the end (the prompt comes just after })

The rclone config contents with secrets removed.

There is no config for this: local mount

A log from the command with the -vv flag

admin@entrvm0038:~$ rclone lsjson -vv -R /mnt/spi > file.json
2021/02/02 11:32:29 DEBUG : rclone: Version "v1.53.4" starting with parameters ["rclone" "lsjson" "-vv" "-R" "/mnt/spi"]
2021/02/02 11:32:29 DEBUG : Creating backend with remote "/mnt/spi"
2021/02/02 11:32:29 DEBUG : Using config file from "/home/admin/.rclone.conf"
[4 directories that I don't have permission]
2021/02/02 11:33:01 DEBUG : 2 go routines active
2021/02/02 11:33:01 Failed to lsjson with 5 errors: last error was: error in ListJSON: failed to read directory entry: readdirent: permission denied

If you would like me to open a bug on GitHub let me know. Or if you want any other information let me know (side note: the same rclone command in /etc with some directories that my user cannot read: the JSON is well formatted)

That looks easy to fix - can you give this a try?

v1.55.0-beta.5141.141566607.fix-lsjson on branch fix-lsjson (uploaded in 15-30 mins)

Confirmed: it works! Thanks very much!

BTW, when using this cifs mounted directory I need to use:
export GODEBUG=asyncpreemptoff=1

As seen in Seeing "failed to read directory entry: readdirent: no such file or directory" with v1.52.2 - #24 by Meliox . If you wanted me to test anything for this let me know. I didn't test the old builds from that thread. With the asyncpreemptoff all is good.

Thanks for testing. I've merged this to master now which means it will be in the latest beta in 15-30 mins and released in v1.54.1

Ah yes. That is probably a CIFS kernel bug but it is extrememly annoying! I think it will be fixed with go1.16 which isn't quite released yet.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.