503 when connecting to mysql

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

503 when connecting to mysql

Clay McCoy
sonar 1.8
latest mysql

Previously I had Hudson and Sonar on the same box, but due to Hudson hanging everytime without explanation I have abandoned it.  I am now building and sonaring with maven from a different machine.  Maven sonar failed to connect to Derby, maybe it's not supported for this?  It's not clear.
So I installed mysql.  I'm not a mysql expert, so the errors in the mysql commands on the sonar site caused me some problems.  The \ in the grant command causes problems.

Once I had a mysql database setup and configured in sonar, I restarted sonar and it setup the database for me.  Then I figured out the hard way that I had to do extra configuration to make mysql available remotely.  This link helped quite a bit. (it will be helpful to know that there are .cnf templates in your mysql install if you don't have a /etc/my.cnf)
http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html

At some point in setting the permissions for remote mysql access sonar quit working.  On restarts it gives a 503 SERVICE_UNAVAILABLE error when I go to the site.  I get no errors in the sonar log.  When I set the db back to derby, sonar works fine.  I have droped teh sonar mysql database and created a new one.  Same thing with it.  What could be wrong and how could I fix it?

Thanks,
Clay
Reply | Threaded
Open this post in threaded view
|

Re: 503 when connecting to mysql

Freddy Mallet
Hi Clay,

Looks like you're struggling to get Sonar works as you'd like. That's exactly what we'd like to prevent. Sorry for that !

On Thu, May 14, 2009 at 8:22 PM, Clay McCoy <[hidden email]> wrote:
...
 Once I had a mysql database setup and configured in sonar, I restarted sonar
and it setup the database for me.  Then I figured out the hard way that I
had to do extra configuration to make mysql available remotely.  This link
helped quite a bit. (it will be helpful to know that there are .cnf
templates in your mysql install if you don't have a /etc/my.cnf)
http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html

I've updated the Full installation in 5 steps Confluence page in order to add this info.


 
At some point in setting the permissions for remote mysql access sonar quit
working.  On restarts it gives a 503 SERVICE_UNAVAILABLE error when I go to
the site.  I get no errors in the sonar log.  When I set the db back to
derby, sonar works fine.  I have droped teh sonar mysql database and created
a new one.  Same thing with it.  What could be wrong and how could I fix it?

Could you take a look to the wrapper.log (just near the sonar.log file, Those two files will merge in Sonar 1.10). I suspect a problem of privilege for the user 'sonar'. Indeed, when you create a MySQL user, you grant rights to the couples user/localhost and / or user/%.

Hope it helps,
Freddy

Reply | Threaded
Open this post in threaded view
|

Re: 503 when connecting to mysql

Clay McCoy

Now I have sonar running on the same machine as bamboo, and using derby.  I disabled the code coverage and it actually worked!! :)  Then I got greedy and added the findbugs inspections. That worked too!  But when I was browsing to the "Hotspots" sonar became unresponsive.  I eventually restarted it, and got the 503 again.  I now get the following exception when starting, it seems that derby may have been corrupted.

C:\Documents and Settings\admin\Desktop\sonar-1.8>bin\windows-x86-32\StartSonar.
bat
wrapper  | --> Wrapper Started as Console
wrapper  | Java Service Wrapper Community Edition 3.3.0
wrapper  |   Copyright (C) 1999-2008 Tanuki Software, Inc.  All Rights Reserved.

wrapper  |     http://wrapper.tanukisoftware.org
wrapper  |
wrapper  | Launching a JVM...
jvm 1    | WrapperManager: Initializing...
jvm 1    | java.net.SocketException: Connection reset
jvm 1    |      at java.net.SocketInputStream.read(Unknown Source)
jvm 1    |      at java.net.SocketInputStream.read(Unknown Source)
jvm 1    |      at org.apache.derby.impl.drda.NetworkServerControlImpl.fillReply
Buffer(Unknown Source)
jvm 1    |      at org.apache.derby.impl.drda.NetworkServerControlImpl.readResul
t(Unknown Source)
jvm 1    |      at org.apache.derby.impl.drda.NetworkServerControlImpl.pingWithN
oOpen(Unknown Source)
jvm 1    |      at org.apache.derby.impl.drda.NetworkServerControlImpl.ping(Unkn
own Source)
jvm 1    |      at org.apache.derby.drda.NetworkServerControl.ping(Unknown Sourc
e)
jvm 1    |      at org.sonar.core.database.EmbeddedDatabase.ensureServerIsUp(Emb
eddedDatabase.java:132)
jvm 1    |      at org.sonar.core.database.EmbeddedDatabase.startListening(Embed
dedDatabase.java:101)
jvm 1    |      at org.sonar.core.database.EmbeddedDatabase.start(EmbeddedDataba
se.java:91)
jvm 1    |      at org.sonar.core.database.EmbeddedDatabaseFactory.start(Embedde
dDatabaseFactory.java:37)
jvm 1    |      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
jvm 1    |      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
jvm 1    |      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Sourc
e)
jvm 1    |      at java.lang.reflect.Method.invoke(Unknown Source)
jvm 1    |      at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invok
eMethod(ReflectionLifecycleStrategy.java:110)
jvm 1    |      at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start
(ReflectionLifecycleStrategy.java:89)
jvm 1    |      at org.picocontainer.injectors.AbstractInjector.start(AbstractIn
jector.java:131)
jvm 1    |      at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBe
havior.java:173)
jvm 1    |      at org.picocontainer.behaviors.Stored$RealComponentLifecycle.sta
rt(Stored.java:134)
jvm 1    |      at org.picocontainer.behaviors.Stored.start(Stored.java:111)
jvm 1    |      at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultP
icoContainer.java:882)
jvm 1    |      at org.picocontainer.DefaultPicoContainer.start(DefaultPicoConta
iner.java:630)
jvm 1    |      at org.sonar.core.Application.start(Application.java:57)
jvm 1    |      at org.sonar.web.listeners.ApplicationListener.contextInitialize
d(ApplicationListener.java:42)
jvm 1    |      at org.mortbay.jetty.handler.ContextHandler.startContext(Context
Handler.java:543)
jvm 1    |      at org.mortbay.jetty.servlet.Context.startContext(Context.java:1
36)
jvm 1    |      at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppCon
text.java:1220)
jvm 1    |      at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandl
er.java:513)
jvm 1    |      at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.
java:448)
jvm 1    |      at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCyc
le.java:39)
jvm 1    |      at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCo
llection.java:152)
jvm 1    |      at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCyc
le.java:39)
jvm 1    |      at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapp
er.java:130)
jvm 1    |      at org.mortbay.jetty.Server.doStart(Server.java:222)
jvm 1    |      at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCyc
le.java:39)
jvm 1    |      at org.sonar.application.JettyEmbedder.start(JettyEmbedder.java:
76)
jvm 1    |      at org.sonar.application.StartServer.main(StartServer.java:39)
jvm 1    |      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
jvm 1    |      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
jvm 1    |      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Sourc
e)
jvm 1    |      at java.lang.reflect.Method.invoke(Unknown Source)
jvm 1    |      at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimple
App.java:237)
jvm 1    |      at java.lang.Thread.run(Unknown Source)
jvm 1    | Sonar listens http://0.0.0.0:9000/



