Error messages (and howto resolve them)
Posted: Thu Jan 10, 2013 8:09 pm
I've installed tons of oxp's - they make an already excellent game so awesome!!! - 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)
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:
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):
Probable causes and prevention:
The BOM might get accidentally inserted by copy-pasting code, e.g. from the browser.
Background story: (for those who care )
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:
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
seemed to be wrong, since in all the other OXP's I have installed it is called
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:
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:
And after some... erm... hours of testplay 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:
EDIT: inserted "Probable causes and prevention".
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
"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
Probable causes and prevention:
The BOM might get accidentally inserted by copy-pasting code, e.g. from the browser.
(Note: This tip has been added ex post. Thanks to Eric Walch and McLane for the info! )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 )
Background story: (for those who care )
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"?>
Code: Select all
<string>EQ_MILITARY_LASER</string>
Code: Select all
<string>EQ_WEAPON_MILITARY_LASER</string>
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
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
Code: Select all
...
~/.Oolite/AddOns/Missile Analyser 1.2.oxp
~/.Oolite/AddOns/Firewasp.oxp
~/.Oolite/AddOns/Fuel Station 1.34.oxp
...