Mapbox [info] Request failed due to a permanent error: Canceled

See original GitHub issue

I’m constantly facing with this problem. Every time when its loading or zooming or panning or do anything always logging this problem. Even sometimes giving it in yellow box. This is the message :

Mapbox [info] Request failed due to a permanent error: Canceled {“level”: “warning”, “message”: "Request failed due to a permanent error: Canceled ", “tag”: “Mbgl-HttpRequest”}

I dont know that to do. I give permissions to work but still the same. This is the AndroidManifest.xml

    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> 

And then i am checking user accepted or not

RequestPermision = async () => {
        const permission = await MapboxGL.requestAndroidLocationPermissions();
        this.setState({ permissionIsGranted: permission });
    } 

if user give the permission i show the map. Can you help me ?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:6
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

24reactions
ferdicuscommented, Apr 15, 2021

To elaborate a bit on mfazekas reply: This is normal behaviour of Mapbox as described in this upstream ticket. In short, when zooming or panning around, operations that were about to load tiles from the server will be cancelled as they are no longer valid - this message is just notifying devs about this action.

It can be annoying at times to, that’s why the repo exposes the Logger class to users, and you can disable/ ignore all sorts of warning/ errors that you dislike - it was mentioned in this ticket, however I’ll give an example here as well for easy copy/ paste usage:

import Mapbox, { Logger } from '@react-native-mapbox-gl/maps';

// edit logging messages
Logger.setLogCallback(log => {
  const { message } = log;

  // expected warnings - see https://github.com/mapbox/mapbox-gl-native/issues/15341#issuecomment-522889062
  if (
    message.match('Request failed due to a permanent error: Canceled') ||
    message.match('Request failed due to a permanent error: Socket Closed')
  ) {
    return true;
  }
  return false;
});

If you’re using TS, you’ll get a linting warning, mentioning, that Logger is not exported - I’ll open a PR for that ~this week~ some time.

Cheers 🍻

7reactions
mfazekascommented, Jun 30, 2020

This is normal, when zooming. You can supress this with a custom logCallback, if you’d like to.

https://github.com/react-native-mapbox-gl/maps/blob/498b86b01e7956ac3d1319ac4918e2ee49d57333/javascript/utils/Logger.js#L20-L27

Read more comments on GitHub >

github_iconTop Results From Across the Web

Mapbox [info] Request failed due to a permanent error ...
To elaborate a bit on mfazekas reply: This is normal behaviour of Mapbox as described in this upstream ticket. In short, when zooming...
Read more >
MapBox: Request failed due to a permanent error: Attempt to ...
I'm trying to download the map with OfflineManager of MapBox SDK. My style is located in the assets folder ...
Read more >
r/mapbox - Hey there I have been looking for a proper ... - Reddit
I found https://github.com/react-native-mapbox-gl/maps ... give warning like Mapbox [info] Request failed due to a permanent error: Canceled ...
Read more >
rnmapbox/Lobby - Gitter
[Thu Jun 25 2020 03:08:46.656] LOG Mapbox [info] Request failed due to a permanent error: Canceled {"level": "warning", "message": "Request failed due to...
Read more >
Index (Mapbox Maps SDK for Android 9.5.0 Reference)
Set a callback that's invoked when the map failed to load. ... Cancel the prefetch ambient cache request. ... Returns the mathematical constant...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found