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

Problem opening a GeoJSON with http protocol with a script as system proxy. #49179

Closed
2 tasks done
FERRATON opened this issue Jun 28, 2022 · 7 comments · Fixed by #50016
Closed
2 tasks done

Problem opening a GeoJSON with http protocol with a script as system proxy. #49179

FERRATON opened this issue Jun 28, 2022 · 7 comments · Fixed by #50016
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Configs and Options Feedback Waiting on the submitter for answers

Comments

@FERRATON
Copy link

What is the bug or the crash?

I use http protocol geojson to open for example:
https://www.vigicrues.gouv.fr/services/1/InfoVigiCru.geojson/
In QGIS I set proxy to default proxy
If I use a script (.pac) in the system settings, opening the Geojson fails.
It succeeds if in the systems settings I use a manual configuration.
Note that I use in the python console the instruction:
QgsNetworkAccessManager.instance().proxyFactory().queryProxy( QNetworkProxyQuery( QUrl( "https://www.vigicrues.gouv.fr/services/1/InfoVigiCru.geojson/" ) ) )[0].hostName()
which allows me to check that the proxy retrieved is the correct one when using the script (
.pac).

Steps to reproduce the issue

Use a configuration where a proxy is required.
create a test.Pac file which returns the proxy directly and configure it in the Windows system settings.

Versions

Version de QGIS
3.22.6-Białowieża
Révision du code
b6f33b1
Version de Qt
5.15.2
Version de Python
3.9.5
Version de GDAL/OGR
3.4.2
Version de Proj
9.0.0
Version de la base de données du registre EPSG
v10.041 (2021-12-03)
Version de GEOS
3.10.2-CAPI-1.16.0
Compilé avec SQLite
3.38.1
Fonctionne avec SQLite
3.26.0
Version de PDAL
2.3.0
Version du client PostgreSQL
13.0
Version de SpatiaLite
5.0.1
Version de QWT
6.1.3
Version de QScintilla2
2.11.5
Version de l'OS
Windows 10 Version 1909

Supported QGIS version

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

New profile

  • I tried with a new QGIS profile

Additional context

No response

@FERRATON FERRATON added the Bug Either a bug report, or a bug fix. Let's hope for the latter! label Jun 28, 2022
@troopa81
Copy link
Contributor

I tested on QGIS 3.25 and it works.

Could you please paste me the result of these lines

# 2 means NoProxy
QgsNetworkAccessManager.instance().proxyFactory().queryProxy( QNetworkProxyQuery( QUrl( "https://www.vigicrues.gouv.fr/services/1/InfoVigiCru.geojson/" ) ) )[0].type()
QgsNetworkAccessManager.instance().proxyFactory().queryProxy( QNetworkProxyQuery( QUrl( "https://www.vigicrues.gouv.fr/services/1/InfoVigiCru.geojson/" ) ) )[0].port()
QgsNetworkAccessManager.instance().useSystemProxy()

Could you please share with me the system proxy configuration. I have this on my side
proxy

@troopa81 troopa81 added the Feedback Waiting on the submitter for answers label Aug 11, 2022
@troopa81
Copy link
Contributor

Could you also post me the result of these lines

QNetworkProxyFactory.proxyForQuery( QNetworkProxyQuery( QUrl( "https://www.vigicrues.gouv.fr/services/1/InfoVigiCru.geojson/" ) ) )[0].port()
QNetworkProxyFactory.proxyForQuery( QNetworkProxyQuery( QUrl( "https://www.vigicrues.gouv.fr/services/1/InfoVigiCru.geojson/" ) ) )[0].hostName()
QNetworkProxyFactory.proxyForQuery( QNetworkProxyQuery( QUrl( "https://www.vigicrues.gouv.fr/services/1/InfoVigiCru.geojson/" ) ) )[0].type()

@FERRATON
Copy link
Author

I was on holiday and am teleworking today and next Monday. I could do the test next Tuesday...
Kind regards

@FERRATON
Copy link
Author

QgsNetworkAccessManager.instance().proxyFactory().queryProxy( QNetworkProxyQuery( QUrl( "https://www.vigicrues.gouv.fr/services/1/InfoVigiCru.geojson/" ) ) )[0].type()
-> 3
...Port()
-> 8080
...useSystemProxy()
->True
QNetworkProxyFactory.proxyForQuery( QNetworkProxyQuery( QUrl( "https://www.vigicrues.gouv.fr/services/1/InfoVigiCru.geojson/" ) ) )[0].port()
-> 8080
...hostName()
-> 'pfrie-std.proxy.e2.rie.gouv.fr'
...type()
-> 3
2022-08-18 09_52_25-Paramètres

@FERRATON
Copy link
Author

strangely if we pass by a qlr file indicating the source
it works.
GeoJSON_VIGICRUES.zip

@troopa81
Copy link
Contributor

Everything returned by QgsNetworkAccessManager.instance().proxyFactory().queryProxy( QNetworkProxyQuery( QUrl( "https://www.vigicrues.gouv.fr/services/1/InfoVigiCru.geojson/" ) ) )[0] is OK : type=3=HttpProxy, port=8080, it uses system proxy!!!

but the same command with hostName returns what ? empty string ? it look very strange to me!

What returns this?

QNetworkProxyFactory.systemProxyForQuery( QNetworkProxyQuery( QUrl( "https://www.vigicrues.gouv.fr/services/1/InfoVigiCru.geojson/" ) ) )[0].port()

Same question with hostname/type/port

@FERRATON
Copy link
Author

hostname() correctly returns 'pfrie-std.proxy.e2.rie.gouv.fr'
QNetworkProxyFactory.systemProxyForQuery( QNetworkProxyQuery( QUrl( "https://www.vigicrues.gouv.fr/services/1/InfoVigiCru.geojson/" ) ) )[0].port()
-> 8080
HostName()
-> 'pfrie-std.proxy.e2.rie.gouv.fr'
port()
->8080
Everything in the python console is correct...it is only when using the data source manager that there is a problem.

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! Configs and Options Feedback Waiting on the submitter for answers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants