标签: http-status-code-504

为需要30分钟执行的脚本创建Web界面

我编写了一个python脚本来处理CSV文件中的一些数据.该脚本需要3到30分钟才能完成,具体取决于CSV的大小.

现在我想为此添加一个Web界面,这样我就可以从任何地方上传CSV数据文件.我写了一个基本的HTTP POST上传页面,并使用了Python的CGI模块 - 但是脚本在一段时间后才会超时.

该脚本在开始时输出HTTP标头,并在迭代CSV的每一行之后输出数据位.例如,此print语句将每30秒左右触发一次.

# at the very top, with the 'import's
print "Content-type: text/html\n\n Processing ... <br />"

# the really long loop.
for currentRecord in csvRecords:
    count = count + 1
    print "On line " + str(count) + " <br />"
Run Code Online (Sandbox Code Playgroud)

我假设浏览器会收到标题,并等待,因为它继续接收少量数据.但实际上似乎发生的事情是它根本没有收到任何数据,并且Error 504在给出带有大量行的CSV时超时.

也许在某处发生了一些缓存?从日志中,

[Wed Jan 20 16:59:09 2010] [error] [client ::1] Script timed out before returning headers: datacruncher.py, referer: http://localhost/index.htm
[Wed Jan 20 17:04:09 2010] [warn] [client ::1] Timeout waiting for output from …
Run Code Online (Sandbox Code Playgroud)

python timeout http-headers http-status-code-504

7
推荐指数
2
解决办法
3010
查看次数

504服务器错误

我正在将数据加载到文本文件中,当过程需要很长时间(大量数据)时,我得到504响应(在Fiddler中查看),显然文件无法生成.我以为我会尝试在web.config中增加会话超时,但这没有帮助.

是否有一些属性可以确定超时?

感谢任何帮助.

asp.net iis http-status-code-504

7
推荐指数
1
解决办法
8652
查看次数

Shiny App 未部署:推送存储库时出错:504 网关超时执行停止

我已经多次重新运行我的应用程序没有问题,但最近出现错误并且无法部署我的应用程序。它能够在我的本地桌面上运行,所以我知道

Preparing to deploy application...DONE
Uploading bundle for application: 1414060...DONE
Deploying bundle: 2673072 for application: 1414060 ...
Waiting for task: 676723248
 building: Parsing manifest
 building: Building image: 2919203
 building: Installing system dependencies
 building: Fetching packages
 building: Installing packages
 building: Installing files
 building: Pushing image: 2919203
Run Code Online (Sandbox Code Playgroud)

代码继续运行,直到我收到此错误消息: ################################# End Task Log ################################# Error: Unhandled Exception: Child Task 676723250 error: Unhandled Exception: Error pushing repository: received unexpected HTTP status: 504 Gateway Time-out Execution halted

感谢任何建议!

deployment timeout http-status-code-504 shiny shinydashboard

7
推荐指数
1
解决办法
380
查看次数

分析超时的Perl CGI脚本

我有一个Perl CGI应用程序,有时超时,导致它被Apache杀死,并将504 Gateway Time-out错误发送到浏览器.我试图使用NYTProf来描述这个应用程序,但我无法读取配置文件数据:

 $ nytprofhtml -f www/cgi-local/nytprof.out
Reading www/cgi-local/nytprof.out
Profile data incomplete, inflate error -5 ((null)) at end of input file, perhaps the process didn't exit cleanly or the file has been truncated  (refer to TROUBLESHOOTING in the documentation)
Run Code Online (Sandbox Code Playgroud)

我正在使用sigexit=1NYTProf选项.这是重现问题的最小CGI脚本:

#!/usr/bin/perl -d:NYTProf

sleep 1 while 1;
Run Code Online (Sandbox Code Playgroud)

perl cgi http-status-code-504 devel-nytprof

6
推荐指数
1
解决办法
536
查看次数

HTTP 错误 504:尝试阅读 reddit 评论帖子时网关超时

尝试从 reddit 获取评论的 http 时遇到错误。这发生在各种 URL 上(并非所有 URL 都带有特殊字符),这就是其中之一。在一小时的时间范围内,可能会有 1000 个或更多的请求发送到 reddit.com 域。

hdr = {"User-Agent": "My Agent"}
try:
     req = urllib2.Request("http://www.reddit.com/r/gaming/"
           "comments/1bjuee/when_pok?©mon_was_good", headers=hdr)
     htmlSource = urllib2.urlopen(req).read()
except Exception as inst:
     print inst

Output>>HTTP Error 504: Gateway Time-out
Run Code Online (Sandbox Code Playgroud)

python urllib2 reddit web-scraping http-status-code-504

5
推荐指数
1
解决办法
3万
查看次数

如果数据库服务器超时,返回HTTP 504网关超时作为响应是否合适?