Freddy Mallet wrote
Hi Clay,
Looks like you're struggling to get Sonar works as you'd like. That's
exactly what we'd like to prevent. Sorry for that !

On Thu, May 14, 2009 at 8:22 PM, Clay McCoy <nabble@claymccoy.com> wrote:

> ...
>  Once I had a mysql database setup and configured in sonar, I restarted
> sonar
> and it setup the database for me.  Then I figured out the hard way that I
> had to do extra configuration to make mysql available remotely.  This link
> helped quite a bit. (it will be helpful to know that there are .cnf
> templates in your mysql install if you don't have a /etc/my.cnf)
>
> http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html


I've updated the Full installation in 5 steps Confluence page in order to
add this info.

http://docs.codehaus.org/display/SONAR/Full+installation+in+5+steps



> At some point in setting the permissions for remote mysql access sonar quit
> working.  On restarts it gives a 503 SERVICE_UNAVAILABLE error when I go to
> the site.  I get no errors in the sonar log.  When I set the db back to
> derby, sonar works fine.  I have droped teh sonar mysql database and
> created
> a new one.  Same thing with it.  What could be wrong and how could I fix
> it?


Could you take a look to the wrapper.log (just near the sonar.log file,
Those two files will merge in Sonar 1.10). I suspect a problem of privilege
for the user 'sonar'. Indeed, when you create a MySQL user, you grant rights
to the couples user/localhost and / or user/%.

Hope it helps,
Freddy
Reply | Threaded
Open this post in threaded view
|

Re: 503 when connecting to mysql

Clay McCoy
Though I don't know what caused the unresponsiveness that forced me to restart sonar.  I do know the cause of this second 503 error.  Sonar was shutdown but not Derby.  I had to stop the java process for derby and delete the db.lck file from the derby database which is under <sonar_home>/data.

Clay McCoy wrote
Now I have sonar running on the same machine as bamboo, and using derby.  I disabled the code coverage and it actually worked!! :)  Then I got greedy and added the findbugs inspections. That worked too!  But when I was browsing to the "Hotspots" sonar became unresponsive.  I eventually restarted it, and got the 503 again.  I now get the following exception when starting, it seems that derby may have been corrupted.

