Odrive Unable to sync cloud Error updating the file. "Read-only"

I did my first sync from Amazon Cloud Drive. I am syncing thousands of mp3 files. Seemed to go mostly well, but there are A LOT of files that did not get synced, and re-attempt to sync them give this error in the subject. I do not find anyone reporting this issue on the forums.

I have Linux Mint 20. odrive status shows that I have version “prod 999”. This is the basic logic of my script:

    if [ ! -f "${ODRIVE_ROOT}/Amazon Cloud Drive.cloudf" ]; then
      echo "no Amazon Cloud Drive.cloudf; touching and syncing"
      touch "${ODRIVE_ROOT}/Amazon Cloud Drive.cloudf"
      odrive sync "${ODRIVE_ROOT}/Amazon Cloud Drive.cloudf"
    fi

    if [ ! -f "${ODRIVE_ROOT}/Amazon Cloud Drive/Music.cloudf" ]; then
      echo "no Amazon Cloud Drive/Music.cloudf; touching and syncing"
      touch "${ODRIVE_ROOT}/Amazon Cloud Drive/Music.cloudf"
      odrive sync "${ODRIVE_ROOT}/Amazon Cloud Drive/Music.cloudf"
    fi

    output="go";
    while [ "$output" ]; do
      output=$(find "$ODRIVE_ROOT/Amazon Cloud Drive/Music" -name "*.cloud*" -exec odrive sync "{}" \;);
      echo $output;
    done

That sync’d overnight and there was some type of Amazon error on my console, but darn it, it’s gone now. If I count my .mp3 files, I pulled down 10867 files, but if I cound “.cloud” files, i have 2793. If I try rerun just that bit at the end of my script (the while loop), I get these errors for all of those cloud files:

    Unable to sync 18 Wreck Of The Old 97.mp3.cloud.  Error updating the file. Read-only
    Unable to sync Black Velvet Elvis.mp3.cloud.  Error updating the file. Read-only
    Unable to sync 06 Leprechaun Sunrise.mp3.cloud.  Error updating the file. Read-only
    Unable to sync 02 I Feel the Earth Move (Live).mp3.cloud.  Error updating the file. Read-only

You see from this listing of one folder, all .mp3’s are there, with this exception of one .cloud file:

    -rw-rw-r-- 1 plex plex 2.5M Jan  3  2020 '01 Folsom Prison Blues.mp3'
    -rw-rw-r-- 1 plex plex 2.9M Jan  3  2020 '02 Dark As The Dungeon.mp3'
    -rw-rw-r-- 1 plex plex 1.5M Jan  3  2020 '03 I Still Miss Someone.mp3'
    -rw-rw-r-- 1 plex plex 2.8M Jan  3  2020 '04 Cocaine Blues.mp3'
    -rw-rw-r-- 1 plex plex 3.3M Jan  3  2020 '05 25 Minutes To Go.mp3'
    -rw-rw-r-- 1 plex plex 2.8M Jan  3  2020 '06 Orange Blossom Special.mp3'
    -rw-rw-r-- 1 plex plex 3.7M Jan  3  2020 '07 The Long Black Veil.mp3'
    -rw-rw-r-- 1 plex plex 2.0M Jan  3  2020 '08 Send A Picture Of Mother.mp3'
    -rw-rw-r-- 1 plex plex 1.8M Jan  3  2020 '09 The Wall.mp3'
    -rw-rw-r-- 1 plex plex 1.2M Jan  3  2020 '10 Dirty Old Egg-Sucking Dog.mp3'
    -rw-rw-r-- 1 plex plex 2.5M Jan  3  2020 '11 Flushed From The Bathroom Of Y.mp3'
    -rw-rw-r-- 1 plex plex 2.7M Jan  3  2020 '12 Jackson.mp3'
    -rw-rw-r-- 1 plex plex 2.5M Jan  3  2020 '13 Give My Love To Rose.mp3'
    -rw-rw-r-- 1 plex plex 1.6M Jan  3  2020 '14 I Got Stripes.mp3'
    -rw-rw-r-- 1 plex plex 2.8M Jan  3  2020 '15 Green_ Green Grass Of Home.mp3'
    -rw-rw-r-- 1 plex plex 5.4M Jan  3  2020 '16 Greystone Chapel.mp3'
    -rw-rw-r-- 1 plex plex 3.1M Jan  3  2020 '17 Wanted Man.mp3'
    -rw-rw-r-- 1 plex plex 3.2M Jan  3  2020 '18 Wreck Of The Old 97.mp3.cloud'
    -rw-rw-r-- 1 plex plex 3.0M Jan  3  2020 '19 I Walk The Line.mp3'

