Error adding permission stardog:create:db:*

1 view
Skip to first unread message

oklma...@gmail.com

unread,
Jun 16, 2015, 2:47:37 AM6/16/15
to sta...@clarkparsia.com
I downloaded Stardog 3.1 Community version, and installed it in AWS EC2 (Linux AMI).

I installed the latest Oracle JDK 8. Everything seems to work well, until I started to add permission to a Role that I created. 

I logged in using the default admin/admin , create a role and tried to grant it the "Create" permission to Resource Type "db" and Resource "*".

I do not see any error in the Stardog log file, but on the browser side I get this error message :


Error adding permission stardog:create:db:*

java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 1 column 55



From Chrome's Developer Tools for Network, I get the following stats (with IP address masked off) :


General
    1. Remote Address:
      xx.xx.xx.xx:5820
    2. Request URL:
    3. Request Method:
      PUT
    4. Status Code:
      400 java.lang.IllegalStateException: Expected BEGIN_ARRAY but was STRING at line 1 column 55
  1. Response Headersview source
    1. Access-Control-Allow-Methods:
      PUT
    2. Access-Control-Allow-Origin:
      *
    3. Content-Length:
      88
    4. Server:
      Stardog/3.1/v4
  2. Request Headersview source
    1. Accept:
      application/json
    2. Accept-Encoding:
      gzip, deflate, sdch
    3. Accept-Language:
      en-GB,en-US;q=0.8,en;q=0.6
    4. Authorization:
      Basic YWRtaW46YWRtaW4=
    5. Connection:
      keep-alive
    6. Content-Length:
      55
    7. Content-Type:
      application/json
    8. Host:
      xx.xx.xx.xx:5820
    9. Origin:
    10. Referer:
    11. User-Agent:
      Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/43.0.2357.124 Safari/537.36
    12. X-Requested-With:
      XMLHttpRequest
  3. Request Payloadview source
    1. {action: "create", resource_type: "db", resource: "*"}


I cross checked the above against Stardog 3.0.1 (running on the same Oracle JDK 8), and I get the same HTTP Request, but the Role permission works without an error.

Anyone upgraded to Stardog 3.1 and faced this issue ?

Conrad Leonard

unread,
Jun 16, 2015, 8:40:29 AM6/16/15
to sta...@clarkparsia.com, oklma...@gmail.com
Yes; I see a similar thing when adding permission via HTTP POST; it appears that in 3.1 the value of the 'resource' key in the JSON payload to create permission is required to be a list, rather than a simple string as it used to be. From what you say, the web console in 3.1 is still using the old format too. If you want a workaround via a direct POST, changing 'resource: "*"' to be: 'resource: ["*"]' should work.

Edgar Rodriguez

unread,
Jun 16, 2015, 11:23:24 AM6/16/15
to sta...@clarkparsia.com
Yes, this is an bug and it should be fixed in the next release (3.1.1).

Cheers,
Edgar

--
-- --
You received this message because you are subscribed to the C&P "Stardog" group.
To post to this group, send email to sta...@clarkparsia.com
To unsubscribe from this group, send email to
stardog+u...@clarkparsia.com
For more options, visit this group at
http://groups.google.com/a/clarkparsia.com/group/stardog?hl=en

Reply all
Reply to author
Forward
0 new messages