Blog data lost after Tomcat restart/shutdown

View: New views
5 Messages — Rating Filter:   Alert me  

Blog data lost after Tomcat restart/shutdown

by erisch :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi folks,

I hope you can help with this issue because I couldn't find any hints to
this problem on the internet.

The problem is simply that all blog articles are lost after a shutdown
or restart of Tomcat. The data directory still exists and for example
changes to CSS styles etc. are preserved when I have to restart Tomcat.
In contrast all articles are deleted and I see the default welcome post
after a restart.

Can anyone please tell me what I'm missing here? I searched the
documentation but there are not very much information and I think I got
everything configured as it should be. Well, obviously a small detail is
not OK... But I can't figure out what is wrong with my configuration.
Aren't blog entries persited by default? Do I have to make manual
backups before I can restart the server? What is in case of a server
crash? Thanks for your answers!

Marco

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Pebble-user mailing list
Pebble-user@...
https://lists.sourceforge.net/lists/listinfo/pebble-user

Re: Blog data lost after Tomcat restart/shutdown

by Chris Carrier-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I had a similar scare to this.  Not sure if you're having the same issue.  What happened with me was that I had originally started my web container with one user X.  But the init.d startup script I created had the container starting with a different user Y.  This caused two problems.  First the Pebble home directory (defined in the pebble-context.xml file or pebble.properties file) was now poinitng to a different location based on the user.home dir.

Second issue that was a little more of a pain was that even once I got Pebble home configured correctly the permissions were all screwed up because user X owned them. So I had to use chown to change the owner of the data folder.

Hope that helps.  These instructions are mostly aimed at a Linux machine but I imagine some of the same issues could be the same on Windows or Mac.

Chris

On Fri, Aug 7, 2009 at 3:48 PM, Marco Ehrentreich <erisch@...> wrote:
Hi folks,

I hope you can help with this issue because I couldn't find any hints to
this problem on the internet.

The problem is simply that all blog articles are lost after a shutdown
or restart of Tomcat. The data directory still exists and for example
changes to CSS styles etc. are preserved when I have to restart Tomcat.
In contrast all articles are deleted and I see the default welcome post
after a restart.

Can anyone please tell me what I'm missing here? I searched the
documentation but there are not very much information and I think I got
everything configured as it should be. Well, obviously a small detail is
not OK... But I can't figure out what is wrong with my configuration.
Aren't blog entries persited by default? Do I have to make manual
backups before I can restart the server? What is in case of a server
crash? Thanks for your answers!

Marco

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Pebble-user mailing list
Pebble-user@...
https://lists.sourceforge.net/lists/listinfo/pebble-user


------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Pebble-user mailing list
Pebble-user@...
https://lists.sourceforge.net/lists/listinfo/pebble-user

Parent Message unknown Re: Blog data lost after Tomcat restart/shutdown

by geezenslaw :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hello Marco, I don't have a direct answer to your issue but I don't think your blog entries have been deleted based on a TC restart. As you may know Pebble uses no SQL database but instead keeps the entries on the file system. Any time I am doing something with my public Pebble and TC I back up the files because it is one of the easiest things I can do to preserve my blog. I have gone through 2 server crashes without loss of Pebble data. Just keep digging or wait for Olaf or one of the Pebble gurus to reply.

Marco Ehrentreich <erisch@...> wrote ..

> Hi folks,
>
> I hope you can help with this issue because I couldn't find any hints to
> this problem on the internet.
>
> The problem is simply that all blog articles are lost after a shutdown
> or restart of Tomcat. The data directory still exists and for example
> changes to CSS styles etc. are preserved when I have to restart Tomcat.
> In contrast all articles are deleted and I see the default welcome post
> after a restart.
>
> Can anyone please tell me what I'm missing here? I searched the
> documentation but there are not very much information and I think I got
> everything configured as it should be. Well, obviously a small detail is
> not OK... But I can't figure out what is wrong with my configuration.
> Aren't blog entries persited by default? Do I have to make manual
> backups before I can restart the server? What is in case of a server
> crash? Thanks for your answers!
>
> Marco
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Pebble-user mailing list
> Pebble-user@...
> https://lists.sourceforge.net/lists/listinfo/pebble-user

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Pebble-user mailing list
Pebble-user@...
https://lists.sourceforge.net/lists/listinfo/pebble-user

Re: Blog data lost after Tomcat restart/shutdown

by Olaf Kock-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I second Chris' hint. Usually this happens when the user directory
changes, e.g. when tomcat is started from another user account. Check
this by setting the data directory in pebble.properties to a fully
qualified value - e.g. not containing ${user.home}. Make sure that the
user account you're running tomcat from has read/write access to that
directory as well as to tomcat's subdirectories temp, work, conf and
webapps (if I recall them correctly).

If you're running on Linux, never run tomcat as root.

Cheers.
Olaf

Chris Carrier schrieb:

