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

[semver:patch] Blocking Forever on NULL Job #89

Closed
andrew-barnett opened this issue Nov 29, 2022 · 1 comment · Fixed by #90
Closed

[semver:patch] Blocking Forever on NULL Job #89

andrew-barnett opened this issue Nov 29, 2022 · 1 comment · Fixed by #90

Comments

@andrew-barnett
Copy link
Contributor

Orb version

1.8.1

What happened

"Oldest job" and "Oldest Workflow Timestamp" are returning null, which then blocks forever. Could this possibly be related to #88?

fix/repo#3508 queueable
DEBUG: Making API Call to https://circleci.com/api/v2/me
DEBUG: API Success
Using API key for user: "xxx"
This build will block until all previous builds complete.
Max Queue Time: 10 minutes.
Only blocking execution if running previous jobs on branch: fix/repo#3508
Attempting to access CircleCI api. If the build process fails after this step, ensure your CIRCLECI_API_KEY  is set.
DEBUG: Making API Call to https://circleci.com/api/v1.1/project/github/xxx/xxx/tree/fix/repo#3508?filter=running
DEBUG: API Success
API access successful
Orb parameter block-workflow is true.
This job will block until no previous workflows have *any* jobs running.
Oldest job: null
This Workflow Timestamp: 
Oldest Workflow Timestamp: null
This build (2260) is queued, waiting for build number (null) to complete.
Total Queue time: 0 seconds.
Only blocking execution if running previous jobs on branch: fix/repo#3508
Attempting to access CircleCI api. If the build process fails after this step, ensure your CIRCLECI_API_KEY  is set.
DEBUG: Making API Call to https://circleci.com/api/v1.1/project/github/trade-platform/lib/tree/fix/repo#3508?filter=running
DEBUG: API Success
API access successful
Orb parameter block-workflow is true.
This job will block until no previous workflows have *any* jobs running.
Oldest job: null
This Workflow Timestamp: 
Oldest Workflow Timestamp: null
This build (2260) is queued, waiting for build number (null) to complete.
Total Queue time: 11 seconds.

My config.yaml looks like:

orbs:
  queue: eddiewebb/queue@1.8.1

workflows:
  version: 2
  CircleCI:
    jobs:
      - queue/block_workflow:
          time: '10'

Expected behavior

Things were working fine yesterday, but today it blocks until failure even if there is nothing else running.

@andrew-barnett
Copy link
Contributor Author

Some debugging:

curl -s -L -H "Circle-Token: xxx" -H "Content-Type: application/json" 'https://circleci.com/api/v1.1/project/github/xxx/xxx/tree/fix/repo#3508?filter=running' returns [ ], even when there is a job running on that branch.

curl -s -L -H "Circle-Token: xxx" -H "Content-Type: application/json" 'https://circleci.com/api/v1.1/project/github/xxx/xxx/tree/fix/repo%233508?filter=running' returns the full JSON of data while the job is running.

tl;dr: need to url encode the branch name; I'll put together a PR.

andrew-barnett added a commit to andrew-barnett/circleci-queue that referenced this issue Nov 29, 2022
bors bot added a commit that referenced this issue Dec 6, 2022
90: fix(urlencode): urlencode CIRCLE_BRANCH (semver:patch) r=andrew-barnett a=andrew-barnett

### Motivation, issues

The CircleCI API (started?) requiring urlencoded branch names, otherwise the calls were returning empty results. This caused the queue to never succeed. This fix urlencodes the branch name. See #89

### Description

add `urlencode` function and run `${CIRCLE_BRANCH}` through it while building branch-specific API url

fixes #89

Co-authored-by: Andrew Barnett <andrew.barnett@aixplatform.com>
@bors bors bot closed this as completed in d5fb4be Dec 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant