qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.53k stars 2.99k forks source link

Moved from QGIS 2.18 to 3.8, Views are not valid nor cannot be loaded and map not working due to Key #45557

Closed camanicnack closed 2 years ago

camanicnack commented 3 years ago

What is the bug or the crash?

My company recently went from QGIS 2.18 to QGIS 3.8. When we moved, our map is currently working correctly, especially when it goes to WMTS, we are able to see every layer of the map we go to the live website. However, when we either add a new view or replace another view with an updated version it is simply not working. We either get two results... Either we can see the view in the map of the QGIS software, but when it translates to the WMTS image (which what we mean by going to the live website) it does not show the view at all. Or... It gives us an "Invalid Error" within the logs and say that we cannot put the particular view in.
It seems as if the issue could be a key problem. The old views keys are "triannual", but the new view's keys are countyid. So we tried changing the keys, it keeps on giving us a invalid error and the layer will not go in. We even tried changing to ssl mode to allow, and then fix the keys as of that way. QGIS system still not allowing us to change and keep getting invalid error messages in the logs. We tried to go from the DB Manager and click n dragging over to the layers. No good. Try going from the Browser Panel into the layers, again no good. Error messaages. Even tried the Database portion, and still not able to get it to work.

Please any help to have the layer show up on our maps is appreciated.

Steps to reproduce the issue

It seems as if the issue could be a key problem. The old views keys are "triannual", but the new view's keys are countyid. So we tried changing the keys, it keeps on giving us a invalid error and the layer will not go in. We even tried changing to ssl mode to allow, and then fix the keys as of that way. QGIS system still not allowing us to change and keep getting invalid error messages in the logs. We tried to go from the DB Manager and click n dragging over to the layers. No good. Try going from the Browser Panel into the layers, again no good. Error messaages. Even tried the Database portion, and still not able to get it to work.

Update: I did update to now 3.2. Sorry... I am kinda trying to figure out QGIS and still new with the QGIS system. As I said was used to QGIS 2.18 but upgraded to 3.8.. Now I did finally upgrade back to 3.2 and I am still having the issue.
Main issue is we are having problems with the views from postgres. The old views the unique key was set to triannual and sslmode set to allow. However, when I upgraded to 3.2, the when I apply new views as a layer for the map, it is not allowing me to set the unique key to triannaul but to something else. And... not allowing me to set up the sslmode to allow. The system keeps giving me an error that the layer is not valid and cannot add. Again the old layers which are showing the map has this but cannot set the new layers. Now I can try setting it something else and then it shows the layer within the app map builder, but when I save it. It doesn't show the image of that layer within the live map. It somehow needs that unique key but not allowing me to change the unique key to triannual.

Versions

Went from QGIS 2.18 to new version of QGIS 3.8

Supported QGIS version

New profile

Additional context

Any help is appreciated in order to update our maps and be shown on the WMTS image.

jef-n commented 3 years ago

The issue is not really clear to me, but 3.8 is EOL anyway. Can you reproduce the problem with 3.16 (LTR) or 3.20? If so, please also provide a test case illustrating the problem.

camanicnack commented 3 years ago

Having problems with Views mainly. The key of the view seems as if we cannot set nor change.

Nicholas Bowers Internet | Web | Marketing

VANGUARD APPRAISALS, INC 1065 Sierra Ct NE, Suite D Cedar Rapids, IA 52402 O 319-365-8625 | T (800)736-8625 |F 319-365-0142 websitehttp://www.camavision.com/ | supporthttp://www.camavision.com/support.php | email @.***> | facebookhttps://www.facebook.com/camavision | twitterhttps://twitter.com/cama_vision | youtubehttp://www.youtube.com/camavision | instagramhttps://www.instagram.com/camavision | linkedinhttp://www.linkedin.com/company/vanguard-appraisals | google+https://plus.google.com/+Camavision?hl=en

"Excellence achieved through people, products, and service"

From: Jürgen Fischer @.> Sent: Monday, October 18, 2021 2:09 PM To: qgis/QGIS @.> Cc: Nicholas Bowers @.>; Author @.> Subject: Re: [qgis/QGIS] Moved from QGIS 2.18 to 3.8, Views are not valid nor cannot be loaded and map not working due to Key (Issue #45557)

The issue is not really clear to me, but 3.8 is EOL anyway. Can you reproduce the problem with 3.16 (LTR) or 3.20? If so, please also provide a test case illustrating the problem.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/qgis/QGIS/issues/45557#issuecomment-946080093, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AJOL7F2AH4FX6YIFLDPWKCLUHRWGNANCNFSM5GHKU5VA. Triage notifications on the go with GitHub Mobile for iOShttps://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Androidhttps://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

gioman commented 3 years ago

Having problems with Views mainly. The key of the view seems as if we cannot set nor change.

@camanicnack I agree that this is unclear. You refer of views (in what backend, PostGIS?) not working, but also WMTS. Is this about QGIS Desktop or Server?

Post some concrete info, for example error messages in QGIS log, or even better a snippet with the structure of the table your view is based on and the definition of the view.

camanicnack commented 3 years ago

Sorry... I am kinda trying to figure out QGIS and still new with the QGIS system. As I said was used to QGIS 2.18 but upgraded to 3.8.. Now I did finally upgrade back to 3.2 and I am still having the issue.
Main issue is we are having problems with the views from postgres. The old views the unique key was set to triannual and sslmode set to allow. However, when I upgraded to 3.2, the when I apply new views as a layer for the map, it is not allowing me to set the unique key to triannaul but to something else. And... not allowing me to set up the sslmode to allow. The system keeps giving me an error that the layer is not valid and cannot add. Again the old layers which are showing the map has this but cannot set the new layers. Now I can try setting it something else and then it shows the layer within the app map builder, but when I save it. It doesn't show the image of that layer within the live map. It somehow needs that unique key but not allowing me to change the unique key to triannual.

jef-n commented 3 years ago

You mean 3.20? What do you mean with "triannual" key? Why don't you quote the error messages?

camanicnack commented 3 years ago

Layer is not valid: The layer="########" host=###### port=#### sslmode=allow key='count' table="public", "TERRI_data" is not a valid layer and can not be added to map. Reason:

gioman commented 3 years ago

Layer is not valid: The layer="########" host=###### port=#### sslmode=allow key='count' table="public", "TERRI_data" is not a valid layer and can not be added to map. Reason:

@camanicnack the error message is not very clarifying (assuming is the whole one).

Please consider:

1) telling us what is the database

2) post the SQL definitions for the table and the view, so we can create here locally, add some data to the table and try load the view. Without it it will be very hard to help, and say if there is really any issue in QGIS.

github-actions[bot] commented 2 years ago

The QGIS project highly values your report and would love to see it addressed. However, this issue has been left in feedback mode for the last 14 days and is being automatically marked as "stale". If you would like to continue with this issue, please provide any missing information or answer any open questions. If you could resolve the issue yourself meanwhile, please leave a note for future readers with the same problem and close the issue. In case you should have any uncertainty, please leave a comment and we will be happy to help you proceed with this issue. If there is no further activity on this issue, it will be closed in a week.

github-actions[bot] commented 2 years ago

While we hate to see this happen, this issue has been automatically closed because it has not had any activity in the last 42 days despite being marked as feedback. If this issue should be reconsidered, please follow the guidelines in the previous comment and reopen this issue. Or, if you have any further questions, there are also further support channels that can help you.