github-status-resource icon indicating copy to clipboard operation
github-status-resource copied to clipboard

jq error

Open kobylyanskiy opened this issue 6 years ago • 7 comments

Using the example config I'm getting the following error:

jq: error (at <stdin>:4): Cannot iterate over null (null)

I also don't want to write my own resource. Could you please verify that error or tell me if I'm doing something wrong.

kobylyanskiy avatar Nov 06 '18 17:11 kobylyanskiy

What operation is this occurring during: check, get, put? Are you sure your API token user has permissions for the repository you’re trying to edit?

dpb587 avatar Nov 07 '18 09:11 dpb587

Hi, @dpb587. Thank you for the answer. I'm trying to put status to my repo. API token is 100% right cause previously I was able to push status to that repo with a simple Go program. Basically I'm trying to do this:

plan:
    - get: builder
      params: {submodules: none}
      trigger: true
    - put: "repo-status"
      params:
        state: "pending"
        commit: "builder"  

kobylyanskiy avatar Nov 07 '18 15:11 kobylyanskiy

I don't think I have seen this error before and, unfortunately, it's not easy to debug right now. Quickly reviewing some of the code, I think this could, theoretically, occur if builder is working off a different branch than repo-status was. You might want to make sure repo-status is configured with the branch option if you're using something other than master for builder.

dpb587 avatar Dec 02 '18 14:12 dpb587

For what it's worth, the original issue might be fixed by any of:

  • https://github.com/dpb587/github-status-resource/pull/14
  • https://github.com/dpb587/github-status-resource/pull/15

aleveille avatar Jun 13 '19 20:06 aleveille

I am getting this in check

resource_types:
- name: github-status
  type: "docker-image"
  source:
    repository: "dpb587/github-status-resource"
    tag: v2.1.0
- name: github_status
  type: github-status
  source:
    branch: master
    repository: [email protected]:<repo name>.git
    access_token: ((github-access-token))
jobs:
- name: Build Master
  plan:
  - do:
   ...
  on_failure:
    put: github_status
    params: { state: failure, commit: git_master }
resource script '/opt/resource/check []' failed: exit status 5

stderr:
jq: error (at <stdin>:4): Cannot iterate over null (null)

mohsen0 avatar Aug 15 '19 12:08 mohsen0

I was also getting this error upon moving a git repo from organisation to organisation and I had forgotten to apply the changes on the resource's config.

luispabon avatar Sep 27 '19 13:09 luispabon

Having the same issue. The status gets set correctly but it still throws that error.

out of curiosity, is this repo even maintained?

f0o avatar Nov 17 '20 16:11 f0o