[gdal-dev] Error when importing GeoPackage into PostgreSQL database ("Worker thread task has not expected m_iStartShapeId value")

leo.fuhrmann.lgln at icloud.com leo.fuhrmann.lgln at icloud.com
Tue Jan 2 06:09:23 PST 2024


Hi,

I’m using ogr2ogr 3.8.2 to import a (layer of a) GeoPackage into a PostGIS database:

```
ogr2ogr --debug ON -f PostgreSQL "PG:dbname=XX host=XX port=XX user=XX password=XX” <path/to/gpkg.gpkg> <layer>
```

However, I’m seeing an error in the logs that I cannot sort out (see mail subject and/or logs below). Despite the error, the data gets written to the database, yet I’m worried that something is messed up along the way.

Using the official docker image to execute the command (from a MacBook with M1 Pro) works without an error. Then again, using a cloud service (IBM Code Engine in this case) with the official image also throws the error. I tried with different image versions but found no difference.

I tried to track down the error and found https://github.com/OSGeo/gdal/blob/1df855eb676e17278c337e9b14774d1bb298df90/ogr/ogrsf_frmts/gpkg/ogrgeopackagetablelayer.cpp#L8352

The comment suggests that I might have messed with GetNextFeature(), but I’m sure I haven’t.

Can someone help me to make sense of this error? I’m sorry to say that I can’t share the GeoPackage at the moment.

Thanks, Leo



Here are the logs:

GPKG: GeoPackage v1.2.0
GDAL: GDALOpen(<path/to/gpkg.gpkg>, this=0x14c053e00) succeeds as GPKG.
GDAL: GDALDriver::Create(PostgreSQL,PG:dbname=XX host=XX port=XX user=XX password=XX
PG: Client encoding: 'UTF8'
PG: PostGIS schema: 'public'
PG: PostgreSQL version string : 'PostgreSQL 16.1 (Debian 16.1-1.pgdg110+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 10.2.1-6) 10.2.1 20210110, 64-bit'
PG: PostGIS version string : '3.4 USE_GEOS=1 USE_PROJ=1 USE_STATS=1'
PG: Could not retrieve table oid for <layer>
GDALVectorTranslate: Using FID=fid and -preserve_fid
PG: Could not retrieve table oid for <layer>
OGR2OGR: Using WriteArrowBatch()
GPKG: GeoPackage v1.2.0
GPKG: GeoPackage v1.2.0
GPKG: GeoPackage v1.2.0
ERROR 1: Worker thread task has not expected m_iStartShapeId value
PG: PQputCopyEnd()
GDAL: GDALClose(<path/to/gpkg.gpkg>, this=0x14c053e00)
GDAL: GDALClose(PG:dbname=XX host=XX port=XX user=XX password=XX this=0x14b721fb0)
GDAL: In GDALDestroy - unloading GDAL shared library.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20240102/3eca1d4d/attachment-0001.htm>


More information about the gdal-dev mailing list