The file listing above shows that all files (including the .cloud file) are rw by owner and group (I started my agent as same user as my script).

How to solve?

THANKS!
Brian

AH! Found my error.log file (newb here), and see a bunch of these:

17 Jan 11:24:38PM ERROR Failed Download for /media/plex/plex/odrive/Amazon Cloud Drive/Music/Johnny Cash/At Folsom Prison_ At San Quent/18 Wreck Of The Old 9     7.mp3.cloud Error: code CD_INTERNAL_SERVER_ERROR - Got an empty chunk before Content-Length bytes were read·
   3 18 Jan 12:01:41AM ERROR Failed Download for /media/plex/plex/odrive/Amazon Cloud Drive/Music/Joe Rut/Stolen Tools & Stereos/Black Velvet Elvis.mp3.cloud Erro     r: code CD_INTERNAL_SERVER_ERROR - Got an empty chunk before Content-Length bytes were read·

That seems like I got some sort of handshake error during my sync execution… but now, it seems like all of those .cloud files are corrupt? If I’m in this situation, how does one recover, given I have 2793 .cloud files that likely have this problem?

Hi @btmurrell,
Thanks for the information.

Can you double-check that you are able to download these files from the Amazon Drive webclient, directly? The error indicates that Amazon is not sending us the data properly, for some reason.

Can you also run the diagnostics command, so that we can get a closer look at the error and configuration?

more info. lots of these in my error.log file that seem to correspond to the others with empty chunk errors:

18 Jan 10:03:55AM ERROR Failed Download for /media/plex/plex/odrive/Amazon Cloud Drive/Music/Johnny Cash/At Folsom Prison_ At San Quent/18 Wreck Of The Old 9     7.mp3.cloud Error: code FS104 - fn: open, args: (<src.file_system_sync9.FileSystemService.OutputStream object at 0x7f6b2b12afd0>,) [] caused by IOError([Errn     o 30] Read-only file system: '/media/plex/plex/odrive/Amazon Cloud Drive/Music/Johnny Cash/At Folsom Prison_ At San Quent/.~_o-tmp_e862805d-46ab-4950-9556')·

directories and files are all rw as I said before… does this error indicate disk trouble? :frowning:

Thanks @Tony

Did you receive this?

odrive diagnostics
The diagnostic report has been sent!
Local odrive status report saved to /home/plex/.odrive-agent/current_odrive_status.txt

Yes, one file listed here (18 Wreck Of The Old 97.mp3) downloaded successfully from amazon drive web client.

Hey @btmurrell,
Thanks for the additional information! Sorry for the late response on this.

The information odrive is getting from the OS is that the location can’t be written to.

Are you able to add, or make a copy of a file in a location that is claiming to be read-only? For example, in the /media/plex/plex/odrive/Amazon Cloud Drive/Music/Johnny Cash/At Folsom Prison_ At San Quent folder?

Thanks @Tony – that disc connection indeed proved to be the problem! This device is a USB drive which was connected to my computer via a USB hub. Worked mostly, but clearly there must have been some data xfer issues. I have plugged the USB drive directly to the computer’s USB port, and am syncing now for a long while, and the aforementioned cloud file has now been converted to its real file.

Thanks for the quick response time. Wasn’t late at all in my book!

1 Like

Great! Thanks for the follow-up @btmurrell.

I’m glad to hear you were able to find the root cause and correct it.

I didn’t want to muddy the waters earlier by asking this, but can you tell me why you have the “if not exists then touch and sync” logic in your script?

Thanks for the courtesy, @Tony for my newb scripting. TBH, I first tried my script 6 mo ago, and had to put it asside for a bit. So, I thought I found that I needed to at least do that first top-level .cloudf file. Is that wrong? I realized later that the 2nd one (nested) was completely unnecessary because the top level folder gave me the cloudf files for all folders w/in it.

Sorry, I won’t take you down an education path. I’ll read more and make my script more sensible. :smiley:

Thanks again for the great, responsive support.

B

No worries @btmurrell!

I just wanted to make sure there wasn’t an issue that odrive had that you were trying to compensate for. odrive should be creating any placeholder files you need, so there shouldn’t be a reason to create it yourself.

The initial sync of the folder placeholder after that is correct, since the find command will want a “real” folder to start with.