title: Artifactory Curl -X PUT large file - 502 Bad Gateway The proxy server received an invalid response from an upstream server / 403 Bad props auth token
body: <p>Artifactory version:
  <strong>EnterpriseX license 7.15.3 rev 71503900</strong></p>
  <p>I have admin level access on the target repository. I'm trying to upload an artifact which is close to 10GB long (air-gapped .tgz) file. I'm getting the following error.</p>
  <p>When I try to upload the file using Artifactory UI (clicking Deploy button on the target repo), It  kicks me out back to login screen, while the upload says 100% complete but check-box/options for deploying artifact as &quot;bundle artifact&quot; or as per user defined &quot;Layout&quot; is not showing up, Deploy button at the bottom of that pop-up window is also grayed out.</p>
  <p>Tried curl using Access Key as per documentation here: <a href="https://www.jfrog.com/confluence/display/JFROG/Artifactory+REST+API" rel="nofollow noreferrer">https://www.jfrog.com/confluence/display/JFROG/Artifactory+REST+API</a> but it gives me an error mesg after a very long time (12-13+ hours) about <strong>502 Bad Gateway</strong>.</p>
  <p>I also tried using <strong>-x &quot;&quot;</strong> option to bypass proxy or prefixed the same command with <code>no_proxy=&quot;10.20.30.40&quot; curl ....</code> but getting the same error. Tried -u user:pass, gives same error. Artifactory settings/DB configuration has been changed to allow for more connections and longer time allotted before timeout but still getting the same error.</p>
  <p>PS: Notice that <code>0</code> under 258M in the 2nd line, i.e. line under <strong>We are completely uploaded and fine</strong> that tells me, nothing is getting uploaded.</p>
  <pre><code>$ curl -H &quot;X-JFrog-Art-Api:akfljkljkALDJALKDALKJDALKDJLASJDLAKDJALKDJALKDJALKDJALKDJALJKDLKAJFLANCMNLLgoEjcfZ-c7v58FmyaAUsJ8c0gFV6VVHp2WpvYbU7IftRyzirHEmsGJ3MRL0eZqCkyZYI_pkrcgXb3H2QcQ6RxDpbY2UYgX5AKQlrLhtb644wlBtK1VelsJ90d-6TPrr59ss-igGDhS-HUpSMAYMBl9cXQtT5hAR8Q&quot; -X PUT &quot;https://artifactory.company.com/artifactory/AlphaPipeline-PRJ-ProjectABCPipeline-Production-Local/Pipeline-release-3.0.0.tgz&quot; -T Pipeline-release-3.0.0.tgz -v
    % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                   Dload  Upload   Total   Spent    Left  Speed
    0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying 10.20.30.40...
  * TCP_NODELAY set
  * Connected to artifactory.company.com (10.20.30.40) port 443 (#0)
  * ALPN, offering h2
  * ALPN, offering http/1.1
  * Cipher selection: ALL:!EXPORT:!EXPORT40:!EXPORT56:!aNULL:!LOW:!RC4:@STRENGTH
  * successfully set certificate verify locations:
  *   CAfile: C:/tools/installed/Git/mingw64/ssl/certs/ca-bundle.crt
    CApath: none
  * TLSv1.2 (OUT), TLS header, Certificate Status (22):
  } [5 bytes data]
  * TLSv1.2 (OUT), TLS handshake, Client hello (1):
  } [512 bytes data]
  * TLSv1.2 (IN), TLS handshake, Server hello (2):
  { [76 bytes data]
  * TLSv1.2 (IN), TLS handshake, Certificate (11):
  { [4146 bytes data]
  * TLSv1.2 (IN), TLS handshake, Server key exchange (12):
  { [333 bytes data]
  * TLSv1.2 (IN), TLS handshake, Server finished (14):
  { [4 bytes data]
  * TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
  } [70 bytes data]
  * TLSv1.2 (OUT), TLS change cipher, Client hello (1):
  } [1 bytes data]
  * TLSv1.2 (OUT), TLS handshake, Finished (20):
  } [16 bytes data]
  * TLSv1.2 (IN), TLS change cipher, Client hello (1):
  { [1 bytes data]
  * TLSv1.2 (IN), TLS handshake, Finished (20):
  { [16 bytes data]
  * SSL connection using TLSv1.2 / ABCDE-RSA-AES256-GCM-SHA384
  * ALPN, server accepted to use http/1.1
  * Server certificate:
  *  subject: C=US; ST=Denver; L=Centennial; O=Spotair Technologies; CN=artifactory.company.com
  *  start date: Feb 24 20:54:47 2021 GMT
  *  expire date: Feb 24 20:54:46 2022 GMT
  *  subjectAltName: host &quot;artifactory.company.com&quot; matched cert's &quot;artifactory.company.com&quot;
  *  issuer: C=US; O=Entrust, Inc.; OU=See www.entrust.net/legal-terms; OU=(c) 2012 Entrust, Inc. - for authorized use only; CN=Entrust Certification Authority - L1K
  *  SSL certificate verify ok.
  } [5 bytes data]
  &gt; PUT /artifactory/AlphaPipeline-PRJ-ProjectABCPipeline-Production-Local/Pipeline-release-3.0.0.tgz HTTP/1.1
  &gt; Host: artifactory.company.com
  &gt; User-Agent: curl/7.60.0
  &gt; Accept: */*
  &gt; X-JFrog-Art-Api:akfljkljkALDJALKDALKJDALKDJLASJDLAKDJALKDJALKDJALKDJALKDJALJKDLKAJFLANCMNLLgoEjcfZ-c7v58FmyaAUsJ8c0gFV6VVHp2WpvYbU7IftRyzirHEmsGJ3MRL0eZqCkyZYI_pkrcgXb3H2QcQ6RxDpbY2UYgX5AKQlrLhtb644wlBtK1VelsJ90d-6TPrr59ss-igGDhS-HUpSMAYMBl9cXQtT5hAR8Q
  &gt; Content-Length: 11629208547
  &gt; Expect: 100-continue
  &gt;
  { [5 bytes data]
  &lt; HTTP/1.1 100 Continue
  } [5 bytes data]
   99 10.8G    0     0   99 10.7G      0   357M  0:00:31  0:00:30  0:00:01  258M* We are completely uploaded and fine
  100 10.8G    0     0  100 10.8G      0   239k 13:11:33 13:11:33 --:--:--     0{ [5 bytes data]
  &lt; HTTP/1.1 502 Bad Gateway
  &lt; Date: Wed, 07 Jul 2021 18:55:33 GMT
  &lt; Server: Apache/2.4.46 (Unix) OpenSSL/1.1.1k
  &lt; Content-Length: 232
  &lt; Content-Type: text/html; charset=iso-8859-1
  &lt;
  { [232 bytes data]
  100 10.8G    0   232  100 10.8G      0   239k 13:11:33 13:11:33 --:--:--    54&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DPRJ HTML 2.0//EN&quot;&gt;
  &lt;html&gt;&lt;head&gt;
  &lt;title&gt;502 Bad Gateway&lt;/title&gt;
  &lt;/head&gt;&lt;body&gt;
  &lt;h1&gt;Bad Gateway&lt;/h1&gt;
  &lt;p&gt;The proxy server received an invalid
  response from an upstream server.&lt;br /&gt;
  &lt;/p&gt;
  &lt;/body&gt;&lt;/html&gt;
  
  * Connection #0 to host artifactory.company.com left intact
  </code></pre>
  <p>Another odd/annoying thing: If I use the same API Access Key on a small file (like few KBs) then I instantly hit the following <strong>403 Bad props auth token</strong> error. If I pass another file (<strong>ex:</strong> &gt; 2MB) without changing anything in the command, it gives me the above 502 Bad Gateway error.</p>
  <pre><code>{ [824 bytes data]
  100  2576  100   824  100  1752    675   1437  0:00:01  0:00:01 --:--:--  2113{
    &quot;errors&quot; : [ {
      &quot;status&quot; : 403,
      &quot;message&quot; : &quot;Bad props auth token: apiKey=my_long_apiAccessKeyHere.&quot;
    } ]
  }
  </code></pre>
  <p><strong>PS</strong>: Related post when using Artifactory GUI to upload the file.
  <a href="https://stackoverflow.com/questions/68089204/artifactory-cant-upload-or-see-deploy-button-getting-highlighted-cant-uplo">Artifactory - Can&#39;t upload or see DEPLOY button getting highlighted - can&#39;t upload artifact .tar .tgz</a></p>