Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

map is not shown #370

Closed
najtin opened this issue Oct 22, 2020 · 11 comments
Closed

map is not shown #370

najtin opened this issue Oct 22, 2020 · 11 comments

Comments

@najtin
Copy link

najtin commented Oct 22, 2020

Expected Behavior

map should be shown

Actual Behavior

map is not shown

grafik

Environment

  • OS: Ubuntu Mate 20.04.1
  • Browser & Version: Firefox Version: 81.0.2+build1-0ubuntu0.20.04.1
@ubergesundheit
Copy link
Member

Hi najtin ,

can you provide a screenshot of your browsers developer tools (Press F12, select Console and refresh the page)? This would help us in resolving this problem.

@najtin
Copy link
Author

najtin commented Oct 23, 2020

sure
grafik

@ubergesundheit
Copy link
Member

najtin, do you have any browser plugins installed which could cause this?

@felixerdy do you have an idea?

@najtin
Copy link
Author

najtin commented Oct 23, 2020

$ curl https://api.mapbox.com/styles/v1/mapbox/streets-v11/tiles/2/1/0?access_token=pk.eyJ1Ijoic2Vuc2Vib3giLCJhIjoiY2p1Y2x6NXl1MG5wNDN6cGk1MGc2cGZhaSJ9.HRwU3DShLMEtj_UHYlqb8g {"message":"Forbidden"}

Tested it in two different networks

@felixerdy
Copy link
Member

The mapbox access_token is equipped with an URL restriction. Only opensensemap.org can access tiles with this access_token

@najtin
Copy link
Author

najtin commented Oct 23, 2020

The mapbox access_token is equipped with an URL restriction. Only opensensemap.org can access tiles with this access_token

do you mean the client side opensensemap.org or the server?

@najtin
Copy link
Author

najtin commented Oct 23, 2020

najtin, do you have any browser plugins installed which could cause this?

yes uMatrix, but i lifted all restrictions for this domain

@felixerdy
Copy link
Member

The mapbox access_token is equipped with an URL restriction. Only opensensemap.org can access tiles with this access_token

do you mean the client side opensensemap.org or the server?

Well client side I guess. Could you check again now? I just added api.mapbox.com to the URL restriction list as stated in the mapbox docs: https://docs.mapbox.com/accounts/overview/tokens/#add-url-restrictions-to-access-tokens

@najtin
Copy link
Author

najtin commented Oct 23, 2020

Same result.
Here is the answer of one of the requests:

GEThttps://api.mapbox.com/styles/v1/mapbox/streets-v11/tiles/2/1/0?access_token=pk.eyJ1Ijoic2Vuc2Vib3giLCJhIjoiY2p1Y2x6NXl1MG5wNDN6cGk1MGc2cGZhaSJ9.HRwU3DShLMEtj_UHYlqb8g
[HTTP/1.1 403 Forbidden 648ms]

GET
https://api.mapbox.com/styles/v1/mapbox/streets-v11/tiles/2/1/0?access_token=pk.eyJ1Ijoic2Vuc2Vib3giLCJhIjoiY2p1Y2x6NXl1MG5wNDN6cGk1MGc2cGZhaSJ9.HRwU3DShLMEtj_UHYlqb8g
Status403
Forbidden
VersionHTTP/1.1
Übertragen565 B (23 B Größe)

HTTP/1.1 403 Forbidden

Content-Type: application/json; charset=utf-8

Content-Length: 23

Connection: keep-alive

Date: Fri, 23 Oct 2020 12:35:48 GMT

X-Powered-By: Express

Access-Control-Allow-Origin: *

Access-Control-Allow-Methods: GET

Cache-Control: no-cache

X-Content-Type-Options: nosniff

ETag: W/"17-bqIm6pxC4cx+ZoszvXxsClwgWw8"

X-Cache: Error from cloudfront

Via: 1.1 e9ece8a38ce6bb2b68b3b5a87615cfee.cloudfront.net (CloudFront)

X-Amz-Cf-Pop: TLV50-C1

X-Amz-Cf-Id: JloSLTJD_U2axNTVflxtbMLUX8g8jASpinVwFm7KIv9wxXwS_twl7Q==
	
Accept
	image/webp,*/*
Accept-Encoding
	gzip, deflate, br
Accept-Language
	de,en-US;q=0.7,en;q=0.3
Cache-Control
	no-cache
Connection
	keep-alive
DNT
	1
Host
	api.mapbox.com
Pragma
	no-cache
Referer
	https://api.mapbox.com/
User-Agent
	Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:81.0) Gecko/20100101 Firefox/81.0

@najtin
Copy link
Author

najtin commented Oct 23, 2020

Does X-Cache: Error from cloudfront mean anything?

@mpfeil
Copy link
Member

mpfeil commented Jul 20, 2021

Going to close this issue.
The token is restricted to request coming form opensensemap.org.

$ curl https://api.mapbox.com/styles/v1/mapbox/streets-v11/tiles/2/1/0?access_token=pk.eyJ1Ijoic2Vuc2Vib3giLCJhIjoiY2p1Y2x6NXl1MG5wNDN6cGk1MGc2cGZhaSJ9.HRwU3DShLMEtj_UHYlqb8g {"message":"Forbidden"}

Tested it in two different networks
Having the same error if I am calling it directly in my browser.

Feel free to open this issue again if you are not seeing the tiles on opensensemap.org.

If you are hosting an own instance or running it locally you have to provide your own Mapbox Access Token.

@mpfeil mpfeil closed this as completed Jul 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants