Skip to content

rclone v1.45 ls --b2-versions behaving completely incorrectly and nonintuitively #2945

Open

Description

@jikquantopian

What is the problem you are having with rclone?

I am telling it to list deleted versions of files in B2. It is not actually doing so.

What is your rclone version (output from rclone version)

rclone v1.45-133-g291f2709-beta
- os/arch: linux/amd64
- go version: go1.11.5

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

Ubuntu 19.04 64-bit

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

B2

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

Observe (the /tmp/rclone is the current beta):

jik@jik5:/tmp$ /tmp/rclone ls --b2-versions B2:jik-encrypted/ubmm8380hmd1ova1poskn7ih2k/km0b5i87bf2iv0ohma9pd5dpm0/8mqsoegl21ooasr7taeeoteb4c/a5rek3qooiqd7qpc7hr6kjbm2s/1g0obg2ltqv4pcb4oa890vuhno/ | tail
 34949527 v6bc76anfonhb4dlj41b9n72fg/uqpd8csci1i7s3k7g90b04nc111ppgp5n21duvnhp3hc1a2kjje0
 35177281 v6bc76anfonhb4dlj41b9n72fg/uvjcadp00uapvbli5t0jd6q8qb0kpum7u1b6h0rea12f4e8ibqa0
 35282172 v6bc76anfonhb4dlj41b9n72fg/v6bc76anfonhb4dlj41b9n72fg
 35133318 v6bc76anfonhb4dlj41b9n72fg/v6bc76anfonhb4dlj41b9n72fg-v2019-01-22-124107-000
 35163306 v6bc76anfonhb4dlj41b9n72fg/v6bc76anfonhb4dlj41b9n72fg-v2019-01-24-123642-000
 35194344 v6bc76anfonhb4dlj41b9n72fg/v6bc76anfonhb4dlj41b9n72fg-v2019-01-25-123946-000
 35195836 v6bc76anfonhb4dlj41b9n72fg/v6bc76anfonhb4dlj41b9n72fg-v2019-01-26-123940-000
 35215781 v6bc76anfonhb4dlj41b9n72fg/v6bc76anfonhb4dlj41b9n72fg-v2019-01-27-124111-000
 35227969 v6bc76anfonhb4dlj41b9n72fg/v6bc76anfonhb4dlj41b9n72fg-v2019-01-29-124017-000
 35067677 v6bc76anfonhb4dlj41b9n72fg/vhq45vabeenj56kuo0rbb88q6475k94i3bbu9q455vrglkdc7e50
jik@jik5:/tmp$ /tmp/rclone ls --b2-versions B2:jik-encrypted/ubmm8380hmd1ova1poskn7ih2k/km0b5i87bf2iv0ohma9pd5dpm0/8mqsoegl21ooasr7taeeoteb4c/a5rek3qooiqd7qpc7hr6kjbm2s/1g0obg2ltqv4pcb4oa890vuhno/v6bc76anfonhb4dlj41b9n72fg/ | tail
        0 v6bc76anfonhb4dlj41b9n72fg
jik@jik5:/tmp$ 

Note now the first time I run the command, it indicates that there is a "v6bc76anfonhb4dlj41b9n72fg" subdirectory with a bunch of files, including old file versions in it, but then when I run the command again, copying that directory to the end of the path because I'm actually just interested in what's in that directory, it doesn't list its contents.

What the heck.

A log from the command with the -vv flag (eg output from rclone -vv copy /tmp remote:tmp)

This doesn't appear to produce much debugging output, but here it is:

2019/01/30 09:50:25 DEBUG : rclone: Version "v1.45-133-g291f2709-beta" starting with parameters ["/tmp/rclone" "-vv" "ls" "--b2-versions" "B2:jik-encrypted/ubmm8380hmd1ova1poskn7ih2k/km0b5i87bf2iv0ohma9pd5dpm0/8mqsoegl21ooasr7taeeoteb4c/a5rek3qooiqd7qpc7hr6kjbm2s/1g0obg2ltqv4pcb4oa890vuhno/v6bc76anfonhb4dlj41b9n72fg/"]
2019/01/30 09:50:25 DEBUG : Using config file from "/home/jik/.rclone.conf"
        0 v6bc76anfonhb4dlj41b9n72fg
