UnityRef is currently in early development. Some features may be incomplete and/or not functioning.

UNITYREF

Your Pit Stop For Solving ANYTHING in Unity

assets

[Package Manager] Fix the 502 Bad Gateway Asset Download Error

Solution

packagesnetworkingtroubleshootinginstallationpackage manager

Unity 2021.x - Unity 6.3.x

Published 28 days ago

Issue

 Developers encounter a 502 Bad Gateway error when attempting to fetch assets via the Package Manager, preventing the successful installation of your project assets.

The 502 Bad Gateway error in the Package Manager typically indicates local network interference, stale cache files, or temporary server-side outages.

Explanation

The 502 Bad Gateway error in the Package Manager occurs when Unity’s back-end servers or an intermediary proxy fails to communicate correctly. This behavior suggests that your local configuration or network environment is interrupting the connection.

  1. Close the Unity Hub and all running instances of Unity.
  2. Navigate to the local app data folder: %LOCALAPPDATA%/Unity/cache on Windows or ~/Library/Caches/Unity/ on macOS.
  3. Delete the npm and packages subfolders to clear stale metadata.
  4. Remove any existing upm-config.toml files located in your user profile directory to reset proxy settings.
  5. Restart your computer to clear any hung UnityPackageManager processes.
  6. Re-open your project and sign in to the Unity Hub to refresh your session token.

Additional Tips

  • Verify the service status at the official Unity Status page to rule out global outages.
  • Ensure your system clock is synchronized, as SSL handshake failures can manifest as the 502 Bad Gateway error.
  • If using a VPN or corporate firewall, whitelist the Unity registry domains to prevent HTTPS traffic interception.

Related Posts Haven't quite found a solution to your problem? We think these posts might help you.

Content inspired by a Unity discussion post.