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

"Handle Unavailable Layers" does not handle a missing GRASS mapset when a vector is part of the project. #32130

Closed
mankoff opened this issue Oct 6, 2019 · 5 comments · Fixed by #53317
Assignees
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption High Priority

Comments

@mankoff
Copy link

mankoff commented Oct 6, 2019

Version QGIS 3.8

Summary

  1. I have a QGIS project that has imported some GRASS rasters and vectors.
  2. Close project
  3. Delete the GRASS mapset
  4. Try to open project.
  5. QGIS 3.8 crashes.

If the project only has raster data, the "Handle Unavailable Layers" dialog shows up. If it has vectors, then it crashes.

QGIS and OS versions

QGIS version 3.8.3-Zanzibar QGIS code revision 685d8b1
Compiled against Qt 5.9.5 Running against Qt 5.9.5
Compiled against GDAL/OGR 2.2.3 Running against GDAL/OGR 2.2.3
Compiled against GEOS 3.6.2-CAPI-1.10.2 Running against GEOS 3.6.2-CAPI-1.10.2 4d2925d6
PostgreSQL Client Version 10.10 (Ubuntu 10.10-0ubuntu0.18.04.1) SpatiaLite Version 4.3.0a
QWT Version 6.1.3 QScintilla2 Version 2.10.2
PROJ.4 Version 493
OS Version Ubuntu 18.04.3 LTS    
@mankoff mankoff added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Oct 6, 2019
@gioman
Copy link
Contributor

gioman commented Oct 6, 2019

duplicate #30476

@gioman gioman closed this as completed Oct 6, 2019
@mankoff
Copy link
Author

mankoff commented Oct 6, 2019

I'm not sure this is a duplicate. That bug report has the key phrase,

If I launch QGIS with GRASS and then open the file through the program it works.

I have no way to open the QGIS project at all.

To clarify:

  1. I can add GRASS data to a project
  2. I can close and re-open that project as much as I want
  3. If when the project is closed, I run the script that generated the GRASS data and re-generate the data, then I can no longer open it (using the identical behavior that let me open the file before I regenerated the GRASS data).

@mankoff
Copy link
Author

mankoff commented Oct 6, 2019

Please re-open.

@gioman
Copy link
Contributor

gioman commented Oct 7, 2019

I have no way to open the QGIS project at all.

can you share a sample project (with its sample GRASS data)?

3\. If when the project is closed, I run the script that generated the GRASS data and re-generate the data, **then** I can no longer open it (using the identical behavior that let me open the file before I regenerated the GRASS data).

the script replace the GRASS data in the location/mapset that you previously used to load data in QGIS? Can you open the GRASS data generated by your script in native GRASS?

@gioman gioman added the Feedback Waiting on the submitter for answers label Oct 7, 2019
@gioman gioman reopened this Oct 7, 2019
@mankoff mankoff changed the title Crash when opening project with GRASS data that has been updated "Handle Unavailable Layers" does not handle a missing GRASS mapset Oct 7, 2019
@mankoff mankoff changed the title "Handle Unavailable Layers" does not handle a missing GRASS mapset "Handle Unavailable Layers" does not handle a missing GRASS mapset when a vector is part of the project. Oct 7, 2019
@mankoff
Copy link
Author

mankoff commented Oct 7, 2019

Here is an MWE that recreates this bug. I've edited the title and the initial report now that I understand it better. In summary, "Handle Missing Layers" dialog works when a GRASS mapset is removed and there were rasters in the QGIS project. If there are vectors, then it crashes.

Generate a raster in GRASS, by running each line below at a terminal:

rm -fR G
grass -c EPSG:3413 ./G
r.mapcalc "foo = 42"
r.to.vect input=foo output=foo type=point
exit
  • Launch QGIS
  • Navigate in browser to this folder
  • Open G folder (with GRASS icon), then PERMANENT, then double-click on "foo" raster to move it to the layers panel.
  • Save as 32130.qgs
  • Quit QGIS
rm -fR G          # remove mapset
qgis ./32130.qgs  # Handle Unavailable Layers dialog appears
  • Re-run the GRASS code above
  • qgis ./32130.qgs # works!
  • Add the vector layer to the mapset
  • Quit QGIS
rm -fR G          # remove mapset
qgis ./32130.qgs  # CRASH

@gioman gioman added Crash/Data Corruption and removed Feedback Waiting on the submitter for answers labels Oct 7, 2019
@nyalldawson nyalldawson self-assigned this Jun 1, 2023
nyalldawson added a commit to nyalldawson/QGIS that referenced this issue Jun 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Crash/Data Corruption High Priority
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants