#HEADLESS #LINUX "Your authentication token has expired"

Did as prescribed, and all three (3) of my Insync-Headless processes are currently “SYNCING”. Will monitor to see if they actually complete, or go-off into never-never-land again.

So far (approximately 1 hour into), none have exhibited the original symptom of complaining that “Your authentication token has expired”.

1 Like

Update: I guess I spoke too soon …

Sync status: ERROR
(See insync-headless error list or insync-headless conflict list for details.)
exit1 - Your authentication token has expired. Please try logging in again.
Choose an error to resolve (1 - 1, 0 to quit): 0

PS: This did not occur for the first instance I setup, but did eventually occur on both the second and third instances.

So, maybe something up with Google not liking the additional/later authentication codes for the same account?

Another Update: Now, 2 of the 3 instances seem to have achieved “SYNCED” status. The first one that was authenticated, and the second one (which had to re-authenticate / login once). The third (the largest) is still “SYNCING”. I will let it run overnight, and check on it again in the morning.

If all three achieve “SYNCED” tomorrow, I will test to see if the authentication survives another reboot (which was also a reported symptom).

Yet Another Update:

  • The first instance (49 files, spread over 7 folders, representing about 795-MB of data.) setup is still “SYNCED” and I have verified that changes made locally are getting replicated up to Google Drive - and also the other way.
  • The second instance (3935 files, spread over 78 folders, representing about 27.5-GB of data.) says it’s “SYNCED” but no changes since then in either direction have replicated - at all. So, it does not appear to be actually working.
  • The third instance (18314 files, spread over 916 folders, representing about 18-GB of data.) still has not reached “SYNCED” status and still says “SYNCING”. No changes in either direction seem to be actually replicating. So, this instance also does not appear to be actually working.

Updated to include rough file count / size involved since the order I did this attempt was different. I setup the smallest one first this last attempt.

1 Like

This is getting to be pretty darn useless at this point.

I think I finally have all this working again, did some extra undocumented / unsuggested steps.

I am double-checking that it is all working (including sync both from the server to Google Cloud and back the other way) for all three of my Insync-Headless instances.

After/if I am sure its all working, I will post what I did here for others.

1 Like

Hey @Mecha_Weasel. I’m keeping a close eye on the updates you have for us on this thread - allow me to say a BIG thank you on behalf of our team for persevering through the 3 setups you’ve been monitoring.

Sadly, on at least once of the instances, although I have not seen the “Your authentication token has expired” error show-up again under insync-headless error list; (yet), I do see related messages in out.txt:

idesknet.httpclient.HTTPResponseError: (<HTTPStatus.BAD_REQUEST: 400>, b’{\n “error”: “invalid_grant”,\n “error_description”: “Token has been expired or revoked.”\n}’)

Going to let things run over-night and check status again in the morning (Los Angeles time).

1 Like

Unfortunately, the symptom is definitely still not resolved:

Sync status: ERROR
(See insync-headless error list or insync-headless conflict list for details.)
1 - Your authentication token has expired. Please try logging in again.
Choose an error to resolve (1 - 1, 0 to quit): 1
1 - Login
Choose an option (1 - 1, 0 to cancel): 1

Got that error for one of the three instances (so far), but I noticed these errors recuring many times in the out.txt for all three:

idesknet.httpclient.HTTPResponseError: (<HTTPStatus.BAD_REQUEST: 400>, b’{\n “error”: “invalid_grant”,\n “error_description”: “Token has been expired or revoked.”\n}’)

1 Like

PS: Also answered my own previous question regarding clearing-out old logs, etc.

  • After removing the accounts (insync-headless account remove someemailaddress@gmail.com;)
  • Quit Insync-Headless (insync-headless quit;)
  • Now should be safe to delete the stuff (delete entire .config/Insync-headless folder).
  • Also deleted some older stuff (from version 1.x?) under another folder (.config/Insync)
  • Insync-Headless will later automatically re-create .config/Insync-headless when needed.

Doing that before each attempt to re-register instance to prevent troubleshooting old data.

1 Like

Hello there,

Sorry for the late response.

I can confirm that changes didn’t fix the problem and I am experiencing the same issues explained in my previous post.

By the way, if I add the google drive account using insync GUI App then the application registers correctly in my google account as a third party application.

Thanks for the follow up.

Best,

1 Like

Alerted our team on the recurring issue! Thank you for your patience.

1 Like

PS: Also trying-out synchronizing to DropBox instead of Google Drive - just to be sure it’s specific to Google Drive.

Just for reference, syncing three instances with different sub-folders on DropBox seems to work as expected. Of course, that’s not a fix or even really a work-around, just verifies something about Insync-Google setup is root cause.

1 Like

Hello. Any news about this issue?

I am not able to sync my files from google. It’s been a month since the first post.

Same here.
@mia
Still not able to use Insync-Headless to synchronize with Google Drive.

Hi everyone! Here are a few follow-up questions from our engineer:

  1. Which URL do you get redirected to when browsing to connect.insynchq.com/auth?cloud=gd? Try visiting the said URL inside incognito/private browsing session to minimize setup conflicts as much as possible.
  2. Do you have multiple Google accounts signed in on the browser, or just one account?

When I go there (connect.insynchq.com/auth?cloud=gd?), it redirects me here:
https://accounts.google.com/o/oauth2/auth/oauthchooseaccount? (plus lots of stuff on the end of this).

I am doing this in Chrome, I am logged-into two different Google accounts in Chrome, so it prompts me which to use, and I select the correct one.

If I do it in an incognito Window, it sends me here to login:
https://accounts.google.com/v3/signin/identifier? (plus more stuff on the end of this)

1 Like

Thanks @Mecha_Weasel. Let me forward this info to our engineers and I’ll let you know if we need further details!

Hi @Mecha_Weasel

Again, we can’t thank you enough for your continued cooperation with the issue even if it has already been frustrating for you. :pray:

Replicating the same scenario that you have on our end, we’ve finally identified that the issue occurs when multiple Insync instances which use the same account and logged in via an auth code either through alternative login (in the GUI client) or web login (https://connect.insynchq.com/auth?cloud=gd) – again, huge thanks to you.

In line with this, we have this updated workaround. Specifically, the URL in step 3 has been updated with the proper parameters. A more permanent fix to both the client and the URL will be released soon.

  1. Remove the affected account from Insync via insync-headless account remove
  2. Remove Insync permissions for the affected account from https://myaccount.google.com/u/0/permissions
  3. Browse to the following URL and select the account to be used: https://accounts.google.com/o/oauth2/auth/oauthchooseaccount?response_type=code&client_id=468017360789-e4camv9a5n4e90tk4vrpk49qonmcm95s.apps.googleusercontent.com&redirect_uri=https%3A%2F%2Fconnect.insynchq.com%2Fauth-login&scope=openid%20email%20profile%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.appdata&access_type=offline&prompt=consent&service=lso&o2v=1&flowName=GeneralOAuthFlow
  4. Add the account via insync-headless account add -a [auth code] -c gd using the auth code given in step 3

Steps 3-4 should be done for each Insync instance.

1 Like