> I had a similar scare to this.  Not sure if you're having the same
> issue.  What happened with me was that I had originally started my web
> container with one user X.  But the init.d startup script I created had
> the container starting with a different user Y.  This caused two
> problems.  First the Pebble home directory (defined in the
> pebble-context.xml file or pebble.properties file) was now poinitng to a
> different location based on the user.home dir.
>
> Second issue that was a little more of a pain was that even once I got
> Pebble home configured correctly the permissions were all screwed up
> because user X owned them. So I had to use chown to change the owner of
> the data folder.
>
> Hope that helps.  These instructions are mostly aimed at a Linux machine
> but I imagine some of the same issues could be the same on Windows or Mac.
>
> Chris
>
> On Fri, Aug 7, 2009 at 3:48 PM, Marco Ehrentreich wrote:
>
>     Hi folks,
>
>     I hope you can help with this issue because I couldn't find any hints to
>     this problem on the internet.
>
>     The problem is simply that all blog articles are lost after a shutdown
>     or restart of Tomcat. The data directory still exists and for example
>     changes to CSS styles etc. are preserved when I have to restart Tomcat.
>     In contrast all articles are deleted and I see the default welcome post
>     after a restart.
>
>     Can anyone please tell me what I'm missing here? I searched the
>     documentation but there are not very much information and I think I got
>     everything configured as it should be. Well, obviously a small detail is
>     not OK... But I can't figure out what is wrong with my configuration.
>     Aren't blog entries persited by default? Do I have to make manual
>     backups before I can restart the server? What is in case of a server
>     crash? Thanks for your answers!
>
>     Marco

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Pebble-user mailing list
Pebble-user@...
https://lists.sourceforge.net/lists/listinfo/pebble-user

Parent Message unknown Re: Blog data lost after Tomcat restart/shutdown

by erisch :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi!

Thank you all for your answers! I really appreciate your help! Actually
Chris gave me the crucial hint regarding the user Tomcat is running with ;-)

But the problem was a bit more complicated than just running with the
wrong uid. I've got some years experience with Linux and I think I would
have noticed a problem with user privileges. The real problem was that I
recently tried to install Tomcat from the distribution (Gentoo) and
because I haven't made updates on this server for a while there was
trouble with broken dependencies and I decided to stay with the manually
installed Tomcat.

And I don't know how on earth those Tomcats got this done but the
automatically and manually installed Tomcat were running concurrently on
the same machine even with the same ports configured without the usual
error message because a port was already bound by the other Tomcat
instance. The automatically installed Tomcat wasn't even installed
completely because the installation failed before completion. Anyway,
the two Tomcats managed to share some resources - don't ask me how - so
that both were running. The globally installed Tomcat was the one
delivering web content. After restarting my user specific Tomcat it took
over content handling (again, I don't know how because the ports should
have been already bound) and thus the blog entries added before were
still in the home directory of the other Tomcat and so my blog appeard
empty now. The automatically installed Tomcat still kept running in the
background even though the installation was incomplete or maybe exactly
this broken installation was the origin of the problems... Who knows?

With Chris' hint I quickly found the data in the wrong home directory
and after re-creating the indexes I've got back my data :-)

Thanks again for taking the time!

Marco


Olaf Kock schrieb:

> Hi,
>
> I second Chris' hint. Usually this happens when the user directory
> changes, e.g. when tomcat is started from another user account. Check
> this by setting the data directory in pebble.properties to a fully
> qualified value - e.g. not containing ${user.home}. Make sure that the
> user account you're running tomcat from has read/write access to that
> directory as well as to tomcat's subdirectories temp, work, conf and
> webapps (if I recall them correctly).
>
> If you're running on Linux, never run tomcat as root.
>
> Cheers.
> Olaf
>
> Chris Carrier schrieb:
>> I had a similar scare to this.  Not sure if you're having the same
>> issue.  What happened with me was that I had originally started my web
>> container with one user X.  But the init.d startup script I created had
>> the container starting with a different user Y.  This caused two
>> problems.  First the Pebble home directory (defined in the
>> pebble-context.xml file or pebble.properties file) was now poinitng to a
>> different location based on the user.home dir.
>>
>> Second issue that was a little more of a pain was that even once I got
>> Pebble home configured correctly the permissions were all screwed up
>> because user X owned them. So I had to use chown to change the owner of
>> the data folder.
>>
>> Hope that helps.  These instructions are mostly aimed at a Linux machine
>> but I imagine some of the same issues could be the same on Windows or Mac.
>>
>> Chris
>>
>> On Fri, Aug 7, 2009 at 3:48 PM, Marco Ehrentreich wrote:
>>
>>     Hi folks,
>>
>>     I hope you can help with this issue because I couldn't find any hints to
>>     this problem on the internet.
>>
>>     The problem is simply that all blog articles are lost after a shutdown
>>     or restart of Tomcat. The data directory still exists and for example
>>     changes to CSS styles etc. are preserved when I have to restart Tomcat.
>>     In contrast all articles are deleted and I see the default welcome post
>>     after a restart.
>>
>>     Can anyone please tell me what I'm missing here? I searched the
>>     documentation but there are not very much information and I think I got
>>     everything configured as it should be. Well, obviously a small detail is
>>     not OK... But I can't figure out what is wrong with my configuration.
>>     Aren't blog entries persited by default? Do I have to make manual
>>     backups before I can restart the server? What is in case of a server
>>     crash? Thanks for your answers!
>>
>>     Marco
>
> ------------------------------------------------------------------------------
> Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
> trial. Simplify your report design, integration and deployment - and focus on
> what you do best, core application coding. Discover what's new with
> Crystal Reports now.  http://p.sf.net/sfu/bobj-july
> _______________________________________________
> Pebble-user mailing list
> Pebble-user@...
> https://lists.sourceforge.net/lists/listinfo/pebble-user

------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Pebble-user mailing list
Pebble-user@...
https://lists.sourceforge.net/lists/listinfo/pebble-user