You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@guacamole.apache.org by "Roman V. Isaev" <rm...@isaeff.net> on 2020/04/05 22:32:57 UTC

> > {"message":"Unexpected internal
> > error","translatableMessage":{"key":"Unexpected internal
> > error","variables":null},"statusCode":null,"expected":null,"type":"INTERNAL_ERROR"}
> You're trying to write it to the postgresql-shared endpoint, which isn't
> going to work, because the postgresql-shared extension doesn't support
> storing connections - it's simply there to share existing connections.  So,
> you need to post to the postgresql endpoint
> (api/session/data/postgresql/connectionGroups).  There may be other issues
> with that particular POST query, but that's at least the initial one.

I tried postgresql endpoint, no dfference. But... 

> > 18:49:34.482 [http-nio-8080-exec-9] ERROR o.a.g.rest.RESTExceptionMapper -
> > Unexpected internal error: Can not deserialize instance of
> > java.util.ArrayList out of VALUE_STRING token at [Source:
> > org.apache.catalina.connector.CoyoteInputStream@22bf9b00; line: 1,
> > column: 2]
> > Is it supposed to work at all with json bodies? And if I can't use POST
> > and nested
> > data as json, how to encode more complicated requests as
> > application/x-www-form-urlencoded
> > for user/connection adding?..
> No, the api/tokens endpoint expects the application/x-www-form-urlencoded
> encoding type.  So, plain JSON encoding will not work.  

...well, I just managed to pass json request to add connection group. It worked:

% ./get-token.sh
HTTP/1.1 200
Content-Type: application/json
Transfer-Encoding: chunked
Date: Sun, 05 Apr 2020 21:53:20 GMT

{"authToken":"8EAD8FCE7185A54F0F98018F5640A06DC519CA66868BFA5BAF9035FDC913ACEB","username":"guacadmin","dataSource":"postgresql","availableDataSources":["postgresql","postgresql-shared"]}

% ./add-group.sh
HTTP/1.1 200
Content-Type: application/json
Transfer-Encoding: chunked
Date: Sun, 05 Apr 2020 21:53:33 GMT

{"name":"GRUPP1","identifier":"8","parentIdentifier":"ROOT","type":"ORGANIZATIONAL","activeConnections":0,"attributes":{"max-connections":"","max-connections-per-user":""}}

% cat add-group.sh
curl -i -X POST "http://127.0.0.1:6060/api/session/data/postgresql/connectionGroups?token=8EAD8FCE7185A54F0F98018F5640A06DC519CA66868BFA5BAF9035FDC913ACEB" -d '{"parentIdentifier": "ROOT", "type": "ORGANIZATIONAL", "name": "GRUPP1", "attributes": {"max-connections-per-user": "", "max-connections": ""}}' -H "Content-Type: application/json"

Created connection group GRUPP1. So, probably json should work with users too. 
I'll try to dig deeper :) I suspect that 500 errors happen because API
requires certain fields and not because of json/nonjson format. 

-- 
    Roman V. Isaev    http://www.isaev.ru    Moscow, Russia

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@guacamole.apache.org
For additional commands, e-mail: user-help@guacamole.apache.org