svccfg: couldn’t parse document

12:00 pm Solaris Admin

If you create your own smf manifests you undoubtedly have come across the “svccfg: couldn’t parse document” error. It indicates there is a fault in the xml file you are trying to parse. Unfortunately it does not provide any clues at all as to where the error lies.

Thankfully solaris also ships with the xmllint command:

# xmllint –valid ndd-nettune.xml
ndd-nettune.xml:2: I/O error : failed to load external entity “NULL”
<!DOCTYPE service_bundle SYSTEM “/usr/share/lib/xml/dtd/ service_bundle.dtd.1″>
^
ndd-nettune.xml:7: validity error : Validation failed: no DTD found !
<service_bundle type=’manifest’ name=’SUNWcsr:ndd’>
^
ndd-nettune.xml:47: parser error : Opening and ending tag mismatch: service line 9 and exec_method
</exec_method>
^
ndd-nettune.xml:75: parser error : Extra content at the end of the document
</service>

After the removal of redundant spaces and lines, and missing /> tags i tried again.

# svccfg validate ndd-nettune.xml
#

Alright, no unwanted error messages this time.

Leave a Comment

Your comment

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Please note: Comment moderation is enabled and may delay your comment. There is no need to resubmit your comment.