question

Andy Maddison avatar image
Andy Maddison asked

ServiceUnavailable when trying to login on device and in Unity editor

My other title is working fine. Any idea why this isn't now?

Title Id 18D2

Error (code): ServiceUnavailable

(ErrorMessage: Unhandled error in PlayFabWWW: Ionic.Zlib.ZlibException: Bad GZIP header.

at Ionic.Zlib.ZlibBaseStream._ReadAndValidateGzipHeader () [0x00000] in <filename unknown>:0

at Ionic.Zlib.ZlibBaseStream.Read (System.Byte[] buffer, Int32 offset, Int32 count) [0x00000] in <filename unknown>:0

at Ionic.Zlib.GZipStream.Read (System.Byte[] buffer, Int32 offset, Int32 count) [0x00000] in <filename unknown>:0

at PlayFab.Internal.PlayFabWww+<Post>c__Iterator29.MoveNext () [0x00000] in <filename unknown>:0

HttpCode: 400

HttpStatus: BadRequest

7 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jferano avatar image jferano commented ·

I'm having a similar issue, however, Compress API Data flag isn't working for me. I check it on, save, but then it gets turned off when I run the editor. Does that flag need to be set?

Unhandled error in PlayFabWWW: Ionic.Zlib.ZlibException: Bad GZIP header.
  at Ionic.Zlib.ZlibBaseStream._ReadAndValidateGzipHeader () [0x00056] in /Users/josephferano/Documents/Work/breachtd_ios/Assets/PlayFabSdk/Shared/Ionic.Zlib/ZlibBaseStream.cs:388 
  at Ionic.Zlib.ZlibBaseStream.Read (System.Byte[] buffer, Int32 offset, Int32 count) [0x0004a] in /Users/josephferano/Documents/Work/breachtd_ios/Assets/PlayFabSdk/Shared/Ionic.Zlib/ZlibBaseStream.cs:436 
  at Ionic.Zlib.GZipStream.Read (System.Byte[] buffer, Int32 offset, Int32 count) [0x00016] in /Users/josephferano/Documents/Work/breachtd_ios/Assets/PlayFabSdk/Shared/Ionic.Zlib/GZipStream.cs:776 
  at PlayFab.Internal.PlayFabWww+<Post>c__IteratorD0.MoveNext () [0x00104] in /Users/josephferano/Documents/Work/breachtd_ios/Assets/PlayFabSdk/Shared/Internal/PlayFabHttp/PlayFabWWW.cs:185 
UnityEngine.Debug:Log(Object)
0 Likes 0 ·
Show more comments
Andy Maddison avatar image
Andy Maddison answered

Actually I've now realised that this is because of the Compress API Data setting in the shared settings asset.

The asset in the downloaded package has it set off, yet the asset created from the menu item (CreateSharedSettings) has it set on. I had recreated the asset via the menu due to other problems, but why is it set on when done this way?

This also brings me to another of my gripes: having settings asset in the package is bad. All it needs is an import of a package and settings are lost. Try it. Import the package, set the title id on the asset. Deselect. Import again and the title id is blank again.

My advice would be to have an editor script that auto-creates the asset if it does not exist, but never have it in the package.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

marcowilliamspf avatar image marcowilliamspf commented ·
@Andy Maddison

Thanks for the feedback, we'll look into this bug. Not sure when we'll get it resolved, but it is a known bug that settings are being lost when re-importing. The fix is to go into editor extensions, and re-save the settings. The editor extensions will remember all your setting regardless of the settings files state.

This is a workaround fix, we do know it is an annoyance and hopefully we will have a fix for it soon.

0 Likes 0 ·
Andy Maddison avatar image
Andy Maddison answered

Just want to say a bit more about this.

Still not fixed. Just updated after a while and again lost settings. I don't know what editor extensions is. It's not an option under the PlayFab menu dropdown.

I may well move the asset out of PlayFab so that it cannot be overwritten next time. Of course if I simply import the whole package next time (forgetting to uncheck the asset) I'll then have 2 assets and I'll get the exception at runtime from GetSharedSettingsObjectPrivate - why not add some editor code to check this and print a warning message?

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

jeremyswigart avatar image
jeremyswigart answered

If you inspect the www when you get this error it appears that even though there is a gzip content-encoding error the actual content is not compressed, hence the GZipStream choking on it. I see that www.text is uncompressed text. Interestingly this happens for me in Unity(2017.2.0f3) on OSX, while a coworker who is on windows gets a proper compressed response.

,

It appears that the issue is that there is a gzip content-encoding header when the contents of the response are not actually gzipped. You can confirm as much by inspecting the www.text field and seeing that it is uncompressed text. I assume something on the API is going badly where it is setting the response header as a result of the "Compress Api Data" option that gets sent as part of the query but then doesn't actually send the compressed data.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.