You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Thomas Hill <Th...@t-online.de> on 2011/02/23 20:42:12 UTC

problems after "could not listen on port xxx on host 0.0.0.0" / corrupting data base?

Hi,

when trying to start-up the network server I am getting

Could not listen on port 31540 on host 0.0.0.0:
 java.net.BindException: Address already in use

(which is also the message store in derby.log).

This is the last message in the log and I am not sure what state the server is
in after that (started or not?).

When trying to connect from remote using IJ I am getting error 'Another instance
of Derby may have already booted the database'. From looking at the log (an
extract attached below) it seems as if a recovery has been attempted but finally
failed?!

I have found no way to get the database up and running again. Even after a
complete shutdown and restart of the server I continue to get the 'another
instance...' error. So I am not sure if my database might have been corrupted??

Any way to find out what is going on?

Thanks
Thomas

Wed Feb 23 20:25:54 CET 2011 Thread[DRDAConnThread_3,5,main] 
Cleanup action starting
java.sql.SQLException: Failed to start database 'PMTedb' with class loader 
sun.misc.Launcher$AppClassLoader@77cde100, see the next exception for details.
	at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQL
Exception(Unknown Source)
	at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown Source)
	at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown Source)
	at org.apache.derby.impl.jdbc.EmbedConnection40.<init>(Unknown Source)
....
....
java.sql.SQLException: Another instance of Derby may have already booted the
database


Re: problems after "could not listen on port xxx on host 0.0.0.0" / corrupting data base?

Posted by Thomas Hill <th...@t-online.de>.
okay, the address already in use being due to too quick request attempts might
be an explanation. I have in the meantime found out that, although the address
already in use error is given and the log does not contain the normal 'server
started and ready to accept connections' statements ==> the server is actually
available anyway and can be pinged/used, so the server was indeed started
Leaving the 'another instance....' issue which I am afraid I can't even say has
been created and how it can be reproduced. I came as a result of using a custom
build Eclipse RAP web application talking to the server. So I need to continue
to monitor to find out when this occurs and what might have caused it.
Unfortunatly there seems to be no way of making the data base usuable again once
this error is given.

