Details
-
Bug
-
Resolution: Fixed
-
Major
-
6.1
-
Ubuntu server using xwiki-enterprise-tomcat7-pgsql package
-
N/A
-
N/A
-
Description
I’ve tried creating a new wiki “Other Wiki”, 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".
Stack trace in catalina.out shows:
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]
This appears to be due to the permissions for xwiki user in the PostgreSQL database. 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
This could possibly be fixed by increasing the privileges to xwiki, in line with the steps given in http://platform.xwiki.org/xwiki/bin/view/AdminGuide/InstallationPostgreSQL:
GRANT ALL ON SCHEMA public TO xwiki;
Alternatively a more secure option would be to make use of PostgreSQL's ability to perform DDL within transactions and wrap the subwiki creation into a SECURITY DEFINER function along the lines of
function createSubWiki(wikiname) AS CREATE SCHEMA wikiname // create all neccesary tables in new schema END