# 'mender-cli artifacts upload' fails occasionally with status 502 - bad gateway

**URL:** <https://hub.mender.io/t/mender-cli-artifacts-upload-fails-occasionally-with-status-502-bad-gateway/4106>\
**Category:** General Discussions\
**Created:** [September 22, 2021, 2:21pm UTC](https://hub.mender.io/t/mender-cli-artifacts-upload-fails-occasionally-with-status-502-bad-gateway/4106 "2021-09-22T14:21:51Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![manuel\_vps](https://avatars.discourse-cdn.com/v4/letter/m/a87d85/32.png) [@manuel\_vps](https://hub.mender.io/u/manuel_vps)\
**Post date:** [September 22, 2021, 2:21pm UTC](https://hub.mender.io/t/mender-cli-artifacts-upload-fails-occasionally-with-status-502-bad-gateway/4106/1 "2021-09-22T14:21:51Z")

</div>

Hello all,

uploading mender artifacts using ‘mender-cli artifacts upload’ occasionally fails with the following error:

```auto
FAILURE: artifact upload failed with status 502, reason: Bad Gateway

```

This started a few weeks ago but I don’t remember when. Didn’t report this immediately because I thought it was a temporary glitch, but want to make you aware of this now. Last time this occured was today 15:26:01 CEST. Usually I just restart the CI job and next time it succeeds.

Regards,  
Manuel

---

<div class="post-metadata">

**Author:** ![manuel\_vps](https://avatars.discourse-cdn.com/v4/letter/m/a87d85/32.png) [@manuel\_vps](https://hub.mender.io/u/manuel_vps)\
**Post date:** [November 24, 2021, 1:39pm UTC](https://hub.mender.io/t/mender-cli-artifacts-upload-fails-occasionally-with-status-502-bad-gateway/4106/2 "2021-11-24T13:39:23Z")

</div>

Hello all,

we’re still facing these issues. In the meantime, the `Bad Gateway` string got encapsulated into HTML.

```auto
FAILURE: artifact upload failed with status 502, reason: <html>
<head><title>502 Bad Gateway</title></head>
<body>
<center><h1>502 Bad Gateway</h1></center>
</body>
</html>

```

Today this occured at 14:17:52 and 14:31:37 CET (= UTC+1).

---

<div class="post-metadata">

**Author:** ![manuel\_vps](https://avatars.discourse-cdn.com/v4/letter/m/a87d85/32.png) [@manuel\_vps](https://hub.mender.io/u/manuel_vps)\
**Post date:** [November 25, 2021, 10:32am UTC](https://hub.mender.io/t/mender-cli-artifacts-upload-fails-occasionally-with-status-502-bad-gateway/4106/3 "2021-11-25T10:32:38Z")

</div>

Hello,

can provide some statistics from yesterday 2021-11-24. All times are in CET = UTC+1.

```auto
14:17:52 -- upload failed with http 502 bad gateway
14:31:37 -- upload failed with http 502 bad gateway
14:58:26 -- upload successful
15:03:17 -- upload successful
15:22:06 -- upload successful
15:25:19 -- upload failed with http 502 bad gateway
18:56:14 -- upload successful
19:01:08 -- upload successful

```

Our CI job is signing in with `mender-cli login --server "https://hosted.mender.io" --username username --password password` and uploading with `mender-cli artifacts upload --no-progress <artifact-path>`. For context, we also get a `Configuration file not found. Continuing.`, but that shouldn’t be related to the problem on hand, I guess.

What can cause such an http 502 error?

---

<div class="post-metadata">

**Author:** ![0lmi](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/0lmi/32/133_2.png) [@0lmi](https://hub.mender.io/u/0lmi)\
**Post date:** [October 24, 2022, 11:52am UTC](https://hub.mender.io/t/mender-cli-artifacts-upload-fails-occasionally-with-status-502-bad-gateway/4106/4 "2022-10-24T11:52:46Z")

</div>

My gut feeling based on the logs is that most likely it’s something with network in the CI system. As long as all required options are provided via command line parameters `Configuration file not found. Continuing.` message can be ignored. The only thing, which attracts my attention, is missing `--server` parameter in `mender-cli artifacts upload --no-progress <artifact-path>`, but `upload successful` message indicates that it’s somehow configured.

---

<div class="post-metadata">

**Author:** ![petarkalafatic](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/petarkalafatic/32/1875_2.png) [@petarkalafatic](https://hub.mender.io/u/petarkalafatic)\
**Post date:** [April 23, 2023, 3:20pm UTC](https://hub.mender.io/t/mender-cli-artifacts-upload-fails-occasionally-with-status-502-bad-gateway/4106/5 "2023-04-23T15:20:09Z")

</div>

Hi guys.  
Is this issue maybe resolved somehow?  
I have an artifact of size 6.5GB and am trying now for the 8th or 9th time to upload the artifact to the server using CLI and GUI. Each time I get status 502. Sometimes on 50%, sometimes 70%. There is no pattern in failure and there is no message of an upload limit.  
Thanks.

---

<div class="post-metadata">

**Author:** ![manuel\_vps](https://avatars.discourse-cdn.com/v4/letter/m/a87d85/32.png) [@manuel\_vps](https://hub.mender.io/u/manuel_vps)\
**Post date:** [March 19, 2024, 2:08pm UTC](https://hub.mender.io/t/mender-cli-artifacts-upload-fails-occasionally-with-status-502-bad-gateway/4106/6 "2024-03-19T14:08:25Z")

</div>

I didn’t observe this issue for quite some time now.

---

<div class="post-metadata">

**Author:** ![fred111](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/fred111/32/2318_2.png) [@fred111](https://hub.mender.io/u/fred111)\
**Post date:** [October 20, 2024, 3:28pm UTC](https://hub.mender.io/t/mender-cli-artifacts-upload-fails-occasionally-with-status-502-bad-gateway/4106/7 "2024-10-20T15:28:33Z")

</div>

Same issue here. at 50% it just returns a 502 bad gate way.

Quite strange, and now we cannot upload anything.

---

<div class="post-metadata">

**Author:** ![fred111](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/fred111/32/2318_2.png) [@fred111](https://hub.mender.io/u/fred111)\
**Post date:** [October 20, 2024, 3:29pm UTC](https://hub.mender.io/t/mender-cli-artifacts-upload-fails-occasionally-with-status-502-bad-gateway/4106/8 "2024-10-20T15:29:00Z")

</div>

Did you find a fix for this? Cannot get anything out of the logs…
