Recurring “Unable to fetch app definition / Calendar Unauthorized” error — how can I fix this permanently?

I’m getting the error shown in the attached image.


I was able to restore the app by reconnecting/re-authenticating the Calendar account, and the app is working normally again now. However, this is the same error I used to experience frequently in the past.

At that time, the app was connected to a Calendar account belonging to a different user from the app administrator/owner. Based on instructions from AppSheet Support, I changed the Calendar account to the same Google account as the app administrator. After doing that, the problem stopped occurring for quite a while.

Today, however, the same error suddenly appeared again. I’m not sure exactly when it happened or what triggered it.

I have experienced this error many times in the past, but I still don’t understand the root cause.

One thing I noticed is that it may have happened around the same time that I canceled an AppSheet subscription on a completely separate account. However, I’m skeptical that the two are related.

The error includes messages such as:

“Unable to fetch app definition”
“The service calendar has thrown an exception”
“HttpStatusCode is Unauthorized”
“Request had invalid authentication credentials”

Re-authenticating the Calendar account fixes the problem temporarily, but I would like to understand why the authentication becomes invalid in the first place and how to prevent this from happening again.

Has anyone experienced the same issue?

More importantly, is there a way to fix this permanently rather than simply reconnecting the Calendar account each time it happens?

Please contact Support for help with this. This is likely due to some internal magic you can’t affect yourself.

Attn @Jose_Arteaga

Thanks @Steve,

It’s good to see you again @suzukixxx !

Could you share the bug id’s you have raised in the past? I would like to look at the notes there and see if I can find something.

Thank you.
Where can I find the bug ID?
I was able to locate the inquiry ID; it is “0-7298000039431”.

Thanks for your continued help. I previously contacted support about this issue, but since I recently cancelled my subscription, I’ve ended up back here.

Thanks @suzukixxx,

Have you tried the solution proposed in this thread?

Thanks for your reply.

I had seen that post several times before, but because the frequency of the issue seemed different, I had assumed it was probably not the same problem.

However, now that I think about it, the frequency of the error does seem to vary depending on how the devices are being used, so I should probably reconsider that possibility. We mainly use the AppSheet app on three devices, and I do not have full visibility into how all of those devices are being used, so this is certainly possible.

Let me reorganize the situation and ask the question again.

This app is used by three user accounts: A, B, and C.

The AppSheet app owner account has always been A.

The owner/account used for the Google Calendar integration was previously B, but I later changed it to A. After making that change, the problem definitely occurred much less frequently.

When this issue happened again recently, the account being used at the time — or, using the terminology from this discussion, the account that may have performed the action of “using another Google account” — was most likely B or C. There is still a small possibility that it was A, but I think that is less likely.

In this situation, what kind of action do you think B or C was most likely performing when the problem was triggered?

The idea that “using another Google account” is the trigger does seem quite suspicious. However, I would like to understand exactly what that means.

Does it mean:

  • using a different Google account within AppSheet,
  • using a different Google account specifically for Google Calendar,
  • or simply signing into another Google account on that device/browser, even outside AppSheet?

I am trying to narrow down the likely trigger so that I can determine the appropriate preventive measure.

I realize this question may go slightly beyond AppSheet itself, so if it is outside the scope of this community, please feel free to ignore it.

I’m a bit confused about the setup, so let me just share the ideal setup:

  • The app should be configured to access the calendar as the app owner, not as the app user.
  • The calendar should be owned by the app owner, not anyone else.

If your app is configured to access the calendar as the app user, the app’s ability to access the calendar for a particular user may be affected by how recently that user has visited Google Calendar itself. If you experience the problem, try browsing to https://calendar.google.com, logging in there if needed, then retry from the AppSheet app.

Another thing to try: when the problem occurs, visit https://calendar.google.com and check which user you’re logged in as. Is it a user that has access to the calendar the app is trying to access?

Thank you. I think you’re right.

Support pointed out the same thing to me, and I believe it was sometime last year that I changed the setup so that the AppSheet app owner and the Google Calendar owner were the same account. After that, I thought the error had completely stopped occurring.

What makes the situation slightly complicated is that the original owner of that calendar was actually one of the users of this app.

Your comment helped me understand another possibility: that this user may have performed some action that caused them to access the calendar—whose ownership had already been transferred—as if it were still their own calendar.

That does seem like a plausible scenario.

If the same issue happens again, I’ll ask each user exactly how they were accessing or using Google Calendar at the time.

Great news!

Friendly reminder, please consider marking it with the ✓ (Solution) icon below the post!

By marking the response that helped you as the accepted solution, it will make it much easier for other users with similar questions to find the answer.