android-basic-samples icon indicating copy to clipboard operation
android-basic-samples copied to clipboard

GamesClientStatusCodes.SNAPSHOT_CONTENTS_UNAVAILABLE status code returned when opening save backing

Open JoeyRosicka opened this issue 4 years ago • 15 comments
trafficstars

A description of the problem, and the behavior you expected instead. Many of our users encounter a GamesClientStatusCodes.SNAPSHOT_CONTENTS_UNAVAILABLE status code when attempting to open their SnapshotsClient save backing on app startup. The expected behavior is for these users to be able to successfully open their save data.

A list of steps and/or a small snippet of sample code that can be taken to reproduce the problem in another app.

_snapshotsClient.open(SNAPSHOT_NAME, allowCreation).addOnCompleteListener(new OnCompleteListener<SnapshotsClient.DataOrConflict<Snapshot>>() {
public void onComplete(@NonNull Task<SnapshotsClient.DataOrConflict<Snapshot>> task) {
	shouldCancelTimer = true;
	if (openExpired) {
		debugLog("Save backing opening complete, but the timer has expired. Discarding.");
		return;
	}
	Log.tagI(TAG, "Open returned with result %s", task.isSuccessful());
	String statusMessage;
	try {
		SnapshotsClient.DataOrConflict<Snapshot> result = task.getResult(ApiException.class);
		debugLog("Result retrieved");
		if (!result.isConflict()) {// if data was successfully loaded and is up-to-date.
			snapshot = result.getData();
			statusMessage = "ok";
			debugLog("No conflict. " + (suppressLocalConflict ? "Proceeding." : "Checking for local conflict."));

...

	} catch (ApiException ex) {
		String err = "Google Play reported: " + CommonStatusCodes.getStatusCodeString(ex.getStatusCode());
		switch (ex.getStatusCode()) {
			case GamesClientStatusCodes.SNAPSHOT_CONTENTS_UNAVAILABLE: 
				statusMessage = "snapshot contents unavailable";
				openFailed(callbacks, SaveBackingErrorCode.SERVICE_ERROR, err);

...

		}
	}
}

When this bug started happening, and the frequency it occurs. The first case we saw was on July 10th, 2021 (a couple per day). We saw a surge of cases on July 23rd, 2021 (~200 per day), then a bigger surge on July 30th, 2021 (~1300 per day).

A description of any workarounds you have found. None.

A log file with a stack trace of the problem. To learn how to use the Android logging system, see Reading and Writing Logs. We are unable to reproduce this so are unable to provide logs.

The main thing we're looking for here is any details about the cause of a GamesClientStatusCodes.SNAPSHOT_CONTENTS_UNAVAILABLE status code and whether there's anything we can do on our end to try to resolve it. The timeframe of when this started appearing does not line up with any app updates or other changes on our end, so we're confused about what could have triggered the surge of these cases.

JoeyRosicka avatar Aug 01 '21 18:08 JoeyRosicka

Can you share your game package name, please?

olehkuznetsov avatar Aug 02 '21 11:08 olehkuznetsov

In regards to the cases count, do you have the same stats but for number of affected users per day?

smile616 avatar Aug 02 '21 12:08 smile616

The package name is com.concretesoftware.pbachallenge_androidmarket

As for affected users per day: July 10th: ~5 users per day July 23rd: ~100 users per day July 30th: ~600 users per day It seems like these same users are being affected day-after-day.

JoeyRosicka avatar Aug 02 '21 22:08 JoeyRosicka

Thank you, @JoeyRosicka.

smile616 avatar Aug 03 '21 09:08 smile616

Update on our end - still these same ~600 users who are getting SNAPSHOT_CONTENTS_UNAVAILABLE when attempting to retrieve their save snapshot. The documentation on this notes to "See the device logs for more details" and we have been able to take a look at some logcats, but we are not seeing anything related to the error.

It's been tough to find any additional information on SNAPSHOT_CONTENTS_UNAVAILABLE. Are there any notable situations where this error occurs?

JoeyRosicka avatar Aug 05 '21 21:08 JoeyRosicka

@JoeyRosicka, thank you for the update.

Are there any notable situations where this error occurs? Usually this code should be returned only if user lost the Internet connection while snapshot BLOB download.

We are investigating the issue on the Play Service side. Would it be possible to share logcats/bugreports with us? Preferably link to a Google Drive folder but, please, don't accept access request unless it from @google.com email addresses.

smile616 avatar Aug 06 '21 12:08 smile616

@smile616 here is a logcat from one of the affected users - I'll grant access when I see a request. https://drive.google.com/drive/folders/1kM-LysGy4xL6jcKujJAELAcVCmZNPBXz?usp=sharing

Also this is probably implied, but just in case I'll note that this is a high-priority issue for us since we have a lot of users unable to access their save data. Thanks for continuing to look into this.

JoeyRosicka avatar Aug 08 '21 00:08 JoeyRosicka

Thank you, @JoeyRosicka. Access request sent.

smile616 avatar Aug 09 '21 08:08 smile616

@JoeyRosicka We've applied some steps on the Play Service side that should mitigate the error rate. I keep the issue open for monitoring.

smile616 avatar Aug 09 '21 18:08 smile616

Thanks, very good to hear.

JoeyRosicka avatar Aug 09 '21 19:08 JoeyRosicka

It looks like the error rate has dramatically decreased since August 10th which appears to line up with when you reporting your change on the Play Services side. Now seeing 5-10 users affected per day rather than hundreds.

JoeyRosicka avatar Aug 16 '21 17:08 JoeyRosicka

Thank you, @JoeyRosicka, for the update.

smile616 avatar Aug 16 '21 17:08 smile616

No problem @smile616. Please let me know if there's anything we can do to help get the error rate down to 0.

JoeyRosicka avatar Aug 16 '21 17:08 JoeyRosicka

Hi @JoeyRosicka, unfortunately, there is nothing can be done on your side. We expect that the error rate will reduce to 0 organically by mid September.

smile616 avatar Aug 18 '21 12:08 smile616

Alright, thanks for the update.

JoeyRosicka avatar Aug 18 '21 15:08 JoeyRosicka