Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No 'result' object found in conduit call #248

Open
zhangtemplar opened this issue May 7, 2018 · 2 comments
Open

No 'result' object found in conduit call #248

zhangtemplar opened this issue May 7, 2018 · 2 comments

Comments

@zhangtemplar
Copy link

Followed the tutorial to integrate the Jenkins with Phabricator, but keeping getting errors like following in Jenkins console log:

[phabricator:uberalls] No cobertura results found
com.uber.jenkins.phabricator.conduit.ConduitAPIException: No 'result' object found in conduit call: (JSONObject["result"] is not a JSONObject.) {
  "result": [],
  "error_code": null,
  "error_info": null
}
	at com.uber.jenkins.phabricator.conduit.DifferentialClient.fetchDiff(DifferentialClient.java:77)
	at com.uber.jenkins.phabricator.PhabricatorNotifier.perform(PhabricatorNotifier.java:165)
	at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
	at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:744)
	at hudson.model.AbstractBuild$AbstractBuildExecution.performAllBuildSteps(AbstractBuild.java:690)
	at hudson.model.Build$BuildExecution.post2(Build.java:186)
	at hudson.model.AbstractBuild$AbstractBuildExecution.post(AbstractBuild.java:635)
	at hudson.model.Run.execute(Run.java:1819)
	at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
	at hudson.model.ResourceController.execute(ResourceController.java:97)
	at hudson.model.Executor.run(Executor.java:429)
[phabricator:conduit] Unable to fetch differential from Conduit API
[phabricator:conduit] No 'result' object found in conduit call: (JSONObject["result"] is not a JSONObject.) {
  "result": [],
  "error_code": null,
  "error_info": null
}

The exception is raised in phabricator-jenkins-plugin/src/main/java/com/uber/jenkins/phabricator/conduit/DifferentialClient.java:

        try {
            response = query.getJSONObject("result");
        } catch (JSONException e) {
            throw new ConduitAPIException(
                    String.format("No 'result' object found in conduit call: (%s) %s",
                            e.getMessage(),
                            query.toString(2)));
        }

I tried the command echo '{"ids": [67]}' | arc call-conduit differential.querydiffs | python -mjson.tool > test.json, which generates output like:

{
    "error": null,
    "errorMessage": null,
    "response": {
        "67": {
            "authorEmail": "abc@def.com",
            "authorName": "abc",
            "bookmark": null,
            "branch": "master",
            "changes": [
...

I believe the result should be changed to response

@JacobMuchow
Copy link

JacobMuchow commented Apr 22, 2019

Been dealing with this issue trying to set things up. The issue can be a result of a few different things:

  1. Using the wrong diff ID in the conduit call (hard to do if you follow the instructions). But I found the Phab API returns and empty array [] for result if you use a diff ID that doesn't exist in your Phab database.

  2. Not having arcanist fully set up for the Jenkins slave. (this may or may not be a real issue, I didn't really fix it until I did Reject differential on build failure #3). I had to set the default config URI and install a certificate.

ssh -i some_key root@<slave_IP>
> arc set-config default <your phab URI>
> arc install-certificate

One you can run echo '{"ids": [123]}' | arc call-conduit differential.querydiffs | python -mjson.tool (with some existing diff ID) successfully, you should be good to go on that.

  1. Make sure your Jenkins bot user on Phab has access to the corresponding repo. In my case, I added it to the team that could view the repo. Until then, I always got an empty array back, no error from the conduit API.

@JacobMuchow
Copy link

This issue in particular helped me: #30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants