fastlane: A 504 Gateway time-out error message appeared when uploading to testflight.

Hello,Last week is ok. I have been reporting errors since this week. I can upload with Xcode. I checked the answers to the questions, but didn’t find the right answers.

fastlane version: 2.102.0

Logs:

.........

[14:35:49]: ----------------------------------
[14:35:49]: --- Step: upload_to_testflight ---
[14:35:49]: ----------------------------------
[14:35:49]: Login to App Store Connect (benson.yang@priodigit.com)
[14:35:52]: Login successful
+--------------------+--------------------------------------------------------------------------------------------------+
|                                                     Lane Context                                                      |
+--------------------+--------------------------------------------------------------------------------------------------+
| DEFAULT_PLATFORM   | ios                                                                                              |
| PLATFORM_NAME      | ios                                                                                              |
| LANE_NAME          | ios uptestflight                                                                                 |
| IPA_OUTPUT_PATH    | /Users/perry/Documents/MyProject/CoBandForiOS/ImcoWatch.ipa                                      |
| DSYM_OUTPUT_PATH   | /Users/perry/Documents/MyProject/CoBandForiOS/ImcoWatch.app.dSYM.zip                             |
| XCODEBUILD_ARCHIVE | /Users/perry/Library/Developer/Xcode/Archives/2018-08-31/ImcoWatch 2018-08-31 14.33.10.xcarchive |
+--------------------+--------------------------------------------------------------------------------------------------+
[14:36:52]: <html>
<head><title>504 Gateway Time-out</title></head>
<body bgcolor="white">
<center><h1>504 Gateway Time-out</h1></center>
<hr><center>nginx</center>
</body>
</html>


+------+----------------------+-------------+
|             fastlane summary              |
+------+----------------------+-------------+
| Step | Action               | Time (in s) |
+------+----------------------+-------------+
| 1    | default_platform     | 0           |
| 2    | build_app            | 162         |
| 💥   | upload_to_testflight | 63          |
+------+----------------------+-------------+

[14:36:52]: fastlane finished with errors

Looking for related GitHub issues on fastlane/fastlane...

➡️  Version getters
    https://github.com/fastlane/fastlane/pull/504 [closed] 4 💬
    04 Feb 2017

🔗  You can ⌘ + double-click on links to open them directly in your browser.
 (Spaceship::UnexpectedResponse)stlane-2.102.0/spaceship/lib/spaceship/client.rb:602:in `parse_response': [!] <html>
<head><title>504 Gateway Time-out</title></head>
<body bgcolor="white">
<center><h1>504 Gateway Time-out</h1></center>
<hr><center>nginx</center>
</body>
</html>

	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.102.0/spaceship/lib/spaceship/tunes/tunes_client.rb:256:in `applications'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.102.0/spaceship/lib/spaceship/tunes/application.rb:67:in `all'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.102.0/spaceship/lib/spaceship/tunes/application.rb:73:in `find'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.102.0/pilot/lib/pilot/manager.rb:50:in `fetch_app_id'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.102.0/pilot/lib/pilot/manager.rb:30:in `app'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.102.0/pilot/lib/pilot/build_manager.rb:27:in `upload'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.102.0/fastlane/lib/fastlane/actions/upload_to_testflight.rb:16:in `run'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.102.0/fastlane/lib/fastlane/runner.rb:253:in `block (2 levels) in execute_action'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.102.0/fastlane/lib/fastlane/actions/actions_helper.rb:50:in `execute_action'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.102.0/fastlane/lib/fastlane/runner.rb:232:in `block in execute_action'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.102.0/fastlane/lib/fastlane/runner.rb:227:in `chdir'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.102.0/fastlane/lib/fastlane/runner.rb:227:in `execute_action'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.102.0/fastlane/lib/fastlane/runner.rb:157:in `trigger_action_by_name'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.102.0/fastlane/lib/fastlane/fast_file.rb:149:in `method_missing'
	from Fastfile:22:in `block (2 levels) in parsing_binding'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.102.0/fastlane/lib/fastlane/lane.rb:33:in `call'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.102.0/fastlane/lib/fastlane/runner.rb:49:in `block in execute'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.102.0/fastlane/lib/fastlane/runner.rb:45:in `chdir'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.102.0/fastlane/lib/fastlane/runner.rb:45:in `execute'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.102.0/fastlane/lib/fastlane/lane_manager.rb:56:in `cruise_lane'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.102.0/fastlane/lib/fastlane/command_line_handler.rb:36:in `handle'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.102.0/fastlane/lib/fastlane/commands_generator.rb:108:in `block (2 levels) in run'
	from /Library/Ruby/Gems/2.3.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:178:in `call'
	from /Library/Ruby/Gems/2.3.0/gems/commander-fastlane-4.4.6/lib/commander/command.rb:153:in `run'
	from /Library/Ruby/Gems/2.3.0/gems/commander-fastlane-4.4.6/lib/commander/runner.rb:476:in `run_active_command'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.102.0/fastlane_core/lib/fastlane_core/ui/fastlane_runner.rb:74:in `run!'
	from /Library/Ruby/Gems/2.3.0/gems/commander-fastlane-4.4.6/lib/commander/delegates.rb:15:in `run!'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.102.0/fastlane/lib/fastlane/commands_generator.rb:333:in `run'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.102.0/fastlane/lib/fastlane/commands_generator.rb:41:in `start'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.102.0/fastlane/lib/fastlane/cli_tools_distributor.rb:108:in `take_off'
	from /Library/Ruby/Gems/2.3.0/gems/fastlane-2.102.0/bin/fastlane:20:in `<top (required)>'
	from /usr/local/bin/fastlane:22:in `load'
	from /usr/local/bin/fastlane:22:in `<main>'

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 62 (22 by maintainers)

