簡體   English   中英

GAE內部服務器錯誤URLError: <urlopen error ftp error: [Errno 110] Connection timed out>

[英]GAE Internal Server Error URLError: <urlopen error ftp error: [Errno 110] Connection timed out>

在GAE上,我想從FTP服務器上下載文件,在我的本地開發環境中,它運行良好。 但是,當應用程序在GAE上運行時,出現了錯誤。 有什么建議嗎? 謝謝你的幫助。

167.220.232.24 - - [09/Jun/2014:08:51:00 -0700] "GET /task/updateShipStatus/ HTTP/1.1" 500 10812 - "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.114 Safari/537.36" "******.appspot.com" ms=19543 cpu_ms=2274 cpm_usd=0.001214 loading_request=1 instance=00c61b117c1ae14d753986063e6a1d8ac230349b app_engine_release=1.9.5
   E 23:50:44.530 *get* '220 LR-Fairplay FTP Server ready...\r\n'

   E 23:50:44.530 *resp* '220 LR-Fairplay FTP Server ready...'

   E 23:50:44.530 *cmd* 'USER bunge2'

   E 23:50:44.530 *put* 'USER bunge2\r\n'

   E 23:50:44.530 *get* '331 User name okay, need password.\r\n'

   E 23:50:44.530 *resp* '331 User name okay, need password.'

   E 23:50:44.530 *cmd* 'PASS ********'

   E 23:50:44.530 *put* 'PASS ********\r\n'

   E 23:50:44.530 *get* '230 User logged in, proceed.\r\n'
   E 23:50:44.530 *resp* '230 User logged in, proceed.'
   E 23:50:44.530 *cmd* 'CWD ./'
   E 23:50:44.530 *put* 'CWD ./\r\n'
   E 23:50:44.530 *get* 
   E 23:50:59.896 Internal Server Error: /task/updateShipStatus/

Traceback (most recent call last):
  File "/base/data/home/runtimes/python27/python27_lib/versions/third_party/django-1.4/django/core/handlers/base.py", line 111, in get_response

    response = callback(request, *callback_args, **callback_kwargs)

  File "/base/data/home/apps/s~precise-rune-588/1.376434829982431426/googlemapapp/views.py", line 227, in updateShipStatus

    ftp.retrbinary('RETR 201406050450_combinedpositionsdata.txt', r.write, bufsize)

  File "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/ftplib.py", line 409, in retrbinary

    conn = self.transfercmd(cmd, rest)

  File "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/ftplib.py", line 371, in transfercmd

    return self.ntransfercmd(cmd, rest)[0]

  File "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/ftplib.py", line 330, in ntransfercmd

    conn = socket.create_connection((host, port), self.timeout)

  File "/base/data/home/runtimes/python27/python27_dist/lib/python2.7/socket.py", line 569, in create_connection

    raise err
error: [Errno 110] Connection timed out

   E 23:51:00.232 '250 Directory changed to /\r\n'

   E 23:51:00.232 *resp* '250 Directory changed to /'

   E 23:51:00.232 *cmd* 'TYPE I'

   E 23:51:00.232 *put* 'TYPE I\r\n'

   E 23:51:00.232 *get* '200 Type set to I.\r\n'

   E 23:51:00.232 *resp* '200 Type set to I.'

   E 23:51:00.232 *cmd* 'PASV'

   E 23:51:00.232 *put* 'PASV\r\n'

   E 23:51:00.232 *get* '227 Entering Passive Mode (216,35,233,26,7,176)\r\n'

   E 23:51:00.232 *resp* '227 Entering Passive Mode (216,35,233,26,7,176)'

   I 23:51:00.236 This request caused a new process to be started for your application, and thus caused your application code to be loaded for the first time. This request may thus take longer and use more CPU than a typical request for your application.

您可以建立出站連接,但是您將面臨許多潛在的限制。

首先

1 billing must be enabled
2. there are strict timeouts
3. some restrictions in destinations and ports.
4. And if you run this from a frontend request, then you will need to do all your work inside 60 second.
5. no inbound sockets.

至於具體的超時將需要調查。 您可能被阻止。 從理論上講,PASV ftp應該可以,但是普通的ftp不能。 我還沒有嘗試過。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM