On 1 Oct 2014 at 12:20:27, Bryn Jeffries
(bryn.jeffries@sydney.edu.au(mailto:bryn.jeffries@sydney.edu.au)) wrote:
Thanks for the prompt response. Your guess seems correct. Looking through the logs in
catalina.out I found this line in the stack trace:
Caused by: org.postgresql.util.PSQLException: ERROR: permission denied for database
xwiki
…
at com.xpn.xwiki.store.XWikiHibernateStore.createWiki(XWikiHibernateStore.java:325)
~[xwiki-platform-legacy-oldcore-6.1.jar:na]
Also, experimenting in psql:
postgres=# \connect xwiki
You are now connected to database "xwiki" as user "postgres".
xwiki=# SET SESSION AUTHORIZATION xwiki;
xwiki=> CREATE SCHEMA foo;
ERROR: permission denied for database xwiki
So does the xwiki user need to be able to create a new schema and tables therein?
Yes, the SQL that’s executed is “CREATE SCHEMA <wikiname>”. That’s why the doc says:
"GRANT ALL ON SCHEMA public TO xwiki;”. Now I’m not an expert in postgresql so if
there’s a way with less privileges please let us know or update the wiki page yourself
directly.
That’s quite an escalation of privileges – maybe it
would be better to implement it in a SECURITY DEFINER stored procedure if that’s possible
in postrgesql.
If this is a permissions error I should add that I’m using the
xwiki-enterprise-tomcat7-pgsql package for Ubuntu/Debian from
http://maven.xwiki.org/stable/xwiki-stable.list so I guess this is a bug in the package.
Indeed, you should report a jira issue on
http://jira.xwiki.org about this IMO.
Thanks
-Vincent
Thanks
From: Vincent Massol [mailto:vmassol@gmail.com] On Behalf Of vincent(a)massol.net
Sent: Wednesday, 1 October 2014 7:24 PM
To: XWiki Users
Cc: Bryn Jeffries
Subject: Re: [xwiki-users] Problems creating new wikis - PostgreSQL?
Hi Bryn,
On 30 Sep 2014 at 23:57:47, Bryn Jeffries wrote:
I've tried creating a new wiki "Other
Wiki" under my XWiki 6.1 system, using the "Add Wiki" feature. Once I'd
entered the details of the wiki and the users I clicked "Create Wiki" and got
the following error:
Wiki "otherwiki" creation failed: org.xwiki.wiki.manager.WikiManagerException:
Failed to create database for wiki "otherwiki”.
The most likely reason is that you’ve not given the xwiki user the permissions to create
new schemas/databases in your postgresql instance.
See
http://platform.xwiki.org/xwiki/bin/view/AdminGuide/InstallationPostgreSQL
Could you check your XWiki logs and find the detailed error there?
Thanks
-Vincent
FWIW I'm running XWiki on a PostgreSQL
database. Could this be part of the problem?