在REST服务中,当应用程序等待数据库查询且无法完成客户端的请求时,返回504状态代码是否合适?

504网关超时

该服务器充当网关或代理,没有及时收到上游服务器的响应。


目前,我们只是显示一般的500错误,该错误会在用户界面中显示为一般的服务器错误。有一些实用程序可以向用户显示这是数据库超时错误(可能还会附带一些建议,以减少他们所要求的范围),因为至少如果他们与任何人联系,他们就会获得更多有用的信息负责他们的服务器。


是否有任何其他REST服务如何处理数据库超时的指针?

rest timeout http-status-code-504

5
推荐指数
1
解决办法
6533
查看次数

使用 Express API 和 ytdl 下载音频文件

我正在尝试使用该模块下载 Youtube 视频音频ytdl-corehttps://github.com/fent/node-ytdl-core)。

我使用 Express 编写了一个 API,它可以让我通过 URL 下载音频:

app.get('/api/downloadYoutubeVideo', function (req, res) {
   res.set('Content-Type', 'audio/mpeg');       

   var videoUrl = req.query.videoUrl;   
   var videoName;

   ytdl.getInfo(videoUrl, function(err, info){
        videoName = info.title.replace('|','').toString('ascii');
        res.set('Content-Disposition', 'attachment; filename=' +    videoName + '.mp3');    
   });  

   var videoWritableStream = fs.createWriteStream('C:\\test' + '\\' +   videoName); // some path on my computer (exists!)
   var videoReadableStream = ytdl(videoUrl, { filter: 'audioonly'});

   var stream = videoReadableStream.pipe(videoWritableStream);

});
Run Code Online (Sandbox Code Playgroud)

问题是,当我调用此 API 时,我从服务器收到 504 错误。

我希望能够将此下载的音频保存在本地磁盘上。

如有帮助,将不胜感激。谢谢

api node.js http-status-code-504 express

5
推荐指数
1
解决办法
6854
查看次数

无法加载资源:服务器响应状态为 504(网关超时)

我正在使用 django - python、javascript 开发一个项目。当我从视图中调用一个长时间运行的进程(耗时)大约超过 20 分钟时,该进程成功启动。我在ajax中使用加载程序来通知用户进程正在运行。该过程完成后,加载程序将停止并更改为已完成状态。

但问题是每次从进程启动 14.59 分钟后,加载程序就会停止并且状态更改为已完成。但后台运行的进程尚未完成。此后页面崩溃。过程完成后,我将结果绑定在网页中的标签下。在该标签中出现错误504(网关超时)。在 Web 控制台日志Failed to load resources: the server responds with a status of 504 (Gateway Timeout) 中,打印上述错误。如果有人知道请帮我解决这个问题。

django 在那之后会关闭连接吗?如果是这样,是否可以在 django 设置(settings.py)中提及超时。我尝试在 ajax 调用中设置超时,但返回了同样的问题。我的疑问是在 django 开发服务器上。django开发服务器是否存在超时问题?但是当我搜索这个问题时,我发现在nginx服务器中出现了相同类型的问题。django 是依赖 nginx 还是使用它?

我尝试提供有关我的问题的所有信息,如果有任何进一步的说明,请告诉我。

javascript django ajax http-status-code-504

5
推荐指数
1
解决办法
3万
查看次数

来自 IIS 服务器的 504 网关超时

我正在使用基于 IIS 的 Web 服务器,我正在使用试图从 Web 服务器获取数据的 Infor 应用程序。但是,当有大量数据并且查询运行超过 60 秒时,我会收到网关超时错误 (504)。

我在哪里设置配置增加直到说 2 分钟或 5 分钟?任何帮助,将不胜感激。

iis-7.5 http-status-code-504

5
推荐指数
1
解决办法
2万
查看次数

504网关超时错误NodeJs

我有一个托管在 DC/OS 实例中的应用程序,该应用程序查询雪花数据库并获取结果。我正在使用雪花 sdk来查询雪花数据库,我们也在流式传输我们从雪花获得的结果。

 var statement = connection.execute({
          sqlText: sql,
          complete: function (err, stmt, rows) {
    var stream = stmt.streamRows();
                  callback(err, stream, response);
}}
Run Code Online (Sandbox Code Playgroud)

但是如果查询很大并且在雪花中查询处理需要时间,我会在我的客户端收到 504 网关超时错误。虽然节点服务仍在运行,但假设我从浏览器/邮递员访问 DC/OS,我会得到 504 超时此处出错,但雪花将结果返回到我的节点服务。避免它的正确策略是什么?尽管我的节点服务仍然保持与雪花的连接并从雪花获取结果,但这是我从服务器获取到我的客户端的错误。

http node.js http-status-code-504 snowflake-cloud-data-platform

5
推荐指数
1
解决办法
2230
查看次数