2019/01/30 09:50:27 DEBUG : 6 go routines active
2019/01/30 09:50:27 DEBUG : rclone: Version "v1.45-133-g291f2709-beta" finishing with parameters ["/tmp/rclone" "-vv" "ls" "--b2-versions" "B2:jik-encrypted/ubmm8380hmd1ova1poskn7ih2k/km0b5i87bf2iv0ohma9pd5dpm0/8mqsoegl21ooasr7taeeoteb4c/a5rek3qooiqd7qpc7hr6kjbm2s/1g0obg2ltqv4pcb4oa890vuhno/v6bc76anfonhb4dlj41b9n72fg/"]

Activity

  1. ncw commented on Jan 30, 2019

    @ncw
    Member

    Note now the first time I run the command, it indicates that there is a "v6bc76anfonhb4dlj41b9n72fg" subdirectory with a bunch of files, including old file versions in it, but then when I run the command again, copying that directory to the end of the path because I'm actually just interested in what's in that directory, it doesn't list its contents.

    This does look odd! I tried to replicate it but I couldn't immediately.

    Can you run the command with -vv --dump bodies and attach the output of both the commands you ran? (the directory above and the directory)

  2. added this to the v1.46 milestone on Jan 30, 2019
  3. jikquantopian commented on Jan 30, 2019

    @jikquantopian
    Author
  4. ncw commented on Jan 30, 2019

    @ncw
    Member

    Thanks for the logs.

    I think I see what the problem is....

    There used to be a folder called

    "ubmm8380hmd1ova1poskn7ih2k/km0b5i87bf2iv0ohma9pd5dpm0/8mqsoegl21ooasr7taeeoteb4c/a5rek3qooiqd7qpc7hr6kjbm2s/1g0obg2ltqv4pcb4oa890vuhno/v6bc76anfonhb4dlj41b9n72fg"
    

    And depending on how you come at it you see either the files, or you see the contents of the folder (which is empty).

    I think this replicates your problem or something like it.

    $ echo hello > /tmp/file
    $ rclone copyto /tmp/file b2:cleanup-test/file/file1
    $ rclone copyto /tmp/file b2:cleanup-test/file/file2
    $ rclone delete -v b2:cleanup-test
    2019/01/30 22:41:23 INFO  : Waiting for deletions to finish
    2019/01/30 22:41:27 INFO  : file/file2: Deleted
    2019/01/30 22:41:27 INFO  : file/file1: Deleted
    $ rclone ls --b2-versions b2:cleanup-test
            6 file/file1-v2019-01-30-224101-000
            6 file/file2-v2019-01-30-224108-000
    $ rclone copyto /tmp/file b2:cleanup-test/file
    $ rclone ls --b2-versions b2:cleanup-test
            6 file
            6 file/file1-v2019-01-30-224101-000
            6 file/file2-v2019-01-30-224108-000
    $ rclone ls --b2-versions b2:cleanup-test/file
            6 file
    $ rclone delete b2:cleanup-test/file
    $ rclone ls --b2-versions b2:cleanup-test
            6 file-v2019-01-30-224202-000
            6 file/file1-v2019-01-30-224101-000
            6 file/file2-v2019-01-30-224108-000
    $ rclone ls --b2-versions b2:cleanup-test/file
            0 file
    

    I'm not sure how to fix this - rclone doesn't deal well with files and directories with the same name.

    You could work around this with

    /tmp/rclone ls --b2-versions B2:jik-encrypted/ubmm8380hmd1ova1poskn7ih2k/km0b5i87bf2iv0ohma9pd5dpm0/8mqsoegl21ooasr7taeeoteb4c/a5rek3qooiqd7qpc7hr6kjbm2s/1g0obg2ltqv4pcb4oa890vuhno/ --include '/v6bc76anfonhb4dlj41b9n72fg**'
    

    Does the above analysis seem correct to you?

  5. jikamens commented on Feb 3, 2019

    @jikamens

    I think you've got it slightly backward. There used to be a file with that name, but I replaced it with a folder.

    I'm not sure how to fix it either, but I do think it's a bug that should be fixed. :-/

  6. modified the milestones: v1.46, v1.47 on Feb 9, 2019
  7. modified the milestones: v1.47, v1.48 on Apr 15, 2019
  8. modified the milestones: v1.48, v1.49 on Jun 19, 2019
  9. modified the milestones: v1.49, v1.50 on Aug 27, 2019
  10. modified the milestones: v1.50, Known Problem on Oct 26, 2019
  11. ivandeex commented on Feb 9, 2021

    @ivandeex
    Member

    @jikamens
    This bug is reported against obsolete version of rclone. Can you reproduce it with rclone 1.54?

  12. jikamens commented on Feb 12, 2021

    @jikamens

    Same incorrect behavior in 1.54.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions