planetfederal / qgis-suite-plugin

GNU General Public License v2.0
25 stars 17 forks source link

Adding new catalog doesn't work with IP number #147

Open zjankovic opened 10 years ago

zjankovic commented 10 years ago

QGIS 2.4.0, Windows 8.1 64 bit Geoserver 2.5.1

New catalog dialog doesn't even start looking for Geoserver if you input IP number, for instance: http://192.168.1.15:8080/geoserver

Instantly generates error message:

Warning: Could not connect to the catalog at that URL

Entering any web address, like: http://www.geokt.hr:8080/geoserver

makes OpenGeo plugin try to read info from URL, and, of course, return the following error mesage:

Could not connect to catalog: Traceback (most recent call last): File "C:/Users/Zoran/.qgis2/python/plugins\opengeo\gui\gsexploreritems.py", line 243, in addGeoServerCatalog v = cat.gsversion() File "build\bdist.win32\egg\geoserver\catalog.py", line 106, in gsversion response, content = self.http.request(about_url, "GET") File "C:\Users\Zoran.qgis2\python\plugins\opengeo\ext-libs\httplib2-0.8-py2.7.egg\httplib2init.py", line 1570, in request (response, content) = self._request(conn, authority, uri, request_uri, method, body, headers, redirections, cachekey) File "C:\Users\Zoran.qgis2\python\plugins\opengeo\ext-libs\httplib2-0.8-py2.7.egg\httplib2init.py", line 1317, in _request (response, content) = self._conn_request(conn, request_uri, method, body, headers) File "C:\Users\Zoran.qgis2\python\plugins\opengeo\ext-libs\httplib2-0.8-py2.7.egg\httplib2init.py", line 1290, in _conn_request conn.connect() File "C:\Users\Zoran.qgis2\python\plugins\opengeo\ext-libs\httplib2-0.8-py2.7.egg\httplib2init.py", line 913, in connect raise socket.error, msg error: [Errno 10060] A connection attempt failed because the connected party did not properly respond after a period of time or established connection failed because connected host has failed to respond

If you use "localhost" in URL, everything works fine. Are IP numbers automatically discarded as FalseReading?

ischneider commented 10 years ago

IP addresses should work fine. For example, 127.0.0.1 (localhost). My guess, given the error, is that you cannot contact the host due to some network configuration or firewall.

zjankovic commented 10 years ago

No, Geoserver is running on a virtual machine, I can access it fine through Chrome, etc.

I would say that New Catalog dialog is acting peculiar, I cannot detect is it due to Python or is it in OpenGeo plugin code somewhere... For instance, this example:

http://myhost.noip.me:8080/geoserver

I get the same error, in the same milisecond I click on OK ("Could not connect to the catalog at that URL") - it doesn't even try to contact the host...

But if you input some other addres, like:

http://www.geokt.hr:8080/geoserver (Geoserver is not running there)

It tries to contact the server, for a couple of seconds, and then you get "normal" error message, ending with: A connection attempt failed because the connected party did not properly respond after a period of time or established connection failed because connected host has failed to respond

And then, to add to already legthy post, it does work if you input 127.0.0.1, it does not work if you input local IP addres: 192.168.1.5 of that same server...

I'll test it some more, get another Linux machine up and running, and run QGIS on that one, to try and replicate the error.

EDIT: Freshly installed Linux Mint, QGIS 2.0, New Catalog dialog does not work with IP number as well! It worked, sort of, the first time I entered information through dialog, tried to connect to Geoserver, complained that Geoserver version is too old (it is, in fact 2.5.1 - maybe it's too new...), and now I get the same error as under Windows... And it doesn't even try to connect to any host, at any IP address, just prints out the error message automatically...

ischneider commented 10 years ago

I've also noticed the 'too old' issue - I'll create a separate issue for that.

The error message indicates the code is failing while attempting to determine the version of the geoserver or listing the workspaces.

If you are comfortable editing Python, can you remove the entire except block (from your local script installation) here (lines 258-260) and report the exception: https://github.com/boundlessgeo/suite-qgis-plugin/blob/master/src/opengeo/gui/gsexploreritems.py#L258

zjankovic commented 10 years ago

When I remove lines 258-260 from gsexploreitems.py, I get the following error message:

HTTP Status 401 - No AuthenticationProvider found for org.springframework.security.authentication.UsernamePasswordAuthenticationToken

type Status report message No AuthenticationProvider found for org.springframework.security.authentication.UsernamePasswordAuthenticationToken description This request requires HTTP authentication.

Apache Tomcat/7.0.52 (Ubuntu)


Zoran Janković, mag. ing. geod. et geoinf. GEO KT d.o.o. www.geokt.hr http://www.geokt.hr

M: 00 385 98 682 902 T: 00 385 44 629 042

Hrv. branitelja 62 44320 Kutina

On Thu, Jul 24, 2014 at 5:01 PM, Ian Schneider notifications@github.com wrote:

I've also noticed the 'too old' issue - I'll create a separate issue for that.

The error message indicates the code is failing while attempting to determine the version of the geoserver or listing the workspaces.

If you are comfortable editing Python, can you remove the entire except block (from your local script installation) here (lines 258-260) and report the exception:

https://github.com/boundlessgeo/suite-qgis-plugin/blob/master/src/opengeo/gui/gsexploreritems.py#L258

— Reply to this email directly or view it on GitHub https://github.com/boundlessgeo/suite-qgis-plugin/issues/147#issuecomment-50029969 .[image: Web Bug from https://github.com/notifications/beacon/176714__eyJzY29wZSI6Ik5ld3NpZXM6QmVhY29uIiwiZXhwaXJlcyI6MTcyMTgzMzI3OSwiZGF0YSI6eyJpZCI6Mzc3Mjk1NDR9fQ==--3304ea5a2be035ddfc68f30a98894291d3c08d2b.gif]

ischneider commented 10 years ago

I haven't seen this issue before but it seems related to your GeoServer security configuration. Have you done any customization of security?