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

vu app not taking uri_prefix into account (was uri_prefix not working on versions > 0.13.0) #904

Closed
JackMcKew opened this issue Jan 18, 2023 · 6 comments · Fixed by #967
Closed
Assignees

Comments

@JackMcKew
Copy link

I've been recently trying to upgrade from version 0.13.0 to 0.16.0. My use case depends on the uri_prefix because I'm using a proxy via an ingress in Kubernetes.

My config looks like

[webserver]
port = ":80"
uri_prefix = "/public/map-tile-server-tegola"

[cache]
type = "s3"
bucket = "map-tiles-cache"
basepath = "staging"
region = "ap-southeast-2"
aws_access_key_id = "${AWS_S3_MAP_TILES_CACHE_USER_ACCESS_KEY_ID}"
aws_secret_access_key = "${AWS_S3_MAP_TILES_CACHE_USER_SECRET_ACCESS_KEY}"

[[providers]]
name = "map_tiles"
type = "mvt_postgis"
uri = "postgresql://${AWS_AURORA_MAP_TILES_DB_USERNAME}:${AWS_AURORA_MAP_TILES_DB_PASSWORD}@${AWS_AURORA_MAP_TILES_DB_HOST}:${AWS_AURORA_MAP_TILES_DB_PORT}/${AWS_AURORA_MAP_TILES_DB_DATABASE}?default_transaction_read_only=false&pool_max_conn_idle_time=5"
srid = 4_326

	[[providers.layers]]
	  name = "activity-heatmap"
	  geometry_fieldname = "geom"
	  id_fieldname = "ogc_fid"
	  sql = "SELECT ogc_fid, url, texttodisplay, icontoshow, count, ST_AsMVTGeom(ST_Multi(wkb_geometry),!BBOX!) AS geom FROM map_tiles.source_layers WHERE \"layer\" = 'activity_heatmap' AND wkb_geometry && !BBOX!"


[[maps]]
name = "map_tiles"

  [[maps.layers]]
  provider_layer = "map_tiles.activity-heatmap"
  min_zoom = 11
  max_zoom = 11

When I spin this up locally using the following Dockerfile:

FROM gospatial/tegola:v0.13.0 as builder
EXPOSE 80

COPY file-store/tegola-config /opt/tegola_config

CMD ["serve", "--config=/opt/tegola_config/config.toml"]

On versions 0.13.0+, I can reach localhost/public/map-tile-server-tegola/capabilities, the json returns as expected. However, if I head to localhost/public/map-tile-server-tegola, all I see is 404 responses.

On version 0.13.0, this shows the viewer as expected.

Let me know if you can't reproduce this issue

@iwpnd
Copy link
Member

iwpnd commented Jan 18, 2023

Hey! Any chance this is because of that botched SRID in the provider config?

@JackMcKew
Copy link
Author

JackMcKew commented Jan 18, 2023

Hey 👋

The underscores in the SRID don't make a difference

https://toml.io/en/v1.0.0

@iwpnd
Copy link
Member

iwpnd commented Jan 18, 2023

The underscores in the SRID don't make a difference

today I learned it also is supported in toml

Let me go ahead and try to reproduce the issue

update:

yup, reproducible.
However, this "only" affects the viewer. Tiles are served correctly at:

http://localhost:8080/public/map-tile-server-tegola/maps/map_tiles/{z}/{x}/{y}.pbf

I don't really see why this would happen, as the viewer endpoints are attached to the same group as all the other endpoints.

@JackMcKew
Copy link
Author

Ah awesome, at least the tiles are still being served correctly, was throwing me down all sorts of rabbit holes

I'll leave this issue open as it definitely affected me

@ARolek
Copy link
Member

ARolek commented Jan 25, 2023

@iwpnd did you find the root cause of this issue? I will need to look through the commit log to figure out when this change occurred.

@iwpnd
Copy link
Member

iwpnd commented Jan 25, 2023

i did not go down the rabbithole just yet, nope

update:
while you can point the http.FS of the built viewer to whatever uri_prefix you like, the vuejs app itself is using / as apiRoot. So when the app is starting and trying to collect information from /capabilities although your capabilities are at /my_prefix/capabilities, the catch statement is printing the resulting 404. So I think this is an issue with the vuejs app, rather than tegola server.

@gdey gdey assigned ARolek and mapl Mar 14, 2023
@gdey gdey changed the title uri_prefix not working on versions > 0.13.0 vu app not taking uri_prefix into account (was uri_prefix not working on versions > 0.13.0) Mar 14, 2023
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

Successfully merging a pull request may close this issue.

4 participants