Invalid character in list using Dropbox backend

What is the problem you are having with rclone?

I used rclone to do a copy of a very large directory on Dropbox. After completing the operation subsequent attempts to copy or sync return the error found in the logs and I cannot identify the reason for this issue which is preventing syncing.

Rclone version

$ rclone version
rclone v1.62.2
- os/version: ubuntu 18.04 (64 bit)
- os/kernel: 4.15.0-154-generic (x86_64)
- os/type: linux
- os/arch: amd64
- go/version: go1.20.2
- go/linking: static
- go/tags: none

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

Dropbox via the API

The command

$ rclone sync /cephfs/ dropbox-api:/media/cephfs --stats-one-line-date --stats-log-level DEBUG -vv --log-file /tmp/tmp.maTNYquzxt

The rclone config contents with secrets removed.

[dropbox]
type = dropbox
app_key =
app_secret =
token = ---

[dropbox-api]
type = dropbox
client_id = ---
client_secret = ---
chunk_size = 64Mi
token = ---
impersonate = daniele.riccucci@gmail.com

A log from the command with the -vv flag

Log is over 600.000 lines, I can post if needed but I reported below some of the paths which seem to be troublesome for no clear reason.

...
2023/06/25 15:56:37 ERROR : Media/preprocess/music/Library/Le Vibrazioni: error reading destination directory: invalid character 'E' looking for beginning of value
...
2023/06/25 15:57:07 ERROR : Media/preprocess/books/William Gibson/The Difference Engine (239): error reading destination directory: invalid character 'E' looking for beginning of value
...
2023/06/25 16:00:38 ERROR : Media/preprocess/music/MacBook-micro-backup/Tre allegri ragazzi morti - La testa indipendente (2001): error reading destination directory: invalid character 'E' looking for beginning of value
...
2023/06/25 17:05:02 ERROR : Media/preprocess/music/delivery/David Bowie/The Singles Collection: error reading destination directory: invalid character 'E' looking for beginning of value
...
2023/06/25 17:10:21 ERROR : Media/preprocess/music/Musica/Da Acquisire/Music/Max Pezzali/Unknown Album: error reading destination directory: invalid character 'E' looking for beginning of value
2023/06/25 17:10:31 ERROR : Media/preprocess/music/dispenser-music/Franz Ferdinand - Tonight_ Franz Ferdinand (2009): error reading destination directory: invalid character 'E' looking for beginning of value
2023/06/25 17:12:31 ERROR : Dropbox root 'media/cephfs': not deleting files as there were IO errors
2023/06/25 17:12:31 ERROR : Dropbox root 'media/cephfs': not deleting directories as there were IO errors
2023/06/25 17:12:31 ERROR : Attempt 3/3 failed with 11 errors and: march failed with 10 error(s): first error: invalid character 'E' looking for beginning of value
2023/06/25 17:12:31 Failed to sync with 11 errors: last error was: march failed with 10 error(s): first error: invalid character 'E' looking for beginning of value

The following is the same error popping up during a restic run, the backend is the same, the location I'm using for the repository is not.

$ RCLONE_VERBOSE=2 restic prune
rclone: 2023/06/25 15:20:53 INFO  : Starting transaction limiter: max 3 transactions/s with burst 6
rclone: 2023/06/25 15:20:53 DEBUG : rclone: Version "v1.62.2" starting with parameters ["rclone" "serve" "restic" "--stdio" "--b2-hard-delete" "--drive-use-trash=false" "--tpslimit" "3" "--tpslimit-burst" "6" "--fast-list" "dropbox-api:/backup/home"]
...
rclone: 2023/06/25 15:24:55 ERROR : data/14: error listing: list continue: invalid character 'E' looking for beginning of value
...
rclone: 2023/06/25 15:33:57 ERROR : data/74: error listing: list continue: invalid character 'E' looking for beginning of value
rclone: 2023/06/25 15:34:31 ERROR : data/7f: error listing: list continue: invalid character 'E' looking for beginning of value
rclone: 2023/06/25 15:46:17 ERROR : data: list failed: &fmt.wrapError{msg:"list continue: invalid character 'E' looking for beginning of value", err:(*json.SyntaxError)(0xc08c57f890)} *fmt.wrapError
List failed, server response: 404 Not Found (404)
github.com/restic/restic/internal/backend/rest.(*Backend).List
	/restic/internal/backend/rest/rest.go:371
github.com/restic/restic/internal/backend/retry.(*Backend).List.func1
	/restic/internal/backend/retry/backend_retry.go:172
