[Geoserver-users] Geowebcache REST, why hast thou forsaken me?

Hello,

For the life of me, I can’t seem to trigger things like configuration reload via the /graphserver/gwc/rest/ interface. Has anyone had success doing this? (I’m also trying to seed, but this seemed like something simpler that was in my way first)

I thought that I was doing something wrong, but I run this through wget, and I still have problems. See below for wget output. I am trying to replicate the request that I see being sent to GWC (by using firebug to inspect the request/response). What am I missing here? Why can’t I successfully do something like reload the config?

Thanks,
David


dzwarg@anonymised.com:~$ wget -d -O - --http-user=admin --http-password=geoserver --header=‘Content-Type: application/x-www-form-urlencoded’ --header=‘Accepts: text/html’ --header=‘Content-Length: 22’ --post-data=‘reload_configuration=1’ http://10.0.0.100:8080/geoserver/gwc/rest/reload/
Setting --output-document (outputdocument) to -
Setting --http-user (httpuser) to admin
Setting --http-password (httppassword) to geoserver
Setting --header (header) to Content-Type: application/x-www-form-urlencoded
Setting --header (header) to Accepts: text/html
Setting --header (header) to Content-Length: 22
Setting --post-data (postdata) to reload_configuration=1
DEBUG output created by Wget 1.12 on linux-gnu.

–2011-01-26 03:47:11-- http://10.0.0.100:8080/geoserver/gwc/rest/reload/
Host `10.0.0.100’ has not issued a general basic challenge.
Connecting to 10.0.0.100:8080… connected.
Created socket 3.
Releasing 0x08e60438 (new refcount 0).
Deleting unused 0x08e60438.

—request begin—
POST /geoserver/gwc/rest/reload/ HTTP/1.0
User-Agent: Wget/1.12 (linux-gnu)
Accept: /
Host: 10.0.0.100:8080
Connection: Keep-Alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 22
Accepts: text/html

—request end—
[POST data: reload_configuration=1]
HTTP request sent, awaiting response…
—response begin—
HTTP/1.1 401 Unauthorized
Server: Apache-Coyote/1.1
Set-Cookie: JSESSIONID=A552C11CFB80CC5974F8D72D74316729; Path=/geoserver
WWW-Authenticate: Basic realm=“GeoServer Realm”
Content-Type: text/html;charset=utf-8
Content-Length: 1119
Date: Wed, 26 Jan 2011 08:47:11 GMT
Connection: keep-alive

—response end—
401 Unauthorized

Stored cookie 10.0.0.100 8080 /geoserver [expiry none] JSESSIONID A552C11CFB80CC5974F8D72D74316729
Registered socket 3 for persistent reuse.
Skipping 1119 bytes of body: [Apache Tomcat/6.0.24 - Error report

HTTP Status 401 - Full authentication is required to access this resource


type Status report

message Full authentication is required to access this resource

description This request requires HTTP authentication (Full authentication is required to access this resource).


Apache Tomcat/6.0.24

] done.
Inserted `10.0.0.100’ into basic_authed_hosts
Reusing existing connection to 10.0.0.100:8080.
Reusing fd 3.

—request begin—
POST /geoserver/gwc/rest/reload/ HTTP/1.0
User-Agent: Wget/1.12 (linux-gnu)
Accept: /
Host: 10.0.0.100:8080
Connection: Keep-Alive
Content-Type: application/x-www-form-urlencoded
Content-Length: 22
Accepts: text/html
Authorization: Basic YWRtaW46Z2Vvc2VydmVy

—request end—
[POST data: reload_configuration=1]
HTTP request sent, awaiting response…
—response begin—
HTTP/1.1 400 Bad Request
Date: Wed, 26 Jan 2011 08:47:11 GMT
Server: Noelios-Restlet-Engine/1.0…8
Content-Type: text/plain;charset=ISO-8859-1
Content-Length: 194
Connection: close

—response end—
400 Bad Request
Disabling further reuse of socket 3.
Closed fd 3
2011-01-26 03:47:11 ERROR 400: Bad Request.

Hi,

I have the same issue.
I'm trying to reload geowebcache through REST API in agreement with this
page :
href="http://geowebcache.org/docs/current/configuration/reload.html">Geowebcache
Rest reload documentation
But i cant' succeed.

My request :

geolocalisation:/home/garnier# curl -v -u geowebcache:secured -d "reload"
http://localhost:8080/geowebcache/rest/

* About to connect() to localhost port 8080 (#0)
* Trying ::1... connected
* Connected to localhost (::1) port 8080 (#0)
* Server auth using Basic with user 'geowebcache'

POST /geowebcache/rest/ HTTP/1.1
Authorization: Basic Z2Vvd2ViY2FjaGU6c2VjdXJlZA==
User-Agent: curl/7.21.0 (i486-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o
zlib/1.2.3.4 libidn/1.15 libssh2/1.2.6
Host: localhost:8080
Accept: */*
Content-Length: 6
Content-Type: application/x-www-form-urlencoded

< HTTP/1.1 405 Mehtod not authorized
< Allow:
< Date: Tue, 01 Mar 2011 17:13:02 GMT
< Server: Noelios-Restlet-Engine/1.0..8
< Transfer-Encoding: chunked
<
* Connection #0 to host localhost left intact
* Closing connection #0

Is there any way to do it ?

Thx

Nicolas

--
View this message in context: http://old.nabble.com/Geowebcache-REST%2C-why-hast-thou-forsaken-me--tp30780353p31042438.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

Finalement, this request worked properly :

curl -v -u geowebcache:secured -d "reload_configuration=1"
http://localhost:8080/geowebcache/rest/reload
--
View this message in context: http://old.nabble.com/Geowebcache-REST%2C-why-hast-thou-forsaken-me--tp30780353p31047830.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

It's been a long time since I've tried this, but you definitely have to use the geoserver admin username and password if you are running the embedded version.

-Arne

On 3/1/11 6:38 PM, Nicolas Garnier wrote:

Hi,

I have the same issue.
I'm trying to reload geowebcache through REST API in agreement with this
page :
href="http://geowebcache.org/docs/current/configuration/reload.html&quot;&gt;Geowebcache
Rest reload documentation
But i cant' succeed.

My request :

geolocalisation:/home/garnier# curl -v -u geowebcache:secured -d "reload"
http://localhost:8080/geowebcache/rest/

* About to connect() to localhost port 8080 (#0)
* Trying ::1... connected
* Connected to localhost (::1) port 8080 (#0)
* Server auth using Basic with user 'geowebcache'

POST /geowebcache/rest/ HTTP/1.1
Authorization: Basic Z2Vvd2ViY2FjaGU6c2VjdXJlZA==
User-Agent: curl/7.21.0 (i486-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o
zlib/1.2.3.4 libidn/1.15 libssh2/1.2.6
Host: localhost:8080
Accept: */*
Content-Length: 6
Content-Type: application/x-www-form-urlencoded

< HTTP/1.1 405 Mehtod not authorized
< Allow:
< Date: Tue, 01 Mar 2011 17:13:02 GMT
< Server: Noelios-Restlet-Engine/1.0..8
< Transfer-Encoding: chunked
<
* Connection #0 to host localhost left intact
* Closing connection #0

Is there any way to do it ?

Thx

Nicolas