[xwiki-users] Access denied for user 'xwiki'@'localhost'
Hi all! When upgrading to upgraded to XEM 2.4 a XE 2.4.30451 instance as per xwiki-enterprise-web-2.4.war on this environment: ***** Open Enterprise Server 2 SP2 2.0.2-0 / Suse Linux Enterprise Server 10 SP3 10.3-0 (Fully updated and patched. It is the current OES2 commercial configuration distributed by Novell) Built-in Tomcat5 5.5.27 at /srv/www/tomcat5 Built-in MySQL 5.0.26 at /usr/bin with nmysql-connector-java-5.1.13-bin.jar ----- peat:/ # java -version java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build pxi32dev-20091106a (SR11 )) IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 Linux x86-32 j9vmxi3223-20091104 (JIT enabled) J9VM - 20091103_45935_lHdSMr JIT - 20091016_1845_r8 GC - 20091026_AA) JCL - 20091106 peat:/ # ---- ***** I get an error when I import xwiki-enterprise-manager-application-xem-2.4.xar: 1 Document(s) with error List of documents with errors * XemManager.Install If I go to XemManager/Install the page tell me that To complete installation XWiki Enterprise Manager will : * Add default template I click YES and get this other error: XWiki Enterprise Manager installation failed (Error number 50035 in 5: com.xpn.xwiki.plugin.wikimanager.WikiManagerPlugin: Wiki templatexe? database update failed Wrapped Exception: Error number 3202 in 3: Exception while reading document XWiki.XWikiPreferences Wrapped Exception: Error number 3301 in 3: Exception while switching to database templatexe Wrapped Exception: Access denied for user 'xwiki'@'localhost' to database 'templatexe'). As expected, it is the same error that I get when trying to create a new wiki in the wiki farm. xwiki user has been granted full privileges on MySQL. In fact, if execute a create schema command locally, xwiki creates and deletes any new schema without an problem. Please, have you any idea about where am I wrong or is it failing here? Thanks! Ricardo -- Ricardo Rodríguez CTO eBioTIC. Life Sciences, Data Modeling and Information Management Systems
Hi, I am not able to work out this problem. I don't understand why if xwiki@localhost has been granted all privileges as shown here... RicardoRodriguez@peat:/> mysql -u xwiki -p -e "show grants for 'xwiki'@'localhost'" Enter password: +-----------------------------------------------------------------------------------------------------------------------+ | Grants for xwiki@localhost | +-----------------------------------------------------------------------------------------------------------------------+ | GRANT ALL PRIVILEGES ON *.* TO 'xwiki'@'localhost' IDENTIFIED BY PASSWORD '**********' | | GRANT ALL PRIVILEGES ON `xwiki`.* TO 'xwiki'@'localhost' | +-----------------------------------------------------------------------------------------------------------------------+ ...it keeps failing to create templatexe. I am trying to find if the owner of the Tomcat process has anything to do with this problem, but as far as I find, the only user implied here is MySQL user xwiki, and xwiki has been granted all privileges and its is able to create/delete schemas. Please, could you give me some clue about how could I debug this issue? Thanks! All the best, Ricardo [Ricardo Rodriguez] eBioTIC. wrote:
Hi all!
When upgrading to upgraded to XEM 2.4 a XE 2.4.30451 instance as per xwiki-enterprise-web-2.4.war on this environment:
***** Open Enterprise Server 2 SP2 2.0.2-0 / Suse Linux Enterprise Server 10 SP3 10.3-0
(Fully updated and patched. It is the current OES2 commercial configuration distributed by Novell)
Built-in Tomcat5 5.5.27 at /srv/www/tomcat5 Built-in MySQL 5.0.26 at /usr/bin with nmysql-connector-java-5.1.13-bin.jar ----- peat:/ # java -version java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build pxi32dev-20091106a (SR11 )) IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 Linux x86-32 j9vmxi3223-20091104 (JIT enabled) J9VM - 20091103_45935_lHdSMr JIT - 20091016_1845_r8 GC - 20091026_AA) JCL - 20091106 peat:/ # ---- *****
I get an error when I import xwiki-enterprise-manager-application-xem-2.4.xar:
1 Document(s) with error
List of documents with errors * XemManager.Install
If I go to XemManager/Install the page tell me that To complete installation XWiki Enterprise Manager will :
* Add default template
I click YES and get this other error:
XWiki Enterprise Manager installation failed (Error number 50035 in 5: com.xpn.xwiki.plugin.wikimanager.WikiManagerPlugin: Wiki templatexe? database update failed Wrapped Exception: Error number 3202 in 3: Exception while reading document XWiki.XWikiPreferences Wrapped Exception: Error number 3301 in 3: Exception while switching to database templatexe Wrapped Exception: Access denied for user 'xwiki'@'localhost' to database 'templatexe').
As expected, it is the same error that I get when trying to create a new wiki in the wiki farm.
xwiki user has been granted full privileges on MySQL. In fact, if execute a create schema command locally, xwiki creates and deletes any new schema without an problem.
Please, have you any idea about where am I wrong or is it failing here?
Thanks!
Ricardo
-- Ricardo Rodríguez CTO eBioTIC. Life Sciences, Data Modeling and Information Management Systems
It doesn't make much sense to me either but if the database is dedicated to just that xwiki installation as indicated by GRANT ALL PRIVILEGES ON *.* TO 'xwiki'@'localhost' you could change the user in the hibernate.cfg.xml to 'root'. Not really a fix I know but perhaps it would reveal more information about the problem. Caleb [Ricardo Rodriguez] eBioTIC. wrote:
Hi,
I am not able to work out this problem. I don't understand why if xwiki@localhost has been granted all privileges as shown here...
RicardoRodriguez@peat:/> mysql -u xwiki -p -e "show grants for 'xwiki'@'localhost'" Enter password: +-----------------------------------------------------------------------------------------------------------------------+ | Grants for xwiki@localhost | +-----------------------------------------------------------------------------------------------------------------------+ | GRANT ALL PRIVILEGES ON *.* TO 'xwiki'@'localhost' IDENTIFIED BY PASSWORD '**********' | | GRANT ALL PRIVILEGES ON `xwiki`.* TO 'xwiki'@'localhost' | +-----------------------------------------------------------------------------------------------------------------------+
...it keeps failing to create templatexe. I am trying to find if the owner of the Tomcat process has anything to do with this problem, but as far as I find, the only user implied here is MySQL user xwiki, and xwiki has been granted all privileges and its is able to create/delete schemas.
Please, could you give me some clue about how could I debug this issue? Thanks!
All the best,
Ricardo
[Ricardo Rodriguez] eBioTIC. wrote:
Hi all!
When upgrading to upgraded to XEM 2.4 a XE 2.4.30451 instance as per xwiki-enterprise-web-2.4.war on this environment:
***** Open Enterprise Server 2 SP2 2.0.2-0 / Suse Linux Enterprise Server 10 SP3 10.3-0
(Fully updated and patched. It is the current OES2 commercial configuration distributed by Novell)
Built-in Tomcat5 5.5.27 at /srv/www/tomcat5 Built-in MySQL 5.0.26 at /usr/bin with nmysql-connector-java-5.1.13-bin.jar ----- peat:/ # java -version java version "1.5.0" Java(TM) 2 Runtime Environment, Standard Edition (build pxi32dev-20091106a (SR11 )) IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 Linux x86-32 j9vmxi3223-20091104 (JIT enabled) J9VM - 20091103_45935_lHdSMr JIT - 20091016_1845_r8 GC - 20091026_AA) JCL - 20091106 peat:/ # ---- *****
I get an error when I import xwiki-enterprise-manager-application-xem-2.4.xar:
1 Document(s) with error
List of documents with errors * XemManager.Install
If I go to XemManager/Install the page tell me that To complete installation XWiki Enterprise Manager will :
* Add default template
I click YES and get this other error:
XWiki Enterprise Manager installation failed (Error number 50035 in 5: com.xpn.xwiki.plugin.wikimanager.WikiManagerPlugin: Wiki templatexe? database update failed Wrapped Exception: Error number 3202 in 3: Exception while reading document XWiki.XWikiPreferences Wrapped Exception: Error number 3301 in 3: Exception while switching to database templatexe Wrapped Exception: Access denied for user 'xwiki'@'localhost' to database 'templatexe').
As expected, it is the same error that I get when trying to create a new wiki in the wiki farm.
xwiki user has been granted full privileges on MySQL. In fact, if execute a create schema command locally, xwiki creates and deletes any new schema without an problem.
Please, have you any idea about where am I wrong or is it failing here?
Thanks!
Ricardo
Thanks, Caleb, Caleb James DeLisle wrote:
It doesn't make much sense to me either but if the database is dedicated to just that xwiki installation as indicated by GRANT ALL PRIVILEGES ON *.* TO 'xwiki'@'localhost' you could change the user in the hibernate.cfg.xml to 'root'. Not really a fix I know but perhaps it would reveal more information about the problem.
XWiki is the only application currently using this application, even though I would like to store there some other information. The command granting all privileges to xwiki@localhost is required by XEM to allow the application to create new wikis on the fly (I've submitted as proposed here URL). I think I perfectly understand this as each new wiki requires its own schema being templatexe the default template created during the installation. Following your proposal, I've done a different test: to grant xwiki user all privileges when connected from any host ('xwiki'@'%'). And it worked. After re-importing xwiki-enterprise-manager-application-xem-2.4.xar (if I don't import it, I can not select its contents to import it see this http://xen.net/fromPeat/importXEM.jpg), I get the same document in error. It claims that the default template must be imported. Going to the installation page offers the create the template button and it works without a glitch now. Creation of new wikis also works fine so far. I've added a second ethernet interface to the server, messed a bit with host names, edit sudoers file,.. but I don't know how this could affect to the privileges granted to xwiki@localhost. It seems like if MySQL identifies the connections as done from a different host in Internet, not from localhost. Please, does this make any sense for you? Thanks!!! Thank you so much for your help! Ricardo -- Ricardo Rodríguez CTO eBioTIC. Life Sciences, Data Modeling and Information Management Systems
[Ricardo Rodriguez] eBioTIC. wrote:
Thanks, Caleb,
Caleb James DeLisle wrote:
It doesn't make much sense to me either but if the database is dedicated to just that xwiki installation as indicated by GRANT ALL PRIVILEGES ON *.* TO 'xwiki'@'localhost' you could change the user in the hibernate.cfg.xml to 'root'. Not really a fix I know but perhaps it would reveal more information about the problem.
XWiki is the only application currently using this application, even though I would like to store there some other information. The command granting all privileges to xwiki@localhost is required by XEM to allow the application to create new wikis on the fly (I've submitted as proposed here URL). I think I perfectly understand this as each new wiki requires its own schema being templatexe the default template created during the installation.
Following your proposal, I've done a different test: to grant xwiki user all privileges when connected from any host ('xwiki'@'%'). And it worked.
After re-importing xwiki-enterprise-manager-application-xem-2.4.xar (if I don't import it, I can not select its contents to import it see this http://xen.net/fromPeat/importXEM.jpg), I get the same document in error. It claims that the default template must be imported. Going to the installation page offers the create the template button and it works without a glitch now. Creation of new wikis also works fine so far.
I've added a second ethernet interface to the server, messed a bit with host names, edit sudoers file,.. but I don't know how this could affect to the privileges granted to xwiki@localhost. It seems like if MySQL identifies the connections as done from a different host in Internet,
Check your ifconfig for different addresses attached to the the loopback device. Also you will get a lot more info by running tcpdump on the loopback and then on ethernet and filtering by destination port = mysql port. A wild guess is that the ethernet device is being used as a loopback. Caleb
not from localhost. Please, does this make any sense for you? Thanks!!!
Thank you so much for your help!
Ricardo
On 08/20/2010 04:08 PM, [Ricardo Rodriguez] eBioTIC. wrote:
Thanks, Caleb,
Caleb James DeLisle wrote:
It doesn't make much sense to me either but if the database is dedicated to just that xwiki installation as indicated by GRANT ALL PRIVILEGES ON *.* TO 'xwiki'@'localhost' you could change the user in the hibernate.cfg.xml to 'root'. Not really a fix I know but perhaps it would reveal more information about the problem.
XWiki is the only application currently using this application, even though I would like to store there some other information. The command granting all privileges to xwiki@localhost is required by XEM to allow the application to create new wikis on the fly (I've submitted as proposed here URL). I think I perfectly understand this as each new wiki requires its own schema being templatexe the default template created during the installation.
Following your proposal, I've done a different test: to grant xwiki user all privileges when connected from any host ('xwiki'@'%'). And it worked.
After re-importing xwiki-enterprise-manager-application-xem-2.4.xar (if I don't import it, I can not select its contents to import it see this http://xen.net/fromPeat/importXEM.jpg), I get the same document in error. It claims that the default template must be imported. Going to the installation page offers the create the template button and it works without a glitch now. Creation of new wikis also works fine so far.
I've added a second ethernet interface to the server, messed a bit with host names, edit sudoers file,.. but I don't know how this could affect to the privileges granted to xwiki@localhost. It seems like if MySQL identifies the connections as done from a different host in Internet, not from localhost. Please, does this make any sense for you? Thanks!!!
Sometimes the connection comes from 127.0.0.1, not from localhost. Although they're actually the same thing, it seems that mysql doesn't do a normalization of the host. Or something else, maybe an alias of the host. Anyway, you could connect to the mysql server from a console and run "show processlist;" to see which hostname is printed for the connections from XWiki. -- Sergiu Dumitriu http://purl.org/net/sergiu/
Thanks, Sergiu, Sergiu Dumitriu wrote:
Sometimes the connection comes from 127.0.0.1, not from localhost. Although they're actually the same thing, it seems that mysql doesn't do a normalization of the host. Or something else, maybe an alias of the host. Anyway, you could connect to the mysql server from a console and run "show processlist;" to see which hostname is printed for the connections from XWiki.
Here the output of "show processlist;" RicardoRodriguez@peat:~> mysql -u xwiki -p -e "show processlist" Enter password: +-----+-------+-----------------+-------+---------+------+-------+------------------+ | Id | User | Host | db | Command | Time | State | Info | +-----+-------+-----------------+-------+---------+------+-------+------------------+ | 100 | xwiki | localhost:37677 | xwiki | Sleep | 4 | | NULL | | 135 | xwiki | localhost | NULL | Query | 0 | NULL | show processlist | +-----+-------+-----------------+-------+---------+------+-------+------------------+ RicardoRodriguez@peat:~> It keeps been a mystery for me what is happening with that error when installing/using XEM. Something related with If XWiki generates tcp packets going in and out lo, it is clear that it is not using sockets but tcp. But these packets are from/to localhost so, why 'xwiki'@'localhost' with all privileges is not able to create schemas on demand? Just trying to understand what is going on here and if it could be of any importance for XWiki development. Thanks for your help! Ricardo -- Ricardo Rodríguez CTO eBioTIC. Life Sciences, Data Modeling and Information Management Systems
Hi! Thanks for the insight! Caleb James DeLisle wrote:
Check your ifconfig for different addresses attached to the the loopback device. Also you will get a lot more info by running tcpdump on the loopback and then on ethernet and filtering by destination port = mysql port. A wild guess is that the ethernet device is being used as a loopback.
As far as I can see here (http://xen.net/fromPeat/ifconfig20100822.html), there is no other IP assigned to the loop-back device than the "standard" one, 127.0.0.1. In fact, tcpdump filtered by MySQL port and lo interface captures packets only when XWiki receive, and reply to, any request (http://xen.net/fromPeat/tcpdumplo20100822.html) but no when a MySQL client located on a remote workstation executes a query. Filtering for MySQL port and eth0 interface captures packets originated by these remote MySQL queries. Thus, I don't find any anomalous behaviour in lo and eth0, and I am not able to figure out why privileges granted to 'xwiki'@'localhost' and/or 'xwiki'@'127.0.0.1' doesn't allow xwiki MySQL user to create new schemas on demand. The only explanation I am able to figure out is that mysql-connector-java-5.1.13-bin.jar is generating remote calls (I guess this is the expected behaviour) and these calls are identified as not coming from localhost or 127.0.0.1, so xwiki@% is required to have all privileges. But this is not what I see by using show processlist; as proposed by Sergiu (see this same thread). So. I am out of ideas! Well, I am not a MySQL, Linux, XWiki or whatever wizard so, any new idea will be really welcome!!! Thanks for your help, Ricardo -- Ricardo Rodríguez CTO eBioTIC. Life Sciences, Data Modeling and Information Management Systems
participants (3)
-
[Ricardo Rodriguez] eBioTIC. -
Caleb James DeLisle -
Sergiu Dumitriu