api-preview-docs icon indicating copy to clipboard operation
api-preview-docs copied to clipboard

Bug: New /project/project-slug/pipeline getting 404

Open eddiewebb opened this issue 6 years ago • 5 comments
trafficstars

What is the Problem?

I am seeing 404 "project not found" messages on new API endpoint

What was expected behavior?

I expected a 200/202 and listing of recent pipelines

Can you recreate it?

Yes. Using the API url in these docs, or the generated openAPI schema |

Below is curl snippets that can be used.

# i can trigger pipelines (you can too if you want
curl --request POST   --url 'https://circleci.com/api/v2/project/gh%2Feddiewebb%2Fcircleci-queue/pipeline?circle-token=minenotyours'   --header 'accept: application/json'
{"number":34,"state":"pending","id":"1ca33a79-8711-40bd-999d-e4308bab1ed3","created_at":"2019-08-06T21:24:12.143Z"}

# but not list them
curl --request GET \
  --url 'https://circleci.com/api/v2/project/gh%2Feddiewebb%2Fcircleci-queue/pipeline?circle-token=minenotyours' \
  --header 'accept: application/json'
{"message":"Project not found"}

a few other v2 project APis like checkout keys work fine as well.

eddiewebb avatar Aug 06 '19 21:08 eddiewebb

I have error even on POST requests: curl -u ${CIRCLECI_TOKEN}: -X POST "Content-Type: application/json" -H 'Content-Type: application/json' -H 'Accept: application/json' -d '{}' https://circleci.com/api/v2/project/github/Babylonpartners/Stevenson/pipeline

always results in project found message. The project is configured with pipelines.

ilyapuchka avatar Sep 03 '19 14:09 ilyapuchka

same here, opening URL in browser does yield the build history though.

andycandy-dev avatar Oct 15 '19 20:10 andycandy-dev

This sounds like you might have the wrong token. If you open the URL in the browser, it will authenticate using your session cookie (assuming you're logged in), which is why it works. I'd recommend double-checking the token you're supplying if you're getting 404s for projects that should be working.

sulami avatar Oct 16 '19 07:10 sulami

My bad, I've been trying to use Project Api token not a Personal Api Token.

andycandy-dev avatar Oct 16 '19 11:10 andycandy-dev

switched to using a personal token and still getting this error.

this EXACT api call was working two days ago and now for no obvious reason it fails.

airtonix avatar Mar 09 '21 02:03 airtonix