Critical Error on Confluence !
Asked by eKyNoX:

Hello,

I just restarted my computer this morning and Confluence do not want to start.

Error displayed is

```
You cannot access Confluence at present. Look at the table below to identify the reasons.Type 	Description 	Exception 	Level 	Timebootstrap 	Could not load bootstrap from environmentNo server id found. 	com.atlassian.config.bootstrap.BootstrapException: Unable to bootstrap application: Failed to parse config file: Error on line 1 of document  : Content is not allowed in prolog. Nested exception: Content is not allowed in prolog.	fatal 	2013-02-28 12:57:03This page will automatically update every 60 seconds.
```

I tried to search what's that message means, it show me this page on google :

<https://confluence.atlassian.com/display/DISC/Backup+Your+Confluence.cfg.xml>

That says the config cfg.xml file got **deleted!!??!!** and now I can't start Confluence again untill full rewrite on database ? (if no backup made...).

I see nowhere when installing that admin tip displayed anywhere, so I'm in front of this problem when it's appearing. **DON'T TELL ME ALL MY DATA IS LOST!**

Because ... We build actually a development team, and was near to order some atlassian products (and we started working on Confluence and some data are already uploaded).

If the data is lost, I will search another development solutions than atlassian for us...

config file got deleted and empty, it is a very critical problem, don't you think so ?


Answers:
author: Nic Brough -Adaptavist-
body: Um, no, it doesn't say the config has gone, and unless you've deliberately obliterated your own database (which is your own fault, not Atlassian's), your data is safe. Moving to another development solution is completely the wrong attitude because you don't know what you've broken, and without that knowledge, you could easily do the same with any other system you choose.

First, you need to find the config file in your home directory and look at what you've changed in it to break it. Is it really gone? Or did your last edit simply break it?

Second, get a database backup, just in case

Third, fix the damage in the config file and then start confluence. It will read the database, see that there is already a confluence installation in there, and it'll try to use it. The worst case is that you'll want to do a full re-index. (Unless you've scrubbed the database some other way, but you won't do that by just running confluence or re-installing it)

comments: author: eKyNoX
body: Sorry for beeing a little rude, but I am really worried about lost data. If you say nothing have been lost, it's a good news.

First I nerver touched the config file, just rebooted my server. So no changes have been done in it.

It is located at C:\\Program Files\\Atlassian\\Application Data\\Confluence\\confluence.cfg.xml

Have a size of 3ko, so not really empty.

Second, I'll make a backup of database from SQL Server Management Studio. Database looks like to be OK.

Third ... Fix the damage in config file ? How ?? Since the file content is compiled (can't open it with notepad for example) and I don't know what to put and in what way inside it.

Thanks for helping.


author: Nic Brough -Adaptavist-
body: I didn't find it rude, especially when you're worried about data loss. It's just the reaction "move to another tool" needed questioning, as whatever is stomping on Confluence is likely to do something similar to any other system.

Anyway. The config file has been changed. I've accused you of doing it, which is unfair, because it might not have been you. However, something has changed it, and left it unreadable by Confluence.

The fact you had confluence running before tells us you had a valid file when you last started confluence, so something has changed that file since the last startup. If you're not aware of the change, then you should really spend some time finding out what it was, to prevent it happening again.

But to fix it - open it in a simple text editor to begin with. While the file is "compiled", it IS simply XML. If it's not, then whatever you have that has overwritten it has broken it very badly.

If you have not got a backup from when it was last working, then you might be a bit more stuck. To fix this, I'd actually download a Confluence standalone version to my local machine, and run it up so the installer runs. Answer all the questions, and it'll generate a new clean copy for you to use as an example. Copy that over to the server, and modify the "database" connection bits.


author: eKyNoX
body: I'm not really aware of any changes since yesterday it was working perfectly, and since reboot, I got that error.

The file is xml format but unreadable! First time I could not open a xml file ...

With Firefox :

<http://img834.imageshack.us/img834/8736/90746399.png>

With Notepad++ :

<http://img826.imageshack.us/img826/4019/21576018.png>

So I can't open it, and modify it as well.

About re-install confluence and get a brand new config.xml file, did you tried that before ?

Do you know if it works ?

Do you know which type of configuration and text we much fill inside that file ?

Is it heavy ?

-------------------------------

Well I start again think data is lost...


author: Nic Brough -Adaptavist-
body: Something has definitely trashed that file. You'll need to find and prevent that in the long run.

I don't think you can do much else than delete it and try to replace it with a new generated one. I've done that a few times during upgrade testing, and once when someone had a catastrophic disk failure. It works fine if you think through the tags you'll see in a "clean" one.

It is really short too - a couple of dozen lines, many of which don't need to be changed.

As for your data loss - do not panic. As long as your database was backed up, you have all of your wiki. (Attachments can be separate - and should be backed up too)


author: eKyNoX
body: Database backed up by SQL Server Management Studio but no backup inside Confluence, did that change anything ? (in case of migrating).

About cfg file, is that not more simple someone upload me it ? somewhere ?


author: Nic Brough -Adaptavist-
body: All you need to do is point a working Confluence system at the database. As you have something that appears to be damaging your installation, I would start with a clean Confluence. The config file you have damaged is something YOU need to create - anyone else's will be useless to you because our systems are almost certainly going to be different to yours. You haven't even told us what version you're on, let alone the rest of the settings (which may vary with version)

The simple fix - download the same version of Confluence as you have in production, run the installation and answer the questions. That will give you a clean valid config file \*for your installation\* which you can copy into production


author: J.Drechsler
body: We had the same problem with one of the incubation systems here (even so we crashed our server, while working on the UPS, so we have a good guess where that came from).

Since your post guided me in the right direction, I also want to share our solution (just in case some else is also to close to the window right now).

If your server runs Windows Server 2008, with Shadow Copy enabled, try your luck with one of the copies the system made for you.

* You find them under the file properties (right click for file's context menu) and go to the last tab (in German it is called "Vorg?ngerversionen", in English maybe something like "previous versions"?).
* Right click on the latest Shadow Copy
* We used edit and copied the content to the original file, but I assume you could also just restore the old version

Took about five minutes and saved me from a minor hard attack.


author: ekynox
body: Thanks a lot. Got it hardly but works again. You rock :)