Page 1 of 1

Error messages (and howto resolve them)

Posted: Thu Jan 10, 2013 8:09 pm
by GGShinobi
I've installed tons of oxp's - they make an already excellent game so awesome!!! :mrgreen: - but in the log file there have been relatively many errors. I fixed most of them, but unfortunately I didn't document which and how. Until now. (Better late then never) :wink:

I intend this new topic to be a place to collect error messages (and their solutions) for which the cause might not be that easy to see, or which are a little tricky to fix.

So here is the first one: After installing Firewasp.oxp (http://wiki.alioth.net/index.php/Firewasp), I received this error message inside the Latest.log:

Code: Select all

13:46:13.651 [plist.parse.failed]: Failed to parse /home/ggshinobi/.Oolite/AddOns/Firewasp.oxp/Config/shipyard.plist as a property list.
Parse failed at line 1 (char 1) - extra data after parsed string
Error message:
"Parse failed at line 1 (char 1) - extra data after parsed string"

Reason:
The file contains a BOM ([wp]Byte order mark[/wp]), which is not expected to be here.

Quick Fix:
Remove the BOM. This can be done, for example, with vim (http://www.vim.org/) (the best editor in the universe ;-)) (or, for Windows-users, it's GUI-version, gvim):
  • Open the file with vim
  • enter :set nobomb followed by return to tell vim to remove the BOM
  • enter :wq followed by return to (w)rite the changes and (q)uit
The next time you start Oolite hold down the shift-key in order to load the changes.

Probable causes and prevention:
The BOM might get accidentally inserted by copy-pasting code, e.g. from the browser.
Eric Walch wrote:
I had sometimes errors when copying code direct from this board. On those cases, hidden characters entered the code that gave similar errors.

That type of problem can be avoided by not directly copying the text from this forum, but quote the text and copying it from the resulting window. That proofed to be always free of those hidden characters. (A tip McLane gave some time ago :) )
(Note: This tip has been added ex post. Thanks to Eric Walch and McLane for the info! :D)



Background story: (for those who care :lol:)

By inspecting the mentioned file (shipyard.plist), I noticed that the first char there must indeed have been a typo, since the line looked like this:

Code: Select all

s<?xml version="1.0" encoding="UTF-8"?>
Note the stray "s" at the beginning. So I removed it, but the error message remained. By further inspection, I saw that also the line

Code: Select all

<string>EQ_MILITARY_LASER</string>
seemed to be wrong, since in all the other OXP's I have installed it is called

Code: Select all

<string>EQ_WEAPON_MILITARY_LASER</string>
So I changed that, too, but still to no avail. I then eventually came up with the idea to check if the file is somehow "different" than other files:

Code: Select all

ggshinobi@Shinobi:~/.Oolite/AddOns/Firewasp.oxp/Config$ file *
demoships.plist: XML document text
shipdata.plist:  XML document text
shipyard.plist:  XML  document, UTF-8 Unicode (with BOM) text
Now look at this! After having found this out and learned about BOM-files, the fix was quickly found. A quick check showed that the vim-command described above worked:

Code: Select all

ggshinobi@Shinobi:~/.Oolite/AddOns/Firewasp.oxp/Config$ file *
demoships.plist: XML document text
shipdata.plist:  XML document text
shipyard.plist:  XML document text
And after some... erm... hours of testplay :lol: I can confirm that the oxp runs! Oh, and the error in Latest.log has of course disappeared, as you can see, the oxp now loads just fine:

Code: Select all

...
    ~/.Oolite/AddOns/Missile Analyser 1.2.oxp
    ~/.Oolite/AddOns/Firewasp.oxp
    ~/.Oolite/AddOns/Fuel Station 1.34.oxp
...
EDIT: inserted "Probable causes and prevention".

Re: Error messages (and howto resolve them)

Posted: Fri Jan 11, 2013 7:21 am
by Diziet Sma
GGShinobi wrote:
After installing Firewasp.oxp (http://wiki.alioth.net/index.php/Firewasp), I received this error message inside the Latest.log:
Ahh.. looking at the Wiki edit log for that page, it appears to be a very old ship (early 2007) created by Dr Nil.

That would be part of the reason for the errors.. Oolite has changed a lot since then.. It might be a good idea to let Maik know about your fix as well, so that he can update the OXP.

Good detective work, by the way!

Re: Error messages (and howto resolve them)

Posted: Fri Jan 11, 2013 7:47 am
by Eric Walch
I had sometimes errors when copying code direct from this board. On those cases, hidden characters entered the code that gave similar errors.

That type of problem can be avoided by not directly copying the text from this forum, but quote the text and copying it from the resulting window. That proofed to be always free of those hidden characters. (A tip McLane gave some time ago :) )

Re: Error messages (and howto resolve them)

Posted: Fri Jan 11, 2013 9:01 am
by GGShinobi
Diziet Sma wrote:
It might be a good idea to let Maik know about your fix as well, so that he can update the OXP.
Good idea. I sent him a PM!
Diziet Sma wrote:
Good detective work, by the way!
Oh, thank you! :lol: *flattered*

@Eric Walch: Thanks alot for the info! I edited my post accordingly! :)

Re: Error messages (and howto resolve them)

Posted: Fri Jan 11, 2013 10:26 am
by maik
Diziet Sma wrote:
GGShinobi wrote:
After installing Firewasp.oxp (http://wiki.alioth.net/index.php/Firewasp), I received this error message inside the Latest.log:
Ahh.. looking at the Wiki edit log for that page, it appears to be a very old ship (early 2007) created by Dr Nil.

That would be part of the reason for the errors.. Oolite has changed a lot since then.. It might be a good idea to let Maik know about your fix as well, so that he can update the OXP.

Good detective work, by the way!
Just to clarify: I put the original ship OXP in my box account for preservation purposes just because it was only available on oosat before. So when GGShinobi sends me the updated OXP I will replace the old version with this one.

Re: Error messages (and howto resolve them)

Posted: Fri Jan 11, 2013 11:49 am
by Diziet Sma
I had a feeling that's why it was on your Box account.. :wink: