#HEADLESS #LINUX "Your authentication token has expired"

@Mecha_Weasel

Hello! Thank you so much for the detailed walk-through of what has happened in the last few days, and my sincerest apologies for the continued troubles.

For the 2nd and 3rd setups, could you also please send me the latest set of log files namely:

  • logs.db
  • out.txt
  • data folder
  • live folder

Please do send them once more to support@insynchq.com with the link to this post.

Sent logs.db and out.txt for all three instances. However, the data and live folders are way too big to email.

1 Like

Understood! If and when you can, you may upload it in the cloud (i.e., WeTransfer) and send me a shared link I can access and download the files from. :slight_smile:

Done.
Sent the WeTransfer link to Support@InsyncHQ.com

1 Like

Hi @Mecha_Weasel,

Thanks for sending us the logs. Upon checking them, instances 2 and 3 are still running into the authentication token issue.

Just to confirm, were you able to perform the step below before clicking on the link? This is a necessary prerequisite to fix the issue with the non-refreshing token.

Remove Insync from the affected Google Account in https://myaccount.google.com/u/0/permissions

On top of that, please remove the said account with insync-headless account remove prior to removing it via the link above.

To summarize:

  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. Sign in with the said account at https://accounts.google.com/o/oauth2/auth/oauthchooseaccount?response_type=code&client_id=468017360789-e4camv9a5n4e90tk4vrpk49qonmcm95s.apps.googleusercontent.com&scope=openid%20email%20profile%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive%20https%3A%2F%2Fwww.googleapis.com%2Fauth%2Fdrive.appdata&state=gd&redirect_uri=https%3A%2F%2Fconnect.insynchq.com%2Fauth-login&hl=en&service=lso&o2v=1&flowName=GeneralOAuthFlow&access_type=offline
  4. Add the account via insync-headless account add using the auth code given after step 3
  5. Insync should start syncing

Please let us know if it works for you. Again, thank you for your patience and cooperation!

1 Like

I tried last instructions and did not work for me.

With the authorization token received in step 3 (I did the first two without issues), I tried to add the account using insync-headless but received the following message:

Sorry, an error occurred: (<HTTPStatus.BAD_REQUEST: 400>, b'{\n  "error": "redirect_uri_mismatch",\n  "error_description": "Bad Request"\n}')

When I reviewed my google account page I saw that Insynchq was not in the allowed applications

This means that, although I received a token, the application didn’t register properly in my google account.

Yes, removed the account from all three instances of Insync-Headless.
Then, removed Insync from Google Account permissions.

When I re-added the first account, I used the special link.
It said it successfully added the account, but within minutes it threw the error about logging-in again (which I did).

After that the status stayed “SYNCING” - never completing. Never changing to “SYNCED”.

Later, I re-added the account to the other two (2nd and 3rd) instances - also generating the auth code with the special link provided. The did not immediately prompt for re-login, but also are stuck “SYNCING” - forever (including the smallest one). However, later (today) the 2nd did prompt for re-login (which I did). So far, the 3rd has not thrown that error again (yet).

Obviously, I did NOT remove the Insync permissions between adding the 1st instance and adding the 2nd and 3rd instances - as that would presumably break the authentication for the 1st instance?.

In the Google Account, its NOT like it shows-up as three separate applications - its all just “Insync”.

1 Like

Hey @Mecha_Weasel and @maicmarin! I’ll forward this to our engineers and get back to you both accordingly. Thank you!

Hi all! We’ve made further improvements to simplify the steps in our solution, please refer to the steps below:

  1. Remove the affected account from all Insync instances via insync-headless account remove
  2. Remove Insync permissions for the affected account from https://myaccount.google.com/u/0/permissions
  3. Perform the headless login flow as usual.

@Mecha_Weasel @maicmarin May we ask you to please try again, this time with the three steps above? As per our Linux Team, they have already deployed a fix to web and have confirmed the steps to be working on their end. Thank you very much!

1 Like

Thanks, will try it today/tonight and update.

PS: Is there any way to clear-out logs and such between attempts? Just to be sure we’re not submitting logs from old attempts and such?

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