github.com/restic/restic/internal/backend/retry.retryNotifyErrorWithSuccess.func1
	/restic/internal/backend/retry/backend_retry.go:47
github.com/cenkalti/backoff/v4.RetryNotifyWithTimer.func1
	/home/build/go/pkg/mod/github.com/cenkalti/backoff/v4@v4.2.0/retry.go:18
github.com/cenkalti/backoff/v4.doRetryNotify[...]
	/home/build/go/pkg/mod/github.com/cenkalti/backoff/v4@v4.2.0/retry.go:88
github.com/cenkalti/backoff/v4.RetryNotifyWithTimer
	/home/build/go/pkg/mod/github.com/cenkalti/backoff/v4@v4.2.0/retry.go:61
github.com/cenkalti/backoff/v4.RetryNotify
	/home/build/go/pkg/mod/github.com/cenkalti/backoff/v4@v4.2.0/retry.go:49
github.com/restic/restic/internal/backend/retry.retryNotifyErrorWithSuccess
	/restic/internal/backend/retry/backend_retry.go:55
github.com/restic/restic/internal/backend/retry.(*Backend).retry
	/restic/internal/backend/retry/backend_retry.go:77
github.com/restic/restic/internal/backend/retry.(*Backend).List
	/restic/internal/backend/retry/backend_retry.go:171
github.com/restic/restic/internal/repository.(*Repository).List
	/restic/internal/repository/repository.go:786
main.decidePackAction
	/restic/cmd/restic/cmd_prune.go:477
main.planPrune
	/restic/cmd/restic/cmd_prune.go:281
main.runPruneWithRepo
	/restic/cmd/restic/cmd_prune.go:194
main.runPrune
	/restic/cmd/restic/cmd_prune.go:176
main.glob..func19
	/restic/cmd/restic/cmd_prune.go:39
github.com/spf13/cobra.(*Command).execute
	/home/build/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:916
github.com/spf13/cobra.(*Command).ExecuteC
	/home/build/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:1044
github.com/spf13/cobra.(*Command).Execute
	/home/build/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:968
github.com/spf13/cobra.(*Command).ExecuteContext
	/home/build/go/pkg/mod/github.com/spf13/cobra@v1.6.1/command.go:961
main.main
	/restic/cmd/restic/main.go:96
runtime.main
	/usr/local/go/src/runtime/proc.go:250
runtime.goexit
	/usr/local/go/src/runtime/asm_amd64.s:1594

This unfortunately looks like some issue with Dropbox API as this error indicated corrupted JSON. Most likely some character encoding is responsible.

As an immediate solution I suggest you rename problematic files - by typing "new" name again. It is most likely file(s) in problematic directory - not directory itself.

Longer term you should consider using crypt remote - which will shield you from any underlying remote characters encoding issues.

Could you run:

rclone lsf "dropbox-api:media/cephfs/Media/preprocess/music/Library/Le Vibrazioni"

and copy/paste result here?

rclone lsf "dropbox-api:media/cephfs/Media/preprocess/music/Library/Le Vibrazioni" -vv
2023/06/25 17:53:58 DEBUG : rclone: Version "v1.62.2" starting with parameters ["rclone" "lsf" "dropbox-api:media/cephfs/Media/preprocess/music/Library/Le Vibrazioni" "-vv"]
2023/06/25 17:53:58 DEBUG : Creating backend with remote "dropbox-api:media/cephfs/Media/preprocess/music/Library/Le Vibrazioni"
2023/06/25 17:53:58 DEBUG : Using config file from "/home/devster/.config/rclone/rclone.conf"
2023/06/25 17:53:59 ERROR : : error listing: directory not found
2023/06/25 17:53:59 DEBUG : 6 go routines active
2023/06/25 17:53:59 INFO  : Dropbox root 'media/cephfs/Media/preprocess/music/Library/Le Vibrazioni': Committing uploads - please wait...
2023/06/25 17:53:59 Failed to lsf with 2 errors: last error was: error in ListJSON: directory not found

actual content:

ls /cephfs/Media/preprocess/music/Library/Le\ Vibrazioni/
'Le Vibrazioni [2003]'  'Le Vibrazioni II [2005]'

and the folder is actually on Dropbox:

rclone lsl "dropbox-api:media/cephfs/Media/preprocess/music/Library/Le Vibrazioni"

and post result

