Odrive should error if it detects authentication needs to be redone

I encountered the issue where odrive silently stopped syncing files and would report Unable to sync Folder.cloudf. This file is not inside an odrive folder., even though it is. This was despite odrive status reporting that everything was more-or-less perfectly fine:

odrive Make Cloud Storage THE WAY IT SHOULD BE.

isActivated: True                                               hasSession: True
email: asdfasdf@asdfsadf.com                                 accountType: Google
syncEnabled: True                                             version: prod 1016
placeholderThreshold: neverDownload                   autoUnsyncThreshold: never
downloadThrottlingThreshold: unlimited         uploadThrottlingThreshold: normal
autoTrashThreshold: never                                              Mounts: 1
xlThreshold: never                                                    Backups: 0

Sync Requests: 0
Background Requests: 0
Uploads: 0
Downloads: 0
Trash: 0
Waiting: 0
Not Allowed: 0

Re-authenticating the odrive agent worked fine as suggested here:
https://forum.odrive.com/t/loss-of-session-on-odrive-agents-file-is-not-inside-an-odrive-folder-2019-06-22/6450/2

But I feel like the odrive agent/CLI should be able to detect whether it needs to be reauthenticated. Or at least detect that something has corrupted/failed. Or, in the case of the attempted odrive sync, detect that it is inside of an odrive folder and report something else.

I obviously don’t know what the backend looks like to understand how reauthenticating allows the agent to determine whether or not a file is inside a odrive folder or not, so all I can really do is just ask that there be a check.

Hi @jrwrigh.iii,
Is the output you pasted above what was seen when reauthentication was needed? I would’ve expected “hasSession” to be False instead of True.

We’ll take a look at the possibility of providing a better error message when there is no session.

1 Like

Hmm. That was copy/pasting from what I thought was an old log before I reauthenticated, but looking at a different terminal window I had up, it says that hasSession: false. So I think the above status message is probably from after the reauthentication. Sorry for the confusion.

(side note: can you also make odrive status not clear the terminal too? That way I could scroll back in my terminal history and verify when exactly that status message was made).

Hey @jrwrigh.iii,

No worries!

I am able to scroll back on my terminal, but there may be a difference depending on the terminal and settings.

If you want, you can edit this in the odrive.py file, which you should see in the /bin/ folder where the odrive binary is. They are the same thing, but odrive.py is the non-compiled python code.

  1. Open odrive.py for editing
  2. Look for the line self._clear_tty()
  3. Comment it out: #self._clear_tty()
  4. Save the file
  5. Then you can run that edited file by using python: python odrive.py status

Are you on Windows or Linux? I’ve had this be a persistent behavior across computers and terminals. Even my friend who’s running stock Ubuntu can replicate it.
I noticed in the odrive.py file that it runs different commands for windows vs linux (and the file has Windows line endings), so maybe that explains the difference.

But yeah, commenting out that line solves the issue.

PS. Y’all should probably put a license declaration on the py file, or at least a link to the current one. Might just be me being used to seeing that on open-source projects, but feels wrong to not have it there. But as always, IANAL, this is not legal advice, etc.

@jrwrigh.iii,
I think in my case the retention is due to the terminal software I am using on my Mac (ssh’d into Linux).

I’ll have the team take a look.