Most upvoted comments

Does everybody in this channel try to upload their build via Fastlane from behind the GFW ? 👍 YES 👎 NO

Wheee, glad we could fix it! 🚀

Please open a new issue if you have any follow up problems.

Location china, I got 504.

<html>
<head><title>504 Gateway Time-out</title></head>
<body bgcolor="white">
<center><h1>504 Gateway Time-out</h1></center>
<hr><center>nginx</center>
</body>
</html>

And fix this issues by switch on my VPN.


Emmm… 2018.09.05 I upload again. I turn on VPN, but got 504. 0.0

Tried some times, I finally upload success again.


[23:09:13]: [iTMSTransporter] 1 packages were uploaded successfully:

[23:09:13]: [iTMSTransporter] 	/var/folders/tf/zbcpj6qx6p13pj_dm_w9k1_h0000gn/T/d20180905-7774-1wekclz/1388330239.itmsp

[23:09:13]: [iTMSTransporter] [2018-09-05 23:09:13 CST] <main> DBG-X: Returning 0

[23:09:13]: iTunes Transporter output above ^
[23:09:13]: No child processes
[23:09:13]: Although errors occurred during execution of iTMSTransporter, it returned success status.
[23:09:13]: --------------------------------------------------------------------
[23:09:13]: Successfully uploaded package to App Store Connect. It might take a few minutes until it's visible online.
[23:09:13]: --------------------------------------------------------------------
[23:09:13]: Successfully uploaded the new binary to App Store Connect

My VPN node is L.A.

@janpio sorry, the tool’s link will be open after one month. And you can try deliver , it will be failed again. fatslane have many bugs, if you have interest . i can help you ,because lots of code needs to revise. i can give you a guideline, send you zip files and guideline text . meanwhile , the files give the some bug of fastlane and how to solve. sorry to make you think that is spam , i will remove my email here. sincerely.

@StevenMasini What I do is change itunesconnect.apple.com to appstoreconnect.apple.com on 2.102.0 and it works (without VPN in Shanghai or with VPN through Taiwan) . I guess the root cause is apple now rebranding itunesconnect as appstoreconnect and they have separate data center in china (the Guizhou center). Maybe there’s some differences with other data center.

Same here

get same problem,chinese

i known the reason and how to solve it! easily!

@janpio I updated this morning to Fastlane 2.103.1 which add [spaceship] use itunesconnect.com hostname when looking up itc_service_key for olympus session and I am not getting the 504 Gateway Time-out error anymore.

This issue is fixed for me, I think @snipking is probably right. Might be just a problem of re-branding from Apple and their data-center in China.

Yes, there is currently a problem caused by the changes done in 2.103.0 - so stuff is broken right now.

@chronweigle already fixed it in https://github.com/fastlane/fastlane/pull/13286 and we are currently testing and seeing if this covers all failure cases. As soon as this is confirmed, there will be a 2.103.1 release. Sorry for that.

Until then, you best do not update or downgrade again to 2.102.0

same here, vpn sometimes work, sometimes not. seems 2 b a random bug. I changed to another mac, it always works without vpn.

Awesome @samchang8826. @chronweigle has a PR over at https://github.com/fastlane/fastlane/pull/13272/files that replaces itunesconnect.apple.com with appstoreconnect.apple.com. Can you run the same commands again for that domain to confirm this domain works?

@janpio I have found the url finally.

$ dig itunesconnect.apple.com