C:\Documents and Settings\admin\Desktop\sonar-1.8>bin\windows-x86-32\StartSonar.
bat
wrapper  | --> Wrapper Started as Console
wrapper  | Java Service Wrapper Community Edition 3.3.0
wrapper  |   Copyright (C) 1999-2008 Tanuki Software, Inc.  All Rights Reserved.

wrapper  |     http://wrapper.tanukisoftware.org
wrapper  |
wrapper  | Launching a JVM...
jvm 1    | WrapperManager: Initializing...
jvm 1    | java.net.SocketException: Connection reset
jvm 1    |      at java.net.SocketInputStream.read(Unknown Source)
jvm 1    |      at java.net.SocketInputStream.read(Unknown Source)
jvm 1    |      at org.apache.derby.impl.drda.NetworkServerControlImpl.fillReply
Buffer(Unknown Source)
jvm 1    |      at org.apache.derby.impl.drda.NetworkServerControlImpl.readResul
t(Unknown Source)
jvm 1    |      at org.apache.derby.impl.drda.NetworkServerControlImpl.pingWithN
oOpen(Unknown Source)
jvm 1    |      at org.apache.derby.impl.drda.NetworkServerControlImpl.ping(Unkn
own Source)
jvm 1    |      at org.apache.derby.drda.NetworkServerControl.ping(Unknown Sourc
e)
jvm 1    |      at org.sonar.core.database.EmbeddedDatabase.ensureServerIsUp(Emb
eddedDatabase.java:132)
jvm 1    |      at org.sonar.core.database.EmbeddedDatabase.startListening(Embed
dedDatabase.java:101)
jvm 1    |      at org.sonar.core.database.EmbeddedDatabase.start(EmbeddedDataba
se.java:91)
jvm 1    |      at org.sonar.core.database.EmbeddedDatabaseFactory.start(Embedde
dDatabaseFactory.java:37)
jvm 1    |      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
jvm 1    |      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
jvm 1    |      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Sourc
e)
jvm 1    |      at java.lang.reflect.Method.invoke(Unknown Source)
jvm 1    |      at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invok
eMethod(ReflectionLifecycleStrategy.java:110)
jvm 1    |      at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start
(ReflectionLifecycleStrategy.java:89)
jvm 1    |      at org.picocontainer.injectors.AbstractInjector.start(AbstractIn
jector.java:131)
jvm 1    |      at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBe
havior.java:173)
jvm 1    |      at org.picocontainer.behaviors.Stored$RealComponentLifecycle.sta
rt(Stored.java:134)
jvm 1    |      at org.picocontainer.behaviors.Stored.start(Stored.java:111)
jvm 1    |      at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultP
icoContainer.java:882)
jvm 1    |      at org.picocontainer.DefaultPicoContainer.start(DefaultPicoConta
iner.java:630)
jvm 1    |      at org.sonar.core.Application.start(Application.java:57)
jvm 1    |      at org.sonar.web.listeners.ApplicationListener.contextInitialize
d(ApplicationListener.java:42)
jvm 1    |      at org.mortbay.jetty.handler.ContextHandler.startContext(Context
Handler.java:543)
jvm 1    |      at org.mortbay.jetty.servlet.Context.startContext(Context.java:1
36)
jvm 1    |      at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppCon
text.java:1220)
jvm 1    |      at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandl
er.java:513)
jvm 1    |      at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.
java:448)
jvm 1    |      at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCyc
le.java:39)
jvm 1    |      at org.mortbay.jetty.handler.HandlerCollection.doStart(HandlerCo
llection.java:152)
jvm 1    |      at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCyc
le.java:39)
jvm 1    |      at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapp
er.java:130)
jvm 1    |      at org.mortbay.jetty.Server.doStart(Server.java:222)
jvm 1    |      at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCyc
le.java:39)
jvm 1    |      at org.sonar.application.JettyEmbedder.start(JettyEmbedder.java:
76)
jvm 1    |      at org.sonar.application.StartServer.main(StartServer.java:39)
jvm 1    |      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
jvm 1    |      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
jvm 1    |      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Sourc
e)
jvm 1    |      at java.lang.reflect.Method.invoke(Unknown Source)
jvm 1    |      at org.tanukisoftware.wrapper.WrapperSimpleApp.run(WrapperSimple
App.java:237)
jvm 1    |      at java.lang.Thread.run(Unknown Source)
jvm 1    | Sonar listens http://0.0.0.0:9000/