So...some questions I can think of:
1) What version of derby are you using?
-> 10.7.1.1
2) What has happened between now and when you last could use the system - did
the system crash? 
->trouble is I haven't found out yet how to reproduce this
3) Did someone ctrl-c or kill the network server process? 
-> no
4) Did any other piece of software get installed on this system that could be
using the same port? 
-> don't think so, but it is a hosted tomcat server environment in which also
Derby is hosted
5) Can you start networkserver with a different port (not to connect to the
database; if ij can't, another network server cannot either).
-> would need to ask my hoster for this which I did not do
Have you tried booting your system since?
-> my hoster advised that my tomcat+derby server has been brought down and up
again, but as said the 'another instance...' error kept coming even after that




Re: problems after "could not listen on port xxx on host 0.0.0.0" / corrupting data base?

Posted by Myrna van Lunteren <m....@gmail.com>.
On Wed, Feb 23, 2011 at 2:33 PM, Morten Mikkelsen <mo...@gmail.com> wrote:
> Hi,
> I'm really no expert, but I would say there is not enough information here..
> I know of no situations where you would get the 'address already in use'
> exception if the port is free.
> Perhaps the script used to start the network server occupies the port before
> starting the server, making the actual start fail?
> You should be able to start the server before worrying about the next
> problems, so focus on that first off.
> /Morten
>
> On Wed, Feb 23, 2011 at 10:50 PM, Thomas Hill <Th...@t-online.de>
> wrote:
>>
>> Hi Morten,
>>
>> thanks for your reply "on the address already in user issue". The Network
>> Server
>> is hosted on the internet and my provider tells me that nothing else is
>> using
>> the port and their tests would indicate that - the normal (Linux)
>> start/stop
>> scripts coming with Derby are being used - when the Server is stopped the
>> port
>> is indeed properly released. They are assuming that if the port in a
>> (fresh)
>> start is not properly released the Derby Server might not have properly
>> been
>> shutdown / might have crashed - for which I don't have indications.
>>
>> Any toughts on whether the server is started after the address already in
>> use
>> has been encountered? There a no further entries in the log that would say
>> 'server is ready to accept connections' - so I guess the start failed.
>>
>> And any thougths on the 'another instance ...' issue - which prevents me
>> to boot
>> the database? might the database have been corrupted??
>>
>> Tx
>>
>>
>>
>>
>>
>
>
>
> --
> /Morten
>
I have seen this type of error pop up in rare situations - including
some bugs in networkserver (e.g. DERBY-4053, DERBY-4304), but also due
to jvm bugs, and from looking at DERBY-3108, it can be the result of a
normal TCP/IP limitation if you try to open and release connections
really fast. As Morten said, it's a classic network exception.

The fact that the database is not starting with ij is to *protect* it
from getting corrupted.

So...some questions I can think of:
What version of derby are you using?
What has happened between now and when you last could use the system -
did the system crash? Did someone ctrl-c or kill the network server
process? Did any other piece of software get installed on this system
that could be using the same port?
Can you start networkserver with a different port (not to connect to
the database; if ij can't, another network server cannot either).
Have you tried booting your system since?

Myrna

Re: problems after "could not listen on port xxx on host 0.0.0.0" / corrupting data base?

Posted by Morten Mikkelsen <mo...@gmail.com>.
Hi,
I'm really no expert, but I would say there is not enough information here..
I know of no situations where you would get the 'address already in use'
exception if the port is free.
Perhaps the script used to start the network server occupies the port before
starting the server, making the actual start fail?

You should be able to start the server before worrying about the next
problems, so focus on that first off.
/Morten


On Wed, Feb 23, 2011 at 10:50 PM, Thomas Hill <Th...@t-online.de>wrote:

> Hi Morten,
>
> thanks for your reply "on the address already in user issue". The Network
> Server
> is hosted on the internet and my provider tells me that nothing else is
> using
> the port and their tests would indicate that - the normal (Linux)
> start/stop
> scripts coming with Derby are being used - when the Server is stopped the
> port
> is indeed properly released. They are assuming that if the port in a
> (fresh)
> start is not properly released the Derby Server might not have properly
> been
> shutdown / might have crashed - for which I don't have indications.
>
> Any toughts on whether the server is started after the address already in
> use
> has been encountered? There a no further entries in the log that would say
> 'server is ready to accept connections' - so I guess the start failed.
>
> And any thougths on the 'another instance ...' issue - which prevents me to
> boot
> the database? might the database have been corrupted??
>
> Tx
>
>
>
>
>
>


-- 
/Morten

Re: problems after "could not listen on port xxx on host 0.0.0.0" / corrupting data base?

Posted by Thomas Hill <Th...@t-online.de>.
Hi Morten,

thanks for your reply "on the address already in user issue". The Network Server
is hosted on the internet and my provider tells me that nothing else is using
the port and their tests would indicate that - the normal (Linux) start/stop
scripts coming with Derby are being used - when the Server is stopped the port
is indeed properly released. They are assuming that if the port in a (fresh)
start is not properly released the Derby Server might not have properly been
shutdown / might have crashed - for which I don't have indications.

Any toughts on whether the server is started after the address already in use
has been encountered? There a no further entries in the log that would say
'server is ready to accept connections' - so I guess the start failed.

And any thougths on the 'another instance ...' issue - which prevents me to boot
the database? might the database have been corrupted??

Tx






Re: problems after "could not listen on port xxx on host 0.0.0.0" / corrupting data base?

Posted by Morten Mikkelsen <mo...@gmail.com>.
Hi,
This is a classic network exception.
Someone else is using the port you are trying to bind derby to.
You should use a tool suitable for determining who is already using that
port on your operating system - probably something like netstat...
/Morten

On Wed, Feb 23, 2011 at 8:42 PM, Thomas Hill <Th...@t-online.de>wrote:

> Hi,
>
> when trying to start-up the network server I am getting
>
> Could not listen on port 31540 on host 0.0.0.0:
>  java.net.BindException: Address already in use
>
> (which is also the message store in derby.log).
>
> This is the last message in the log and I am not sure what state the server
> is
> in after that (started or not?).
>
> When trying to connect from remote using IJ I am getting error 'Another
> instance
> of Derby may have already booted the database'. From looking at the log (an
> extract attached below) it seems as if a recovery has been attempted but
> finally
> failed?!
>
> I have found no way to get the database up and running again. Even after a
> complete shutdown and restart of the server I continue to get the 'another
> instance...' error. So I am not sure if my database might have been
> corrupted??
>
> Any way to find out what is going on?
>
> Thanks
> Thomas
>
> Wed Feb 23 20:25:54 CET 2011 Thread[DRDAConnThread_3,5,main]
> Cleanup action starting
> java.sql.SQLException: Failed to start database 'PMTedb' with class loader
> sun.misc.Launcher$AppClassLoader@77cde100, see the next exception for
> details.
>        at org.apache.derby.impl.jdbc.SQLExceptionFactory40.getSQL
> Exception(Unknown Source)
>        at org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Unknown
> Source)
>        at org.apache.derby.impl.jdbc.Util.seeNextException(Unknown Source)
>        at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(Unknown
> Source)
>        at org.apache.derby.impl.jdbc.EmbedConnection.<init>(Unknown Source)
>        at org.apache.derby.impl.jdbc.EmbedConnection30.<init>(Unknown
> Source)
>        at org.apache.derby.impl.jdbc.EmbedConnection40.<init>(Unknown
> Source)
> ....
> ....
> java.sql.SQLException: Another instance of Derby may have already booted
> the
> database
>
>


-- 
/Morten