; <<>> DiG 9.10.6 <<>> itunesconnect.apple.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 15271
;; flags: qr rd ra cd; QUERY: 1, ANSWER: 8, AUTHORITY: 0, ADDITIONAL: 1

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags: do; udp: 4096
;; QUESTION SECTION:
;itunesconnect.apple.com.	IN	A

;; ANSWER SECTION:
itunesconnect.apple.com. 996	IN	CNAME	itunesconnect-cdn.itunes-apple.com.akadns.net.
itunesconnect-cdn.itunes-apple.com.akadns.net. 996 IN CNAME itunesconnect-china.itunes-apple.com.akadns.net.
itunesconnect-china.itunes-apple.com.akadns.net. 996 IN	CNAME itunesconnect.apple.com.mwcname.com.
itunesconnect.apple.com.mwcname.com. 996 IN CNAME applewsashark.dtwscache.ourwebcdn.com.
applewsashark.dtwscache.ourwebcdn.com. 300 IN A	101.227.97.199
applewsashark.dtwscache.ourwebcdn.com. 300 IN A	125.77.132.2
applewsashark.dtwscache.ourwebcdn.com. 300 IN A	180.163.150.129
applewsashark.dtwscache.ourwebcdn.com. 300 IN A	150.138.105.9

;; Query time: 3 msec
;; SERVER: 192.168.1.1#53(192.168.1.1)
;; WHEN: Tue Sep 04 10:25:57 CST 2018
;; MSG SIZE  rcvd: 303

$ curl -vv "https://itunesconnect.apple.com/WebObjects/iTunesConnect.woa/ra/apps/manageyourapps/summary/v2"

*   Trying 125.77.132.2...
* TCP_NODELAY set
* Connected to itunesconnect.apple.com (125.77.132.2) 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: /etc/ssl/cert.pem
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Client hello (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES256-GCM-SHA384
* ALPN, server accepted to use h2
* Server certificate:
*  subject: businessCategory=Private Organization; 1.3.6.1.4.1.311.60.2.1.3=US; 1.3.6.1.4.1.311.60.2.1.2=California; serialNumber=C0806592; C=US; ST=California; L=Cupertino; O=Apple Inc.; OU=Internet Services for Quantil; CN=itunesconnect.apple.com
*  start date: May 30 00:00:00 2018 GMT
*  expire date: Mar  4 12:00:00 2019 GMT
*  subjectAltName: host "itunesconnect.apple.com" matched cert's "itunesconnect.apple.com"
*  issuer: C=US; O=DigiCert Inc; OU=www.digicert.com; CN=DigiCert SHA2 Extended Validation Server CA
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x7fd7c2800400)
> GET /WebObjects/iTunesConnect.woa/ra/apps/manageyourapps/summary/v2 HTTP/2
> Host: itunesconnect.apple.com
> User-Agent: curl/7.54.0
> Accept: */*
> 
* Connection state changed (MAX_CONCURRENT_STREAMS updated)!
< HTTP/2 504 
< server: nginx
< date: Tue, 04 Sep 2018 02:24:55 GMT
< content-type: text/html
< content-length: 176
< 
<html>
<head><title>504 Gateway Time-out</title></head>
<body bgcolor="white">
<center><h1>504 Gateway Time-out</h1></center>
<hr><center>nginx</center>
</body>
</html>
* Connection #0 to host itunesconnect.apple.com left intact

@xudong98 Thank you for removing your email. This thread should be about finding a way to fix this issue within the current toolset which is fastlane. If you have a valid solution for something in the future, we would appreciate either a comment on what is broken and how to fix it or a pull request with a solution 👌 We definitely don’t want to stop you from working on your tool and we aren’t saying your tool isn’t a valid solution but the conversation about it does not belong here if it can’t be usable right now within a fastlane context 🙃

Sent with GitHawk

@janpio ,it is not the problem of manifest, it is problem of fastlane. recently i have write my tool , my tool can solve this and meanwhile have many function which fastlane can not work

For future readers: If your “Gateway Timeout” page also includes “In read” or “Reference # 1.xyz”, you have a different problem and should look at https://github.com/fastlane/fastlane/issues/13241#issuecomment-417173817. This issue is really only about problems that manifest themselves in the exact html page mentioned above.

@janpio No, it’s not a specific nginx gateway timeout. I think you’re correct, it’s more closely related to there other issue. Thank you.

Spaceship::UnexpectedResponse: [!] <HTML><HEAD>
<TITLE>Gateway Timeout - In read </TITLE>
</HEAD><BODY>
<H1>Gateway Timeout</H1>
The proxy server did not receive a timely response from the upstream server.<P>
Reference #1.41621060.1535763522.1962aca2
</BODY></HTML>