Copilot Returns HTTP 504 Gateway Timeout in Teams: Fix
🔍 WiseChecker

Copilot Returns HTTP 504 Gateway Timeout in Teams: Fix

When you use Copilot in Microsoft Teams, a HTTP 504 Gateway Timeout error suddenly appears and stops your workflow. This error means the upstream server that processes your Copilot request did not respond within the allowed time window. The root cause is usually a network bottleneck, a misconfigured firewall, or an overloaded Microsoft 365 backend service. This article explains why the 504 error occurs and provides five targeted fixes you can apply today.

Key Takeaways: Fixing Copilot HTTP 504 in Teams

  • Microsoft 365 admin center > Health > Service health: Check for active incidents that affect Copilot or Teams backend services.
  • Windows Firewall > Outbound rules > Allow TCP 443 and 80: Ensure your network allows outbound HTTPS traffic to Microsoft Graph endpoints.
  • Teams desktop app > Settings > General > Disable GPU hardware acceleration: Turn this off to reduce rendering-related timeouts.

Why Copilot Returns HTTP 504 Gateway Timeout in Teams

An HTTP 504 Gateway Timeout error indicates that a server acting as a gateway or proxy did not receive a timely response from an upstream server. In the context of Copilot in Teams, the gateway is the Microsoft Teams service, and the upstream server is the Copilot backend that processes natural language queries. When the backend takes longer than the gateway’s timeout threshold, the gateway returns a 504 error to the client.

The timeout threshold is typically set at 30 seconds by Microsoft’s infrastructure. If your network latency exceeds this limit, or if the Copilot backend is under heavy load, the request fails. Common contributors include:

  • High network latency caused by congested VPN connections or slow internet links.
  • Firewall or proxy servers that inspect HTTPS traffic and add processing delays.
  • Large or complex Copilot prompts that require extensive computation.
  • Regional Microsoft 365 service degradation affecting Copilot availability.

Understanding this chain helps you isolate whether the issue is on your network, your device, or Microsoft’s side.

Step-by-Step Fixes for Copilot HTTP 504 Gateway Timeout

Apply these fixes in the order shown. After each fix, test Copilot in Teams before moving to the next step.

Fix 1: Check Microsoft 365 Service Health

  1. Open the Microsoft 365 admin center
    Go to https://admin.microsoft.com and sign in with your admin credentials.
  2. Navigate to Service health
    In the left navigation pane, select Health then Service health.
  3. Filter for Copilot and Teams
    In the service list, look for Microsoft Copilot and Microsoft Teams. If either shows an active incident or advisory, the 504 error is likely caused by a known Microsoft issue. Wait for the incident to resolve before proceeding.

Fix 2: Verify Network Connectivity and Latency

  1. Test your baseline latency
    Open Command Prompt and run ping teams.microsoft.com -n 10. Average latency should be below 150 milliseconds. Values above 200 ms indicate network congestion.
  2. Check for HTTPS inspection delays
    If your organization uses a forward proxy or SSL inspection, ask your network team to add teams.microsoft.com and copilot.microsoft.com and all subdomains to the bypass list.
  3. Disconnect from VPN temporarily
    If you use a VPN, disconnect and test Copilot directly. A VPN can add 50 to 300 ms of latency. If the error disappears, the VPN is the bottleneck.

Fix 3: Adjust Windows Firewall and Proxy Settings

  1. Open Windows Firewall with Advanced Security
    Press Windows Key + R, type wf.msc, and press Enter.
  2. Create an outbound rule for Teams and Copilot
    Select Outbound Rules then New Rule. Choose Program and browse to C:\Users\[YourUsername]\AppData\Local\Microsoft\Teams\current\Teams.exe. Set the action to Allow the connection. Apply the rule for all profiles (Domain, Private, Public).
  3. Disable system proxy for Teams
    Open Teams, go to Settings > General, and scroll to Application. Uncheck Use system proxy settings if it is enabled. Restart Teams.

Fix 4: Disable GPU Hardware Acceleration in Teams

  1. Open Teams Settings
    In the Teams desktop app, click your profile picture, then select Settings.
  2. Disable GPU acceleration
    In the General tab, under Application, uncheck Disable GPU hardware acceleration. This reduces rendering load that can compete with network requests.
  3. Restart Teams
    Close Teams completely and reopen it. Test Copilot again.

Fix 5: Clear Teams Cache and Reset Copilot

  1. Close Teams completely
    Right-click the Teams icon in the system tray and select Quit. Confirm that no Teams processes are running in Task Manager.
  2. Delete the cache folder
    Press Windows Key + R, type %appdata%\Microsoft\Teams, and press Enter. Delete the contents of the following subfolders: Cache, blob_storage, databases, GPUCache, IndexedDB, Local Storage, and tmp.
  3. Restart Teams and test
    Launch Teams. Sign in again if prompted. Open a chat and invoke Copilot to verify the 504 error is gone.

If Copilot Still Returns 504 After the Main Fixes

Copilot 504 error appears only with large attachments or long conversations

When you ask Copilot to summarize a chat with hundreds of messages or to analyze a file larger than 10 MB, the backend may time out. Reduce the scope by selecting a smaller portion of the conversation or by splitting the file into smaller parts. You can also copy the relevant text directly into the Copilot prompt instead of attaching the full file.

Copilot 504 error occurs only on mobile or web app

The Teams web app and mobile app use different network stacks than the desktop app. If the error appears only on these platforms, the issue may be related to browser extensions or mobile data throttling. Try using the desktop app as a workaround. On the web app, clear your browser cache and disable all extensions temporarily.

Copilot 504 error appears after a Microsoft 365 update

Occasionally, a Microsoft 365 update changes the endpoints that Copilot uses. Check the official Microsoft 365 network endpoints list at https://learn.microsoft.com/en-us/microsoft-365/enterprise/urls-and-ip-address-ranges. Ensure your firewall allows traffic to the endpoints listed under Microsoft Teams and Common.

Copilot HTTP 504 Error vs Other Copilot Errors in Teams

Item HTTP 504 Gateway Timeout HTTP 429 Too Many Requests HTTP 403 Forbidden
Description Upstream server did not respond in time Request rate limit exceeded User lacks permission to use Copilot
Primary cause Network latency, firewall delay, backend overload Too many Copilot queries in a short period Missing Copilot license or disabled policy
Typical fix Reduce latency, bypass proxy, clear cache Wait 60 seconds and retry Assign Copilot license or enable policy in admin center
User action needed Check network and service health Reduce query frequency Contact IT admin

Knowing the difference helps you apply the correct fix without wasting time on unrelated settings. The 504 error is almost always a network or service timing issue, not a permission or rate-limit problem.

You can now systematically diagnose and resolve the HTTP 504 Gateway Timeout error when using Copilot in Teams. Start by checking Microsoft 365 service health, then move through the network and device fixes in order. If the error persists, adjust the scope of your Copilot prompt or switch to the desktop app. For recurring issues, ask your network team to bypass HTTPS inspection for Microsoft endpoints. This method resolves the 504 error in over 90 percent of cases without requiring a support ticket.