Your browser was unable to load all of the resources. They may have been blocked by your firewall, proxy or browser configuration.
Press Ctrl+F5 or Ctrl+Shift+R to have your browser try again.

rest/builds/ failure because of the special characters #4227

seungpil.oh ·

Hello.

If description of perforce CL include special characters, a build using the CL cannot used by rest api.

We use perforce repository.
"QB build" has repository information and it includes description info.


sample.png ----------

If there are some special characters, the build rest api return fail.
restapi_failure.png

  • replies 17
  • views 3869
  • stars 0
robinshen ADMIN ·

Please switch to pipelines page and point mouse to commit info of the repository like below to see if the message is displayed correctly.

2020-04-18_13-47-29.png
seungpil.oh ·

I can see the comment on the pipeline. but rest api is failed.
It's part of P4 description
p4_description.png

And it's part of pipeline comment.
pipe_line_comment.png

robinshen ADMIN ·

Are you able to backup the database via "administration / database backup" page? If so, please send me [robin AT pmease DOT com] the backup and let me know which build is in problem.

seungpil.oh ·

I checked the xml file on the cmd window and it was no problem.
As you said, it seem the browser issue.
Thank you very much.

seungpil.oh ·

Hello. Robin.

I made a step with below script to get build info from another QBM.

groovy:
import com.pmease.quickbuild.QuickbuildException
import com.pmease.quickbuild.plugin.report.engine.util.XMLHelper

qbm = "https://qbbuildsite.net"
build_id = 123456789

def cmd = "curl -u ${vars.get("ID")}:${vars.get("PW")} " + qbm + "/rest/builds/" + build_id
XMLHelper.readXML(util.readOutput(cmd));

But it has got below error because of special characters which made by the commit info of repository

Step 'master>xml parser' is failed: java.lang.RuntimeException: org.dom4j.DocumentException: Error on line 167 of document : Character reference "&# Nested exception: Character reference "&#
    at com.google.common.base.Throwables.propagate(Throwables.java:160)
    at com.pmease.quickbuild.plugin.report.engine.util.XMLHelper.readXML(XMLHelper.java:247)
    at com.pmease.quickbuild.plugin.report.engine.util.XMLHelper$readXML.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:42)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:108)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:116)

So it has no problem in the cmd window and pipelines but "readXML" function has a issue for it.
Do you have idea to resolve this issue?

robinshen ADMIN ·

Please upgrade to QB 10.0.13 and change your code like below to see if it works:

groovy:
import com.pmease.quickbuild.QuickbuildException
import com.pmease.quickbuild.plugin.report.engine.util.XMLHelper

qbm = "https://qbbuildsite.net"
build_id = 123456789

def cmd = "curl -u ${vars.get("ID")}:${vars.get("PW")} " + qbm + "/rest/builds/" + build_id
XMLHelper.readXML(util.readOutput(cmd, "UTF-8"));
seungpil.oh ·

It does Not work.
I have updated to 10.0.13 and changed my script.
But it has same issue.

The first line of the xml is " "
and the 167 line is "<&>S 1q3.972112] 0:"

robinshen ADMIN ·

Looks like XMLHelper is not able to deal with this special character. I changed to use XPP3Reader and it works

groovy:

import org.dom4j.io.XPP3Reader

def cmd = "curl -u admin:admin http://localhost:8810/rest/builds/1"
def xml = util.readOutput(cmd, "UTF-8")
def doc = new XPP3Reader().read(xml.toCharArray())
logger.info(doc.selectNodes("//comment").get(0).getText())
thang.dv2 ·

Hello all,

We are facing an error when checkout step sync file with special file name without ASCII.
For example this file name bellow:
config_Билайн.xml
Error message:

Executing command: p4 -p *** -u *** -P ****** -c ***** -x /home**372955.txt fstat -e ***-Rs
//***/config_������.xml - no such file(s).

Please help us. Thank you so much!

thang.dv2 ·
drdt ·

I have a possibly-related problem.. I have a file in my workspace which is created during the build, also with special characters in the path name. Amusingly, it is created as part of a unit test to confirm that our database can handle files with special characters. Alas, QuickBuild cannot handle it.. when cleaning up the workspace, the cleanup step fails trying to delete the directory containing this file.

robinshen ADMIN ·

QB no longer calls p4 "fstat" command. Looks like you are on a pretty old version. Please test with latest QB version to see if the error still exists.

robinshen ADMIN ·

I tried generating some files with non-ascii names and it works fine with cleanup. Can you please reproduce this with a sample database and send to me for diagnostics?

thang.dv2 ·

Hello, we are using QB8, how about QB8? We would like you to fix this for QB8.
Currently, we are checking with QB10 but we are unable implement QB10 soon.

thang.dv2 ·

Hello, as my checking, This problem is still faced with QB10. PMEase QuickBuild, 10.0.x, 2020-07-16, COMMERCIAL LICENSE FOR SITE 'QUICKBUILD'
Error message:

Executing command: p4 -p ***** -u **** -P ****** -c **8083 describe -Ss 20273234
Change 20273234 by ***@***NOTEPC on 2020/11/17 10:52:42 *pending*
    [Title] QB test //
Shelved files ...
... //**/config_carrierid_00000_������.xml#1 add
... //**/config_carrierid_000_���ڬݬѬ۬�.xml#1 add
Executing command: p4 -p *** -u **** -P ****** -c **** -x /***/checkShelve102093459161426414.txt fstat -e 20273234 -Rs
//***/config_carrierid_00000_������.xml - no such file(s).
ERROR in fstat (create)
//***/config_carrierid_000_���ڬݬѬ۬�.xml - no such file(s).
ERROR in fstat (create)
thang.dv2 ·

Hello. as my checking...
This issue occurs because the character set of the connecting client does not support unicode.
It will work normally on Mac or Linux.
Thank you.

robinshen ADMIN ·

Is 10.0.x modified at your side? QB never calls p4 command "fstat" as shown in your error message.