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

QGIS cannot open a file if the filepath contains ".target" #59106

Closed
2 tasks done
Saudruch opened this issue Oct 16, 2024 · 4 comments
Closed
2 tasks done

QGIS cannot open a file if the filepath contains ".target" #59106

Saudruch opened this issue Oct 16, 2024 · 4 comments
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Data Provider Related to specific vector, raster or mesh data providers Regression Something which used to work, but doesn't anymore

Comments

@Saudruch
Copy link

Saudruch commented Oct 16, 2024

What is the bug or the crash?

When I try to open any raster (specifically geoTIFF in this case) in QGIS I will get this error message

Invalid Data Source: /home/user/Desktop/folder.test.target/raster.tif is not a valid or recognized data source.

However when I change the path by excluding the ".target" the file will open without a problem.

/home/user/Desktop/folder.test/raster.tif
/home/user/Desktop/folder.test-target/raster.tif

Steps to reproduce the issue

  1. Download or create any tif file. For example found some sample files here: https://download.osgeo.org/geotiff/samples/made_up/bogota.tif
  2. Open it in QGIS.
  3. change the file name to target.bogota.tif (or alternatively change the folder name so it contains .target)
  4. try to open it again, you should get the error
  5. change the file name to something.bogota.tif
  6. it should open (so it is not an issue with the "." but specifically with ".target"

Versions

<style type="text/css"> p, li { white-space: pre-wrap; } </style>
QGIS version 3.34.11-Prizren QGIS code revision 2904bce
Qt version 5.15.3
Python version 3.10.12
GDAL/OGR version 3.4.1
PROJ version 8.2.1
EPSG Registry database version v10.041 (2021-12-03)
GEOS version 3.10.2-CAPI-1.16.0
SQLite version 3.37.2
PDAL version 2.3.0
PostgreSQL client version 14.13 (Ubuntu 14.13-0ubuntu0.22.04.1)
SpatiaLite version 5.0.1
QWT version 6.1.4
QScintilla2 version 2.11.6
OS version Ubuntu 22.04.5 LTS
       
Active Python plugins
coordinate_capture 0.2
latlontools 3.6.3
BoundingBox 2.1
db_manager 0.1.20
processing 2.12.99
MetaSearch 0.3.6
QGIS version 3.34.11-Prizren QGIS code revision [2904bce](https://github.com/qgis/QGIS/commit/2904bcec7c9) Qt version 7.15.3 Python version 3.10.12 GDAL/OGR version 3.4.1 PROJ version 8.2.1 EPSG Registry database version v10.041 (2021-12-03) GEOS version 3.10.2-CAPI-1.16.0 SQLite version 3.37.2 PDAL version 2.3.0 PostgreSQL client version 14.13 (Ubuntu 14.13-0ubuntu0.22.04.1) SpatiaLite version 5.0.1 QWT version 8.1.4 QScintilla2 version 2.11.6 OS version Ubuntu 22.04.5 LTS

Active Python plugins
coordinate_capture
0.2
latlontools
3.6.3
BoundingBox
2.1
db_manager
0.1.20
processing
2.12.99
MetaSearch
0.3.6

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

Tested it on different computers with slightly different QGIS versions. I am running Ubuntu 22.04 LTS on one computer and Ubuntu 24.04 LTS on another. Also the another computer I tested on it does have only BoundingBox plugin installed so I think it probably isn't plugin issue.

@Saudruch Saudruch added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Oct 16, 2024
@Saudruch
Copy link
Author

Saudruch commented Oct 16, 2024

image

I was able to reproduce this on macOS QGIS LTS version

`QGIS version
3.34.6-Prizren
QGIS code revision
623828f58c2
Qt version
5.15.2
Python version
3.9.5
GDAL/OGR version
3.3.2
PROJ version
8.1.1
EPSG Registry database version
v10.028 (2021-07-07)
GEOS version
3.9.1-CAPI-1.14.2
SQLite version
3.35.2
PDAL version
2.3.0
PostgreSQL client version
unknown
SpatiaLite version
5.0.1
QWT version
6.1.6
QScintilla2 version
2.11.5
OS version
macOS 15.0

Active Python plugins
processing
2.12.99
grassprovider
2.12.99
db_manager
0.1.20
MetaSearch
0.3.6`

@agiudiceandrea
Copy link
Contributor

agiudiceandrea commented Oct 16, 2024

I can also confirm the issue both using QGIS LTR 3.34.11 and QGIS 3.38.3 (from OSGeo4W) when the file path\name contains the ".target" string.

The issue occurs either trying to add the layer via drag&drop:

CRITICAL    Invalid Data Source : C:/path/abc.target.test.tif
WARNING    Unable to load C:/path/abc.target.test.tif is not a valid or recognized data source.
CRITICAL    Invalid Data Source : C:/Users/Andrea/Downloads/abc.target.test/test.tif is not a valid or recognized data source.
WARNING    Unable to load C:/Users/Andrea/Downloads/abc.target.test/test.tif

or using the Data Source Manager -> Raster:
CRITICAL Unsupported Data Source : C:\path\abc.tar/get.test.tif is not a supported raster data source
CRITICAL Unsupported Data Source : C:\path\abc.tar/get\test.tif is not a supported raster data source

(notice the ".tar/get" string instead of ".target" in the error messages")

The layer is not displayed in the QGIS Browser.

It looks like the issue doesn't occur using QGIS 3.39.0-Master bb9a716: not sure if it is due to a fix only merged in master and not backported or to some difference in the libraries used by qgis-dev from OSGeo4W.

The issue actually occurs when the file path\name contains at least one of the following strings: ".tar", ".zip", ".gz", ".tgz".

The issue didn't occur using QGIS 3.22.

@agiudiceandrea agiudiceandrea added Data Provider Related to specific vector, raster or mesh data providers QGIS Browser Data Source Manager Regression Something which used to work, but doesn't anymore labels Oct 16, 2024
@nyalldawson
Copy link
Collaborator

This was fixed by #58240

@nyalldawson
Copy link
Collaborator

I think we should close this -- it's not an issue with 3.40, and it's not enough to backport just #58240 alone.

@agiudiceandrea agiudiceandrea closed this as not planned Won't fix, can't repro, duplicate, stale Oct 17, 2024
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! Data Provider Related to specific vector, raster or mesh data providers Regression Something which used to work, but doesn't anymore
Projects
None yet
Development

No branches or pull requests

3 participants