superset icon indicating copy to clipboard operation
superset copied to clipboard

An error occurred while rendering the visualization: Error: An API access token is required to use Mapbox GL.

Open leehwmj opened this issue 8 years ago • 10 comments

Make sure these boxes are checked before submitting your issue - thank you!

  • [x] I have checked the superset logs for python stacktraces and included it here as text if any
  • [x] I have reproduced the issue with at least the latest released version of superset
  • [x] I have checked the issue tracker for the same issue and I haven't found one similar

Superset version

0.25.0rc1

Expected results

Actual results

2018-04-27 10 04 04

(An error occurred while rendering the visualization: Error: An API access token is required to use Mapbox GL. See https://www.mapbox.com/api-documentation/#access-tokens)

Steps to reproduce

Just git clone the forked repo, and checkout 0.25.0rc1. Then install & build like :

git clone https://github.com/leehwmj-junta/incubator-superset.git apache-superset
git checkout -b version0.25 0.25.0rc1

cd apache-superset
virtualenv env
. env/bin/activate
pip install -r requirements.txt
pip install -e .
fabmanager create-admin --app superset
superset db upgrade
superset init
superset load_examples

cd superset/assets
yarn
npm run sync-backend
npm run prod

npm run dev
superset runserver -d -p 8081

login -> Dashboards -> deck.gl Demo

The result of the process described above is shown in the attached photo. I tried to resolve this error, but I could not find a way. If you know how, please help me.

thank you

leehwmj avatar Apr 27 '18 04:04 leehwmj

Have you provided a key in the environ variable?

https://github.com/apache/incubator-superset/blob/3f48c005df985888f19d46d00cac0f35ec98466d/superset/config.py#L249

vnnw avatar Apr 27 '18 11:04 vnnw

@vnnw 2018-04-27 8 38 30

Is there anything else I need to change here?

leehwmj avatar Apr 27 '18 11:04 leehwmj

Getting the same thing.. made sure MAPBOX_API_KEY is present as an env variable, and I still can't see any maps. Could this be a sudden upgrade in mapbox sdk on the client side or something?

Eli-Goldberg avatar May 05 '18 12:05 Eli-Goldberg

I can't see the map in the slice.the error msg is "https://api.mapbox.com/styles/v1/mapbox/light-v9?access_token=no_token 404" I don't know how to change the access_token

liuzn4ever avatar May 07 '18 03:05 liuzn4ever

Are you sure your superset_config.py is found and doesn't fail? If you print(MAPBOX_API_KEY) in superset_config.py do you see the key?

mistercrunch avatar May 08 '18 06:05 mistercrunch

Also if using gunicorn there's a subprocess involved so make sure to export MAPBOX_API_KEY={secret} so that it makes its way in subprocesses

mistercrunch avatar May 08 '18 06:05 mistercrunch

@mistercrunch Thank you for feedback

I could not found the superset_config.py file. How should i get or make the file? If i have to make it in any folder, which folder is correct? (And I do not use gunicorn.)

leehwmj avatar May 08 '18 07:05 leehwmj

http://superset.apache.org/installation.html#configuration

mistercrunch avatar May 09 '18 04:05 mistercrunch

image create superset_config.py into Python path

GeorgeMichael avatar Jun 19 '18 12:06 GeorgeMichael

Follow these steps to configure MAPBOX API

  1. Go to https://www.mapbox.com/ and create an account
  2. Then create your own token and copy it
  3. Locate your superset installation folder
  4. cd to your virtual environment
  5. change to Lib/site-packages/superset
  6. locate config.py
  7. Open config.py file and search for MAP_BOX_API_KEY variable and add the copied key e.g MAPBOX_API_KEY = 'YOUR_TOKEN'

Onroe avatar May 24 '20 17:05 Onroe