rclone lsl "dropbox-api:media/cephfs/Media/preprocess/music/Library/Le Vibrazioni" -vv
2023/06/25 18:00:49 DEBUG : rclone: Version "v1.62.2" starting with parameters ["rclone" "lsl" "dropbox-api:media/cephfs/Media/preprocess/music/Library/Le Vibrazioni" "-vv"]
2023/06/25 18:00:49 DEBUG : Creating backend with remote "dropbox-api:media/cephfs/Media/preprocess/music/Library/Le Vibrazioni"
2023/06/25 18:00:49 DEBUG : Using config file from "/home/devster/.config/rclone/rclone.conf"
2023/06/25 18:00:50 ERROR : : error listing: directory not found
2023/06/25 18:00:50 DEBUG : 6 go routines active
2023/06/25 18:00:50 INFO  : Dropbox root 'media/cephfs/Media/preprocess/music/Library/Le Vibrazioni': Committing uploads - please wait...
2023/06/25 18:00:50 Failed to lsl with 2 errors: last error was: directory not found

OK - what about you copy paste both names:

'Le Vibrazioni [2003]'  'Le Vibrazioni II [2005]'

from dropbox website - I think you click rename and then it is easy to copy - select by clicking three times - to make sure all string is selected

Not sure I understand what you're asking.
Should I run the command again but on subdirectories?

Go to dropbox website - and copy names from there.

Actually all three:

Le Vibrazioni
Le Vibrazioni [2003]
Le Vibrazioni II [2005]

I am searching for offending character

I tried like you said and by copying from terminal, same output.

I have to know what is on dropbox - not terminal

Le Vibrazioni
Le Vibrazioni [2003]
Le Vibrazioni II [2005]

copied from Dropbox

Folders characters look ok - so clue is in file(s) names in

Le Vibrazioni [2003]

or

Le Vibrazioni II [2005]
tree /cephfs/Media/preprocess/music/Library/Le\ Vibrazioni/
/cephfs/Media/preprocess/music/Library/Le Vibrazioni/
├── Le Vibrazioni [2003]
│   ├── 02.In Una Notte D'estate.mp3
│   └── 07.Vieni Da Me.mp3
└── Le Vibrazioni II [2005]
    └── 01.Aspettando.mp3

can I assume an E is the culprit or could the character be another?

All characters are legit - so it was wrong lead.

But I suspect now it might be related to impersonate option in config:

You will have to use your own App (setting your own client_id and client_secret) to use this option as currently rclone's default set of permissions doesn't include "members.read".

Do you have this permission enabled? Or you just did what Get your own Dropbox App ID section of doc ask?

Switch to the Permissions tab. Enable at least the following permissions: account_info.read, files.metadata.write, files.content.write, files.content.read, sharing.write. The files.metadata.read and sharing.read checkboxes will be marked too. Click Submit

There are two options here.

  1. client_id does not have members.read permission - you should add it

  2. even when it has it happens that your token is still bound to default rclone client_id
    to make sure delete token from config file and run:
    rclone config reconnect dropbox-api:
    authentication window in web browser should not show any rclone logo or name but your client_id name

Authorizations for the app seem ok, they're the same as the ones you listed except for sharing; also it seems very few files aren't being read.
I tried reconnect but I'm still encountering the same issue; I used the same logo but a different name for my app, everything seems to work, also the App Console is showing API hits.

do you have members.read permission enabled?

Permissions include members.read.

Your commands were missing a slash at the beginning...

~$ rclone lsl "dropbox-api:/media/cephfs/Media/preprocess/music/Library/Le Vibrazioni/Le Vibrazioni [2003]"
  4630967 2014-02-22 12:19:11.000000000 02.In Una Notte D'estate.mp3
  7990183 2014-02-22 12:19:13.000000000 07.Vieni Da Me.mp3
~$ rclone lsl "dropbox-api:/media/cephfs/Media/preprocess/music/Library/Le Vibrazioni"
  4630967 2014-02-22 12:19:11.000000000 Le Vibrazioni [2003]/02.In Una Notte D'estate.mp3
  7990183 2014-02-22 12:19:13.000000000 Le Vibrazioni [2003]/07.Vieni Da Me.mp3
  5065461 2014-02-22 12:37:48.000000000 Le Vibrazioni II [2005]/01.Aspettando.mp3

The sync command still returns the errors I posted in the original message.

Hmmm... I am puzzled

What about to try to sync only this folder to see all details. and use --dry-run not to delete anything by mistake

rclone sync "/cephfs/Media/preprocess/music/Library/Le Vibrazioni" "dropbox-api:/media/cephfs/Media/preprocess/music/Library/Le Vibrazioni" --stats-one-line-date --stats-log-level DEBUG -vv --log-file /tmp/tmp.maTNYquzxt --dump-headers --dump-bodies --dry-run

this should give us small but full of details log