# Can't make \`buildkite-agent pipeline upload\` work on my machine

**URL:** <https://forum.buildkite.community/t/cant-make-buildkite-agent-pipeline-upload-work-on-my-machine/4312>\
**Category:** Pipelines\
**Created:** [March 20, 2025, 6:07pm UTC](https://forum.buildkite.community/t/cant-make-buildkite-agent-pipeline-upload-work-on-my-machine/4312 "2025-03-20T18:07:30Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![zenogueira](https://avatars.discourse-cdn.com/v4/letter/z/e480ec/32.png) [@zenogueira](https://forum.buildkite.community/u/zenogueira)\
**Post date:** [March 20, 2025, 6:07pm UTC](https://forum.buildkite.community/t/cant-make-buildkite-agent-pipeline-upload-work-on-my-machine/4312/1 "2025-03-20T18:07:30Z")

</div>

Hello,

I’m trying to do some tests with the `buildkite-agent pipeline upload` command locally and can’t make it work. I wanted to interact with my pipelines and agents through the command line, without having to make commits on a repo and pushing them

i have a very simple pipeline.yml:

```auto
steps:
  - command: "echo \"hello\""

```

Then I run ` buildkite-agent pipeline upload pipeline.yml` and it get these two errors:

```auto
fatal: missing job parameter. Usually this is set in the environment for a Buildkite job via BUILDKITE_JOB_ID.

and 

fatal: missing agent-access-token parameter. Usually this is set in the environment for a Buildkite job via BUILDKITE_AGENT_ACCESS_TOKEN.

```

I’ve checked the `/opt/homebrew/etc/buildkite-agent/buildkite-agent.cfg` file for the agent access token, and added some random value for the job id (also tried to use running builds ids). But I still get errors:

```auto
POST https://agent.buildkite.com/v3/jobs/0195b436-8ed4-46cf-a67c-30bbf20a6b40/pipelines?async=true: 401 Unauthorized: Invalid access token (Attempt 1/60 Retrying in 5s)

```

I’ve tried creating a new agent token, tried to understand if the agents create new env vars with these values, etc, but nothing fixes it.

I’m not sure how to make it work. Will this command only work if run in the buildkite pipelines jobs?

Thanks for your help

---

<div class="post-metadata">

**Author:** ![suma](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/suma/32/1306_2.png) [@suma](https://forum.buildkite.community/u/suma)\
**Post date:** [March 20, 2025, 6:56pm UTC](https://forum.buildkite.community/t/cant-make-buildkite-agent-pipeline-upload-work-on-my-machine/4312/2 "2025-03-20T18:56:40Z")

</div>

Hey @zenogueira 👋,

This is Suma from Buildkite support team. Thank you for reaching out to us with your question.

You cannot run `pipeline upload` command outside of a running job where the job will use the agent token to get the agent access token. So that is why when you try to run it locally, it gives you the error asking for the job ID and agent access token.

So you would not be able to run this outside a Buildkite job. If you want to validate the pipeline yaml then you can use [GitHub - buildkite/pipeline-schema: A JSON schema for Buildkite’s pipeline file format](https://github.com/buildkite/pipeline-schema)

Please let us know if you have any questions.

Thanks,  
Suma

---

<div class="post-metadata">

**Author:** ![zenogueira](https://avatars.discourse-cdn.com/v4/letter/z/e480ec/32.png) [@zenogueira](https://forum.buildkite.community/u/zenogueira)\
**Post date:** [March 20, 2025, 7:38pm UTC](https://forum.buildkite.community/t/cant-make-buildkite-agent-pipeline-upload-work-on-my-machine/4312/3 "2025-03-20T19:38:21Z")

</div>

ok, thanks for explaining.

What if i want to create a new build/pipeline and run jobs from a host/from my machine, outside of a buildkite job (but to run a new buildkite job/build/pipeline).

Is there a way to do it?

I’m not trying to validate the pipeline schema.

---

<div class="post-metadata">

**Author:** ![benmc](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/benmc/32/1159_2.png) [@benmc](https://forum.buildkite.community/u/benmc)\
**Post date:** [March 20, 2025, 10:33pm UTC](https://forum.buildkite.community/t/cant-make-buildkite-agent-pipeline-upload-work-on-my-machine/4312/4 "2025-03-20T22:33:51Z")

</div>

Hey @zenogueira 👋

There isn’t a way to run jobs locally at the moment without the API, even with a locally running agent. The scheduler would be needed to assign those jobs even where no checkout is needed.

Cheers

---

<div class="post-metadata">

**Author:** ![zenogueira](https://avatars.discourse-cdn.com/v4/letter/z/e480ec/32.png) [@zenogueira](https://forum.buildkite.community/u/zenogueira)\
**Post date:** [March 21, 2025, 12:03pm UTC](https://forum.buildkite.community/t/cant-make-buildkite-agent-pipeline-upload-work-on-my-machine/4312/5 "2025-03-21T12:03:50Z")

</div>

> [@benmc](#):
>
> The scheduler would be needed to assign those jobs even where no checkout is needed.

I’m not sure what “checkout” means.

> [@benmc](#):
>
> There isn’t a way to run jobs locally at the moment without the API, even with a locally running agent.

And can it be done with the API? Which API?

Also: I don’t necessarily need to create the jobs on my local agent, I could push the build to a cluster.

I’m trying to understand if it’s possible to create pipelines or builds from my machine/a host

---

<div class="post-metadata">

**Author:** ![stephanie.atte](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/stephanie.atte/32/1357_2.png) [@stephanie.atte](https://forum.buildkite.community/u/stephanie.atte)\
**Post date:** [March 21, 2025, 4:13pm UTC](https://forum.buildkite.community/t/cant-make-buildkite-agent-pipeline-upload-work-on-my-machine/4312/6 "2025-03-21T16:13:47Z")

</div>

Hey @zenogueira 👋,

Yes, you can create pipelines and builds from your local machine, as long as you have a valid API token and the necessary permissions.

Here are the options using the REST API

- **Create a Pipeline:** [Buildkite API Docs](https://buildkite.com/docs/apis/rest-api/pipelines#create-a-yaml-pipeline)
- **Create a Build:** [Buildkite API Docs](https://buildkite.com/docs/apis/rest-api/builds#create-a-build)

---

<div class="post-metadata">

**Author:** ![zenogueira](https://avatars.discourse-cdn.com/v4/letter/z/e480ec/32.png) [@zenogueira](https://forum.buildkite.community/u/zenogueira)\
**Post date:** [March 25, 2025, 3:35pm UTC](https://forum.buildkite.community/t/cant-make-buildkite-agent-pipeline-upload-work-on-my-machine/4312/7 "2025-03-25T15:35:59Z")

</div>

ok, got it.

Thanks for the reply 🙏

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex016/user_avatar/forum.buildkite.community/system/32/1321_2.png) [@system](https://forum.buildkite.community/u/system)\
**Post date:** [April 25, 2025, 1:36am UTC](https://forum.buildkite.community/t/cant-make-buildkite-agent-pipeline-upload-work-on-my-machine/4312/8 "2025-04-25T01:36:45Z")

</div>

Closed on April 25, 2025, 1:36am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
