-
-
Notifications
You must be signed in to change notification settings - Fork 143
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
[Bug]: Caching/Seeding not working #3696
Comments
By default , the layer montpellier/Bus isn't configure to cache see lizmap-web-client/extra-modules/lizmapdemo/qgis-projects/demoqgis/montpellier.qgs.cfg Line 260 in 0879866
When testing the test project cache/bus
capabilities and seeding works as exepected I manually set "cached" = "True" in the conf file, and the layer "Bus" was then able to cache , how did you enable server caching ? However, the doc is quite confusing, the sample project file doesn't have any layer configured to allow cache. |
@nworr I'm not using the demo project. I have enabled server caching with the LM plugin (and caching is indeed enabled when navigating in LMWC). |
The dedicated test is working as expected : cypress end2end launch by github see results : test results . Locally, i can't reproduce. Does the |
Please share different commands you have launched and their outputs. |
@Gustry @nworr it seems to me that is another case of LMWC being finicky with layer names. As in #3660 it took me a few hours of troubleshooting to get to the conclusion.
Having the possibility to at least have layer names with spaces and other stuff in QGIS project is important, because otherwise this has the effect to having to change it manually in at least two other places, LM plugin and the project print layouts legends. |
More: specifying tilematrix level 0 generates en error (even if level 0 is always shown as part of the wmts:capabilities of a layer)
|
More: activating cache on a layer/datasource (gpkg) called "zona_contigua_24NM" causes the wmts:capabilities script to return an error:
|
Does your layer zona_contigua_24NM have a scale constraint ? |
@nworr yes |
Yes the it looks like none of the tile levels are within the min-max scale interval, must investigate.
|
Possibly found another corner case; I have a layer called "grid" in a geopackage with the same name. No way that this layer shows in wmts:capabilities, but at the same time LMWC correctly creates the cache while navigating the map. Maybe "grid" is some sort of reserved word? |
and overnight... it magically decided to show in the capabilities... |
@Gustry @nworr I'll continue to add questions/potential issues about caching/seeding here, let me know if/where you want me to split this into separate tickets. I have a project that returns the following capabilities
and for the layer
When I seed with the script, what do mean that first two lines that end with "!"?
|
Does
really set the rights correct for tiles when the cache dir has been set to something custom? Looking at the script it does not look like to me that is doing that, confirmed also by checking permissions after having run the seeding command. I guess that then the script should be changed, or docs changed in order to show to run the command as
|
Another thing that maybe has to be corrected in docs (https://docs.lizmap.com/current/en/admin/cache.html) is the following:
But it seems not 100% correct: my project properties has 3 CRSs listed, 3 from the CRSs represented by layers in the project and 1 added manually but in wmts:capabilities only the first 3 show:
|
One more thing for docs (I can do the PR if you ok this and the above observation): I feel that it should be clarified that the tiles to be generated for a layer are the ones with the CRS of the project, not the ones with the CRS of the layer. And that new tiles for a different CRS must be eventually generated if the project CRS changes. Maybe it would be also worth to change the seeding script to generate by default the tiles in the project CRS without having to specify it on the command line (unless it works already like this). |
Any feedback? |
Bumping my tickets before they go "quite", |
@Gustry I would really appreciate any feedback on this matter. A few months have passed and the questions have not been answered and the situation has not improved. I'm on LM 3.6.11 To try start fresh:
in LM plugin, then the folder(s) structure for the cache of the layer is created where configured here but no files are written. Permissions are ok, otherwise the folder would not be created. Both the buttons to erase the cache for the whole repo, or a single layer do work, meaning that the proper folders are delete from the file system.
despite diligently following https://docs.lizmap.com/current/en/admin/cache.html#configuring-the-caching-system pre-seeding seems also broken. Example:
and no tiles are generated. With your "montpellier" demo project is even worst: after enabling the server cache for some layer, and after generating the capabilities for the service and the layer, the seeding command says there are no layers with cache enabled:
Anything that would help understand if the issue is on my side or not would be appreciated. Bonus question: Imagining that caching is working (which is not for me on any setup I tried), what has the priority about expiration time, this in LMWC backend or this in LM plugin ? |
I changed the title because now cache and seeding are not working regardless of the source/type of layer. |
Same for me, Lizmap can't cache tiles. The directory cache structure is created but no tiles are cached (manually or using seeding).
|
thanks for confirming. |
Thanks for trying. The storage backend is Redis, not file based. It's checking exit code and STD out. No redis user ? |
@Gustry thanks for the reply. For many simple use cases Redis seems an overkill to me, but if it works... should we assume that at this moment file based caching is broken? |
Morever, does not Redis now pose a problem from a licensing point of view, at least for some potential LMWC user? |
@Gustry no changes after configuring LMWC to use Redis
|
And same thing with SQLITE. |
Nothing moves into Redis when navigating a project that has a few layers set with server cache. |
I tested the developpement stack , the /tmp/ cache folder is filled when using console or manually browsing the map, so i think it's not a cache provider problem (file/redis). @gioman , with a file cache, does browsing the map create file in cached foler ? looking at the code there's this line that disable cache when requested content don't have Can you check the mime type returned for your layer ? |
@nworr it creates JUST the folder structure, but no cache/tile files.
If so I would find this very puzzling. Can you name a project/lizmap plugin I could possibly be missing in order to not have the cache be generated? |
@nworr returned by what? The underlying WMS service? |
ok, it works (tested files for now) on a completely separated server (both Ubuntu Server 22.04) with the only difference between the two that the first is a cloud one that comes with only root, while the other was installed in a more conventional way and had a user with sudo permission that is used instead of root. Anyway this does not explain well why on the first one also Redis cache does not work. Any hint is appreciated. |
Regardless, is still not possible to generate tiles for level 0
|
The error "Error, tile not cached" comes from here
any idea of what triggers that case? |
@Gustry it is a regression somewhere in between LMWC 3.6.4 (still working) and 3.6.10 (not working). I tested a 3.6.4 and 3.6,10 installation on the same machine were I was testing 3.6.11 and on .4 caching still works as expected (used the same project ans settings on all tests). |
This also probably is not true: as I commented before I tested successfully caching with LMWC 3.6.11 on a different machine. So this is the state of my observations: *) I have a machine with Ubuntu server 22.04/apache where caching works for a LMWC 3.6.4, but not for 3.6.11 (on both a clean install of 3.6.11 and as well an installation that has been upgraded along time). Tests have been made with the very sames projects. *) Even on LMWC installations where caching works for some projects/layers is pretty easy to replicate cases where there is no way to make it acknowledge that there are layers with caching active *) caching does not work for XYZ layers, as the ones added with the QMS plugin. I have vague remembering that this worked in the past, if not or if support for this layers has been removed (from caching capabilities) then should be documented *) the pre-seeding script generates an error if seeding level 0, which is shown as part of the WMTS capabilities. |
The above it seems to have been addressed by a patch thanks @nworr ! I'm wondering if there is any chance to get any feedback about the remaining issues. I understand that the first one may be a local issue (maybe), but the second and there are probably not (the third one is not). Thanks in advance. |
Regarding the layer names, #4737 was what (finally) made caching work for me. |
Thanks @ppetru for fix. We will make releases soon |
What is the bug?
Following te commands described in
https://docs.lizmap.com/current/en/admin/cache.html#seeding
the result is always
No layers configured with cache!
even if the project has indeed layers with server caching active.
This has been tested on a LMWC 3.6.3 installation made from scratch and as well on 3.6.3 upgraded from previous releases. To note that on 3.6.2 the seeding/wmts capabilities commands were returning errors, like the ones described here
https://lists.osgeo.org/pipermail/lizmap/2023-May/000647.html
The upgrade to 3.6.3 solved the errors, but seeding is not possible as the script do not seems to detect any layer with caching active.
Steps to reproduce the issue
See above.
Versions
LMWC 3.6.3, latest versions of Lizmap plugins.
Check Lizmap plugin
QGIS server version, only if the section above doesn't mention the QGIS Server version
3.28
Operating system
Ubuntu 22.04, desktop and server
Browsers
Firefox, Chrome
Browsers version
Latest
Relevant log output
No response
The text was updated successfully, but these errors were encountered: