Open Raruto opened 1 year ago
I need to double check, as I noticed that by editing with QGIS a file (ref: building-management-demo.qgs
--> building-management-demo-2.qgs
) the paths are now saved in absolute manner:
<Layer provider="spatialite" source="dbname='C:/Users/<USERNAME>/Desktop/G3WSUITE_3.5/project_data/spatialite/building_management_demo.sqlite' ...
@Raruto the new project replaces the old file name, but the content matches the new one right?
the new project replaces the old file name, but the content matches the new one right?
This happens with 100% probability:
building-management-demo.qgs
with: building-management-demo-2.qgs
within the edit page and you should get:But, on frontend, I think there could be some other caching issues.
To be clear, this should be the main difference between the two projects (3 layer categories vs 1 layer category):
But after trying to reload the frontend map (several times and after replacing: building-management-demo.qgs with building-management-demo-2.qgs), it happens very often that the project remains in this previouse state, ie:
Once has happened that the classes that should be hidden are still displayed, but greyed out:
The project seems to have loaded correctly only the first time I re-loaded the page:
This behavior happens to me too some times, I think is related to development environment, we can try settings this django settings to True:
G3WADMIN_USE_CUSTOM_CACHE_INVALIDATOR = True
@wlorenzetti I set this in my settings_docker.py
,
G3WADMIN_USE_CUSTOM_CACHE_INVALIDATOR = True
but I can't get these debug lines to printed in the console:
Do I have to change some other setting in here?
# g3w-suite-docker/g3w-suite/settings_docker.py#L133-L208
LOGGING = {
'version': 1,
'disable_existing_loggers': False,
'filters': {
'require_debug_false': {
'()': 'django.utils.log.RequireDebugFalse'
},
'require_debug_true': {
'()': 'django.utils.log.RequireDebugTrue'
}
},
'formatters': {
'verbose': {
'format': '%(levelname)s %(asctime)s %(module)s %(process)d %(thread)d %(message)s'
},
'simple': {
'format': '%(levelname)s %(message)s'
},
},
'handlers': {
'mail_admins': {
'level': 'ERROR',
'filters': ['require_debug_false'],
'class': 'django.utils.log.AdminEmailHandler',
'formatter': 'verbose'
},
'file': {
'level': 'ERROR',
'class': 'logging.FileHandler',
'filename': '/tmp/error.log',
'formatter': 'verbose'
},
'file_debug': {
'level': 'DEBUG',
'filters': ['require_debug_true'],
'class': 'logging.FileHandler',
'filename': '/tmp/debug.log',
'formatter': 'verbose'
},
'console': {
'level': 'DEBUG',
'class': 'logging.StreamHandler',
},
},
'loggers': {
'django.request': {
'handlers': ['console', 'mail_admins'],
'level': 'ERROR',
'propagate': True,
},
'g3wadmin.debug': {
'handlers': ['console'],
'level': 'DEBUG',
},
'pycsw.server': {
'handlers': ['console'],
'level': 'ERROR',
},
'django.db.backends': {
'handlers': ['console'],
'level': 'ERROR',
},
'catalog': {
'handlers': ['console'],
'level': 'DEBUG',
},
'celery.task': {
'handlers': ['console'],
'level': 'DEBUG',
},
'openrouteservice': {
'handlers': ['console'],
'level': 'DEBUG',
}
}
}
Just to know, because when I use print('some stuff')
it should usually works.
I suspect that ProjectCacheInvalidator
and QgsConfigCache
classes make use of different nomeclature for stored projects.
That means, this is how QGIS server currently saves / caches the previously cached project:
# GROUP NAME = "buildings"
# PROJECT TITLE = "Public Building Management Demo"
/shared-volume/media/projects/buildings_public-building-management-demo.qgs
And here is what happens when you try to replace that project using a different "project title":
And finally, when you visit the map url (eg: http://localhost:8000/it/map/buildings/qdjango/1/):
# GROUP NAME = "buildings"
# PROJECT TITLE = "Public Building Management Demo 22"
/shared-volume/media/projects/buildings_public-building-management-demo-22.qgs
NB I don't know if it's intented, but as you can see the ProjectCacheInvalidator
class also caches the following temporary file:
/shared-volume/media/temp_uploads/b13e074e-2dfa-4d07-b6c8-4586c0959dc6
Checklist
Subject of the issue
I'm trying to replace a previously uploaded qgis project with a new one via administrative interface, but once saved it always shows the previous file.
Steps to reproduce
project_data\spatialite
folder and upload it as is to server (eg: into\shared-volume\project_data\spatialite
)projects/building-management-demo.qgs
and create a new project via g3w-admin interface.qgis
project file name should match the following:projects/building-management-demo-2.qgs
.qgis
project file name still match the previous one:That is:
building-management-demo.qgs
instead ofbuilding-management-demo-2.qgs
Environment
Link to your project
http://localhost:8000/it/admin/qdjango/buildings/projects/update/public-building-management-demo/
Additional info
The admin interface does not return any errors (e.g. preventing file saving), below the docker container log at the time of saving: