Closed JorgenEngenNapstad closed 6 years ago
Hm, not sure if no 'ETag' header present in response
is the reason for the crash as this is just a warning and not an error and shouldn't do any harm.
I suspect another (iOS/Unity) problem surfaces via the ETag
warning.
Because when I check one of the above error URLs in the browser, eg https://api.mapbox.com:443/v4/mapbox.terrain-rgb/12/2073/1190.pngraw?events=true&access_token=pk.####
, the response does have an ETag
.
@JorgenEngenNapstad
CFNETWORK_DIAGNOSTICS
in XCODE to 3
. That should give you more low level information about the requests - and the reason of their failure.2.1 We can try using a newer version of Unity. What do you mean with different version of iOS? We are getting the error on several devices running different iOS versions (all of them above 10).
2.2 Will try this first and see if we get an error message giving us a better idea of whats happening.
- Yes, we get tiles. Some times it crashes fast (eg. almost immediately after opening the app) and some times we can pan and zoom around loading several tiles before it crashes.
hm, maybe the crashes are not web request related then. The problems we saw were always from first request on.
You could try to attach TileErrorHandler.cs
to your map object and check if you get more information related to tile loading.
2.1 We can try using a newer version of Unity. What do you mean with different version of iOS? We are getting the error on several devices running different iOS versions (all of them above 10).
Unfortunately I don't remember the exact version numbers neither for Unity nor for iOS but we saw apps crash on simple web requests for no apparent reason on some devices - other devices with different iOS worked. Switching to another Unity version crashes disappeared on all devices.
Changing the build settings from Always use latest 2017.3
to Always use latest 2017.x
in Unity Cloud Build seems to have solved it actually. Haven't had time to debug it any more. Would be interesting to figure out what happened though.
This issue has popped up for me now.
We're using a Unity 2018.3.0b9 and we've just upgraded the project to 2018.3.0f1
On the older beta version of Unity everything was fine then one day iOS builds began crashing with the same issue as above, a constant feed of no response which causes the app to crash. We upgraded the version of Unity but the issue still persists. Initially we were using a custom map style but i've tried going back to a default map style but to no avail.
The app we're using is processing other web requests at the same time, but this didn't change between having a working version and a broken version.
Same issue here on Unity 2018.2.19f1. App is not crashing but throwing warnings on production: Does someone have an idea to fix this?
no \'ETag\' header present in response for https://api.mapbox.com:443/v4/xxxxxxxxxx?events=true&access_token=xxxxxxxxxx : _Mapbox.Platform.Cache.
@jeffries7 @anthodb
no 'ETag' header present
is just a warning
https://github.com/mapbox/mapbox-unity-sdk/blob/66b9056b25684f91c0aaf18223c5ce5444eb7646/sdkproject/Assets/Mapbox/Core/mapbox-sdk-cs/Platform/Cache/CachingWebFileSource.cs#L241
but might hint that something else is wrong with regards to networking:
Please take a look at my comment and other comment above (just before yours) and see if you can get more information using the suggestions supplied there.
Thanks a lot for your answer! I'll try to just remove this warning inside the plugin or using reflexion. I'll keep this updated if I find a workaround.
I found the cause of my issue. I was trying to load to many tiles when loading the app, this wasn't an issue on Samsung devices but we noticed crashes on other android devices and on all iOS devices. I've since limited how many tiles can be loaded within a certain period of time.
For exmaple if I try and load 7x7 around the player on an iPhone XR then it crashes, although we're also processing other web calls so this could also be contributing.
@BergWerkGIS
I found out why "no 'ETag' header present" warning is happened. In iOS, response header has "Etag" key, not "ETag", so mapbox-sdk cannot find "ETag" header key.
You can find this by logging headerKey in WWWConnection.mm (which is generated by Unity) like below.
// In (void)handleResponse:(NSURLResponse*)response method
for (id headerKey = [headerEnum nextObject]; headerKey; headerKey = [headerEnum nextObject]) {
NSLog(@"%@", headerKey);
UnityReportWWWResponseHeader(self.udata, [headerKey UTF8String], [[respHeader objectForKey: headerKey] UTF8String]);
}
My environment:
FYI:
In allHeaderFields
method, the characters of header keys are automatically changed like ETag
-> Etag
.
what's the fix
Bumping this as I am also receiving multiple ETag warnings in iOS Builds:
"no 'ETag' header present in response for https://api.mapbox.com:443/v4/mapbox.satellite"
whilst its true they are "only warnings", they are followed by this exception
"System.Collections.Generic.Dictionary2[TKey,TValue].get_Item (TKey key) (at <00000000000000000000000000000000>:0) Mapbox.Platform.Cache.CachingWebFileSource+<>c__DisplayClass12_0.<Request>b__0 (Mapbox.Platform.Response headerOnly) (at <00000000000000000000000000000000>:0) System.Action
1[T].Invoke (T obj) (at <00000000000000000000000000000000>:0)
Mapbox.Unity.Utilities.HTTPRequest+
@BergWerkGIS if the above information in @ask-a-lie post is correct, can that not be hot fixed by Mapbox?
thanks guys.
I have the same issue. When running the app for the first time on a device, this happens always and the map does not initialize and when it fails after 20 seconds or so I have it setup to reload the scene by pressing a button and retrying/reloading works almost instantly but it is a really bad user experience to have to wait 30 seconds before entering the app.
EDIT: My issue with the scene not loading the first time a user enters the app seems to be actually connected with loading the said scene async as an Additive scene.. I don't know why this happens, but when I load the scene additively the Etag warnings appear, when I load it as a Single scene, I instead get the Dictionary exceptions as @vinnievivace mentions above.
I have same issue when running mobile app first time on a device. How can I fix this?
I have success. You just should find CachingWebFileSource.cs in Unity project and make veriant for ETag, like this:
Getting an error which is crashing the iOS build. Excerpt of the log from xcode below. The "no 'ETag' header present" message is repeated 50+ times before it crashes. Anything I'm missing, or is it a bug?