# Mock Server returning 502

**URL:** <https://community.postman.com/t/mock-server-returning-502/82939>\
**Category:** Help Hub\
**Tags:** mockservers\
**Created:** [July 28, 2025, 5:22pm UTC](https://community.postman.com/t/mock-server-returning-502/82939 "2025-07-28T17:22:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![altimetry-pilot-3843](https://avatars.discourse-cdn.com/v4/letter/a/47e85d/32.png) [@altimetry-pilot-3843](https://community.postman.com/u/altimetry-pilot-3843)\
**Post date:** [July 28, 2025, 5:22pm UTC](https://community.postman.com/t/mock-server-returning-502/82939/1 "2025-07-28T17:22:33Z")

</div>

> **Archived topic — some details may be out of date.**  
> Mock servers built from saved collection examples are still supported. Postman now also has **code-based mocks** : JavaScript request handlers plus a `config.yaml`, stored as files in your Git repository, which you can run locally or deploy. Create one in the app, or use the Postman CLI to generate one from an OpenAPI spec, collection or dataset (`postman mock generate`) and run it (`postman mock run`). See [About mocks](https://learning.postman.com/docs/design-apis/mock-apis/mocks/overview) and [Create a mock](https://learning.postman.com/docs/design-apis/mock-apis/mocks/create-a-mock).  
> Working with an AI coding agent? The [Postman plugin](https://github.com/postmanlabs/postman-plugin) can build and run mocks for you.  
> For current help, see the [Postman docs](https://learning.postman.com/docs/), try the free [Postman tools](https://www.postman.com/tools) (no account needed), or join us on [Discord](https://discord.gg/58aNNsRBGR).

Starting today we are getting 502 errors from our mock server when it should return a 404. The url is “[https://d78f59ff-ad8e-4c34-b62b-049a4361b136.mock.pstmn.io/connect/token/responsestatuscode/404](https://d78f59ff-ad8e-4c34-b62b-049a4361b136.mock.pstmn.io/connect/token/responsestatuscode/404)”. I clicked the “Try” button and the response is “upstream connect error or disconnect/reset before headers. reset reason: protocol error”

Any ideas what the issue could be? The mock server works for the most part but randomly returns a 502.

---

<div class="post-metadata">

**Author:** ![lunar-module-geolog1](https://avatars.discourse-cdn.com/v4/letter/l/e495f1/32.png) [@lunar-module-geolog1](https://community.postman.com/u/lunar-module-geolog1)\
**Post date:** [July 31, 2025, 6:47am UTC](https://community.postman.com/t/mock-server-returning-502/82939/4 "2025-07-31T06:47:54Z")

</div>

The 502 error from your Postman mock server is likely a problem on Postman’s side, not yours. These errors are usually random and temporary. Check Postman’s status page or try again later there’s nothing you need to fix in your setup.
