# Job failed even with "CircleCI received exit code 0"

**URL:** <https://discuss.circleci.com/t/job-failed-even-with-circleci-received-exit-code-0/50202>\
**Category:** Build Environment\
**Created:** [January 12, 2024, 11:05am UTC](https://discuss.circleci.com/t/job-failed-even-with-circleci-received-exit-code-0/50202 "2024-01-12T11:05:22Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![benoittgt](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/benoittgt/32/11580_2.png) [@benoittgt](https://discuss.circleci.com/u/benoittgt)\
**Post date:** [January 12, 2024, 11:05am UTC](https://discuss.circleci.com/t/job-failed-even-with-circleci-received-exit-code-0/50202/1 "2024-01-12T11:05:22Z")

</div>

Hello

I have a small job defined like this

```auto
          command: |
            export CONNECT_TO_KUBE=1
            python3 -m training.kube.<< parameters.script >>

```

The step on CircleCI show code wrapped with bash an proper “piping” and attributes

```auto
#!/bin/bash -eo pipefail
export CONNECT_TO_KUBE=1
python3 -m training.kube.pipelines

```

The step failed but output show `exit status 0`

```auto
2024-01-11 15:54:45,832 :: training.kube.create :: INFO :: Creating new experiment for master...
2024-01-11 15:54:45,860 :: training.kube.create :: INFO :: Experiment already exists for master, doing nothing!
CircleCI received exit code 0

```

---

<div class="post-metadata">

**Author:** ![benoittgt](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/benoittgt/32/11580_2.png) [@benoittgt](https://discuss.circleci.com/u/benoittgt)\
**Post date:** [January 12, 2024, 11:07am UTC](https://discuss.circleci.com/t/job-failed-even-with-circleci-received-exit-code-0/50202/2 "2024-01-12T11:07:48Z")

</div>

I think the answer is here [https://support.circleci.com/hc/en-us/articles/115015733328-Step-Should-Fail-but-Job-Finished-Successfully](https://support.circleci.com/hc/en-us/articles/115015733328-Step-Should-Fail-but-Job-Finished-Successfully)

~~I am gonna make a test.~~

It doesn’t change anything. I opened a support ticket.

---

<div class="post-metadata">

**Author:** ![rit1010](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/rit1010/32/34738_2.png) [@rit1010](https://discuss.circleci.com/u/rit1010)\
**Post date:** [January 15, 2024, 9:55am UTC](https://discuss.circleci.com/t/job-failed-even-with-circleci-received-exit-code-0/50202/3 "2024-01-15T09:55:52Z")

</div>

One question.

What status code do you expect kube.create to return in this situation?

The reason for asking is that the log shows that kube.create is just treating the issue as an INFO level issue when logging, which for most systems would not be a cause of a non-zero error status.

---

<div class="post-metadata">

**Author:** ![benoittgt](https://sea2.discourse-cdn.com/circleci/user_avatar/discuss.circleci.com/benoittgt/32/11580_2.png) [@benoittgt](https://discuss.circleci.com/u/benoittgt)\
**Post date:** [January 22, 2024, 11:18am UTC](https://discuss.circleci.com/t/job-failed-even-with-circleci-received-exit-code-0/50202/4 "2024-01-22T11:18:54Z")

</div>

> [@rit1010](#):
>
> What status code do you expect kube.create to return in this situation?

The status is correct. The thing I do not understand is why the job is marked as failed.
