When working with PXF, the query might fail with an error like:
ERROR: remote component error (500) from '127.0.0.1:5888'...
Unable to read configuration for server SQLServer from
<PATH_TO_PXF_CONF>/servers/<Server_name> (libchurl.c:985) (seg0 slicel xxx.xxx.xxx.xxx:xxxx
pid=74260) (libchurl.c:985)
The PXF log (located in $PXF_CONF/logs) on the segment host will give us more detail:
java.lang.RuntimeException: Unable to read configuration for server SQLServer from /usr/local/greenplum-db/pxf_conf/servers/SQLServer
...
Caused by: [com.ctc.wstx.exc.WstxLazyException] com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character '2' (code 50) (expected a name start character)at [row,col,system-id]: [20,22,"file:/usr/local/greenplum-db/pxf_conf/servers/SQLServer/jdbc-site.xml]
at [row,col,system-id]: [20,22,"file:/usr/local/greenplum-db/pxf_conf/servers/SQLServer/jdbc-site.xml]
...Please check the XML file which reported with the error. To verify the syntax of the XML file, we can use "xmllint" utility:
# xmllint --format jdbc-site.xml
In this case, we found this line has an error:
$ xmllint --format jdbc-site.xml
jdbc-site.xml:20: parser error : xmlParseEntityRef: no name
<value>matt&2020</value>
It is because the "&" mark can not be recognized by XML file, to fix this, we need to replace the "&" with the string "&"
<value>matt&2020</value>