[Qgis-developer] Warning - shapefile corruption on 2.16/master and how to recover

Even Rouault even.rouault at spatialys.com
Fri Sep 16 11:53:02 PDT 2016


Le vendredi 16 septembre 2016 20:27:05, Jeff McKenna a écrit :
> I just tried to reproduce with QGIS 2.16.2 on Windows 10, I had no
> problems using the "Split Features" tool on a shapefile, and saving. I
> notice that the .dbf .shp .shx were modified properly.
> 
> (I did have a brain lapse to remember that the Split Features tool lives
> in the /edit menu ha)

One of my hypothesis is some bad interaction with the "connection pool".
Could you (or anyone) open the attribute table before doing the edits,and do 
the edits and commit them no more than 60 seconds afterwards ? I'm not sure 
but this might perhaps also require the shapefile to be big enough (several 
thousands of features). 

> 
> -jeff
> 
> > Unfortunately a fairly nasty regression has slipped in to 2.16 and is
> > still present on master. This results in shapefile corruption in
> > certain circumstances.
> > 
> > While I've hit this issue maybe 3 or 4 times in the last 2 months, I
> > haven't been able to track down exactly what causes this. It seems
> > related to using the split or reshape tool on a shapefile, then saving
> > the changes and getting the errors "Cannot reopen datasource
> > xxx.shp|layerid=0 in read-only mode" and "Data source is invalid
> > (Unable to open xxx.shx or xxx.SHX.Try --config SHAPE_RESTORE_SHX true
> > to restore or create it)" in the log.
> > 
> > A full report is at http://hub.qgis.org/issues/15570
> > 
> > Hopefully we can resolve this before the next round of releases. In
> > the meantime, there's a workaround for recovering data:
> > 
> > In the same folder as the shapefile there'll be additional files
> > "xxx_packed.shp" and "xxx_packed.shx". Renaming the "xxx_packed.shx"
> > file to "xxx.shx" allows the original shapefile to be reopened.
> > 
> > Nyall
> > _______________________________________________
> > Qgis-developer mailing list
> > Qgis-developer at lists.osgeo.org
> > List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> > Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> 
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the Qgis-developer mailing list