# Rerunning a job triggered by a workflow fails due to missing env vars

**URL:** <https://discuss.circleci.com/t/rerunning-a-job-triggered-by-a-workflow-fails-due-to-missing-env-vars/20322>\
**Category:** Bug Reports\
**Created:** [February 27, 2018, 5:37pm UTC](https://discuss.circleci.com/t/rerunning-a-job-triggered-by-a-workflow-fails-due-to-missing-env-vars/20322 "2018-02-27T17:37:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![apenney](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/apenney/32/17899_2.png) [@apenney](https://discuss.circleci.com/u/apenney)\
**Post date:** [February 27, 2018, 5:37pm UTC](https://discuss.circleci.com/t/rerunning-a-job-triggered-by-a-workflow-fails-due-to-missing-env-vars/20322/1 "2018-02-27T17:37:37Z")

</div>

Hi,

We’re evaluating CircleCI to replace our current build system but I’ve run into a few oddities. I have a workflow, so that I can set a global context with an env var that’s required for “docker.auth”. This works fine when triggered from the workflow, but if I rerun a job that failed it immediately bombs out because the context env vars are now missing.

I would expect rerunning an individual job to retain whatever metadata/context it started with, not require me to go and find the workflow and rerun that elsewhere. At least give a warning, or block reruns of jobs triggered by workflows, as this took me a long time to figure out.

---

<div class="post-metadata">

**Author:** ![halfer](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/halfer/32/9083_2.png) [@halfer](https://discuss.circleci.com/u/halfer)\
**Post date:** [February 27, 2018, 9:32pm UTC](https://discuss.circleci.com/t/rerunning-a-job-triggered-by-a-workflow-fails-due-to-missing-env-vars/20322/2 "2018-02-27T21:32:44Z")

</div>

Can you just re-run the job from the workflow screen? I believe one gets the choice of re-running everything, or just a failed step in the workflow? I think that’s what I do, and it works for me.

Update: ah, I see you’re doing that. Fair enough! Perhaps you could add a step in the job to fail early if an env var is not present, so at least it fails quickly.

Update again: I see why you take your view, but running a job outside of the context of a workflow could be expected by some users not to inherit the properties of that workflow. I wonder if this behaviour should be a config file option, or an options panel tick?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/circleci/original/3X/5/1/511608acda8e85906e15909b57bd0a46c1dbe291.png) [@system](https://discuss.circleci.com/u/system)\
**Post date:** [June 18, 2018, 11:35am UTC](https://discuss.circleci.com/t/rerunning-a-job-triggered-by-a-workflow-fails-due-to-missing-env-vars/20322/3 "2018-06-18T11:35:31Z")

</div>


