We have been using the REST API for publishing our Edge add-on for a long time now. But we have been getting 502 for the past few days now. Here is the curl request and response that we are using:
curl -H "Authorization: Bearer [MASKED]" -H "Content-Type: application/zip" -X POST -T "dist.prod${APP_VERSION}-edge.zip" -v "https://api.addons.microsoftedge.microsoft.com/v1/products/[MASKED]/submissions/draft/package"
48 % Total % Received % Xferd Average Speed Time Time Time Current
49 Dload Upload Total Spent Left Speed
50 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Host api.addons.microsoftedge.microsoft.com:443 was resolved.
51* IPv6: (none)
52* IPv4: 20.72.73.155
53* Trying 20.72.73.155:443...
54* Connected to api.addons.microsoftedge.microsoft.com (20.72.73.155) port 443
55* ALPN: curl offers h2,http/1.1
56} [5 bytes data]
57* TLSv1.3 (OUT), TLS handshake, Client hello (1):
58} [512 bytes data]
59* CAfile: /etc/ssl/certs/ca-certificates.crt
60* CApath: /etc/ssl/certs
61{ [5 bytes data]
62* TLSv1.3 (IN), TLS handshake, Server hello (2):
63{ [88 bytes data]
64* TLSv1.3 (OUT), TLS change cipher, Change cipher spec (1):
65} [1 bytes data]
66* TLSv1.3 (OUT), TLS handshake, Client hello (1):
67} [512 bytes data]
68* TLSv1.3 (IN), TLS handshake, Server hello (2):
69{ [187 bytes data]
70* TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):
71{ [10 bytes data]
72* TLSv1.3 (IN), TLS handshake, Certificate (11):
73{ [3669 bytes data]
74* TLSv1.3 (IN), TLS handshake, CERT verify (15):
75{ [264 bytes data]
76* TLSv1.3 (IN), TLS handshake, Finished (20):
77{ [52 bytes data]
78* TLSv1.3 (OUT), TLS handshake, Finished (20):
79} [52 bytes data]
80* SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384 / secp384r1 / RSASSA-PSS
81* ALPN: server did not agree on a protocol. Uses default.
82* Server certificate:
83* subject: C=US; ST=WA; L=Redmond; O=Microsoft Corporation; CN=api.addons.microsoftedge.microsoft.com
84* start date: Apr 12 02:09:21 2024 GMT
85* expire date: Apr 7 02:09:21 2025 GMT
86* subjectAltName: host "api.addons.microsoftedge.microsoft.com" matched cert's "api.addons.microsoftedge.microsoft.com"
87* issuer: C=US; O=Microsoft Corporation; CN=Microsoft Azure RSA TLS Issuing CA 04
88* SSL certificate verify ok.
89* Certificate level 0: Public key type RSA (2048/112 Bits/secBits), signed using sha384WithRSAEncryption
90* Certificate level 1: Public key type RSA (4096/152 Bits/secBits), signed using sha384WithRSAEncryption
91* Certificate level 2: Public key type RSA (2048/112 Bits/secBits), signed using sha256WithRSAEncryption
92* using HTTP/1.x
93} [5 bytes data]
94> POST /v1/products/[MASKED]/submissions/draft/package HTTP/1.1
95> Host: api.addons.microsoftedge.microsoft.com
96> User-Agent: curl/8.5.0
97> Accept: /
98> Authorization: Bearer [MASKED]
99> Content-Type: application/zip
100> Content-Length: 20016674
101> Expect: 100-continue
102>
103{ [5 bytes data]
104* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
105{ [437 bytes data]
106< HTTP/1.1 100 Continue
107 0 19.0M 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0} [5 bytes data]
108* We are completely uploaded and fine
109100 19.0M 0 0 100 19.0M 0 381k 0:00:51 0:00:51 --:--:-- 0{ [5 bytes data]
110< HTTP/1.1 502 Bad Gateway
111< Content-Length: 1477
112< Content-Type: text/html
113< Request-Context: appId=[MASKED]
114< Date: Mon, 27 May 2024 06:28:14 GMT
115<
116{ [1477 bytes data]
117100 19.0M 100 1477 100 19.0M 28 380k 0:00:52 0:00:51 0:00:01 473
118<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
119<html xmlns="http://www.w3.org/1999/xhtml">
120<head>
121<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
122<title>502 - Web server received an invalid response while acting as a gateway or proxy server.</title>
123<style type="text/css">
124<!--
125body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}
126fieldset{padding:0 15px 10px 15px;}
127h1{font-size:2.4em;margin:0;color:#FFF;}
128h2{font-size:1.7em;margin:0;color:#CC0000;}
129h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;}
130#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;
131background-color:#555555;}
132#content{margin:0 0 0 2%;position:relative;}
133.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
134-->
135</style>
136</head>
137<body>
138<div id="header"><h1>Server Error</h1></div>
139<div id="content">
140 <div class="content-container"><fieldset>
141 <h2>502 - Web server received an invalid response while acting as a gateway or proxy server.</h2>
142 <h3>There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server.</h3>
143 </fieldset></div>
144</div>
145</body>
146</html>
147* Connection #0 to host api.addons.microsoftedge.microsoft.com left intact`