Bug report #3929
404 Error with Qgis Add WMS Layer but valid response in web browser
|Assignee:||Gavin Macaulay -|
|Category:||Web Services clients/WMS|
|Affected QGIS version:||Regression?:||No|
|Operating System:||All||Easy fix?:||No|
|Pull Request or Patch supplied:||Resolution:||fixed|
|Crashes QGIS or corrupts data:||Copied to github as #:||13953|
I am getting a 404 Page not found response from a WMS server when using Qgis
(svn revision 5083) on Debian unstable
However, when I plug the same URL, copied from the Qgis error dialog box into
my web browser(Konqueror) I get a valid response, returning the capabilities xml data.
The problem has also been replicated by Brendan Morley (Firefox)
Below is the debugging output...................
Any ideas why ?
QgisApp::addWmsLayer: about to addRasterLayer
QgsSpatialRefSys::createFromEpsg with 4326
QgsSpatialRefSys::openDb path = /usr/share/qgis/resources/srs.db
Projection has angular units of degree
QgsServerSourceSelect::serverConnect: Connection info:
QgsProviderRegistry::getRasterProvider: Library name
Debug: qgsproviderregistry.cpp:343 getProvider, Loaded data provider library
Debug: qgsproviderregistry.cpp:344 getProvider, Attempting to resolve the
Debug: qgsproviderregistry.cpp:351 getProvider, Getting pointer to a
dataProvider object from the library
QgsWmsProvider: constructing with uri
QgsWmsProvider: exiting constructor.
Debug: qgsproviderregistry.cpp:363 getProvider, Instantiated the data provider
provider name: 0x81a9d92
QgsHttpTransaction: exiting constructor.
Warning: QgsHttpTransaction::getSynchronously: qurl.host() is
QgsHttpTransaction::getSynchronously: Starting get with id 1.
QgsHttpTransaction::getSynchronously: Setting httpactive = TRUE
QgsHttpTransaction::dataStarted with ID 1.
QgsHttpTransaction::dataStateChanged to 2.
An attempt to connect to the host is in progress.
QgsHttpTransaction::dataStateChanged to 3.
The client is sending its request to the server.
QgsHttpTransaction::dataStateChanged to 4.
The client's request has been sent and the client is reading the server's
QgsHttpTransaction::dataHeaderReceived: statuscode 404, reason 'Not Found',
content type: _.
QgsHttpTransaction::dataStateChanged to 5.
The connection to the host is open, but the client is neither sending a
request, nor waiting for a response.
QgsHttpTransaction::dataFinished with ID 1.
QgsHttpTransaction::dataFinished - no error.
QgsHttpTransaction::getSynchronously: Setting httpactive = FALSE
QgsHttpTransaction::getSynchronously: Response received.
QgsHttpTransaction::getSynchronously: Processing an error 'WMS Server
responded unexpectedly with HTTP Status Code 404 (Not Found)'.
QgsWmsProvider::errorString: returning 'WMS Server responded unexpectedly with
HTTP Status Code 404 (Not Found)
#1 Updated by phil-bertram-clear-net-nz - over 16 years ago
Response via mailing list - copied here
I can reproduce the behaviour - rather odd really. The only thing I can
think of is that that WMS server is only accepting connections from
certain HTTP User-Agents. I could get to the URL via my Firefox.
Do you happen to be friendly with the webmaster of the WMS server?
Perhaps we can see if the URLs (QGIS vs. Firefox) really are coming in
the same to the WMS server.
Also, could you report this issue formally via
http://svn.qgis.org/trac/newticket - This gives me a better chance of
not forgetting about your issue.
#2 Updated by phil-bertram-clear-net-nz - over 16 years ago
Here is a link to the information page for the server[http://www.nztopoonline.linz.govt.nz/technicalusers/webservices.htm]
Unfortuately I do not know the webmaster.
#4 Updated by Gavin Macaulay - over 16 years ago
If one telnets to www.nztopoonline.linz.govt.nz, port 80 and types:
it returns the capability info as expected. tcpdump reports that Qgis is producing pretty much the same thing. I've emailed linz asking for some help...
#6 Updated by anonymous - over 16 years ago
As a workaround I have installed Mapserver, created a WMS Server using Mapserver.
Qgis happily onnects to the Mapserver WMS server which connects to http://www.nztopoonline.linz.govt.nz/wmsconnector/com.esri.wms.Esrimap?ServiceName=nztopo_wmsx%x% for the map data.
#8 Updated by Gavin Macaulay - over 16 years ago
Fixed in svn 7141779b (SVN r5356). That commit resolves the immediate 404 error, but I can't seem to get any images from the server.
Problem was that some wms servers only seem to accept url's without the http://web.address.net bit. Firefox appears to strip the host off before sending the request which is why the same URL worked in Firefox but not qgis.
#10 Updated by Gavin Macaulay - over 16 years ago
The problem with qgis viewing data from the nztopo wms server now appears to be with the wms server sending inconsistent srs and bounding box information in response to a GetCapabilities request. However, since mapserver appears to work fine (see message above), there may be a way to work around the problem with nztopo.
Since this is a different problem to the original subject of this ticket, I'm closing this ticket and opening another (#103).