Freddy Mallet wrote
Hi Clay,
Looks like you're struggling to get Sonar works as you'd like. That's
exactly what we'd like to prevent. Sorry for that !

On Thu, May 14, 2009 at 8:22 PM, Clay McCoy <nabble@claymccoy.com> wrote:

> ...
>  Once I had a mysql database setup and configured in sonar, I restarted
> sonar
> and it setup the database for me.  Then I figured out the hard way that I
> had to do extra configuration to make mysql available remotely.  This link
> helped quite a bit. (it will be helpful to know that there are .cnf
> templates in your mysql install if you don't have a /etc/my.cnf)
>
> http://www.cyberciti.biz/tips/how-do-i-enable-remote-access-to-mysql-database-server.html


I've updated the Full installation in 5 steps Confluence page in order to
add this info.

http://docs.codehaus.org/display/SONAR/Full+installation+in+5+steps



> At some point in setting the permissions for remote mysql access sonar quit
> working.  On restarts it gives a 503 SERVICE_UNAVAILABLE error when I go to
> the site.  I get no errors in the sonar log.  When I set the db back to
> derby, sonar works fine.  I have droped teh sonar mysql database and
> created
> a new one.  Same thing with it.  What could be wrong and how could I fix
> it?


Could you take a look to the wrapper.log (just near the sonar.log file,
Those two files will merge in Sonar 1.10). I suspect a problem of privilege
for the user 'sonar'. Indeed, when you create a MySQL user, you grant rights
to the couples user/localhost and / or user/%.

Hope it helps,
Freddy