2017-08-02 82 views
1

我使用Laravel Forge部署了一箇舊的自定義PHP應用程序,並且有一些計劃任務失敗。我試圖從終端上運行他們和該命令wget https://app/cronjobs/get-provider-stats我得到以下輸出:504 Laravel Forge計劃任務中的網關超時錯誤

--2017-08-02 10:30:47-- https://app/cronjobs/get-provider-stats 
Resolving app (app)... 46.xxx.xxx.xxx 
Connecting to app (app)|46.xxx.xxx.xxx|:443... connected. 
HTTP request sent, awaiting response... 504 Gateway Time-out 
Retrying. 

--2017-08-02 10:31:48-- (try: 2) https://app/cronjobs/get-provider-stats 
Reusing existing connection to app:443. 
HTTP request sent, awaiting response... 200 No headers, assuming HTTP/0.9 
Length: unspecified 
Saving to: ‘get-provider-stats’ 

get-provider-stats文件中,有504網關超時HTML頁面內容。

我也查了nginx的日誌,這裏是輸出:

2017/08/02 10:32:48 [error] 4342#4342: *438 upstream timed out (110: Connection timed out) while reading response header from upstream, client: 46.xxx.xxx.xxx, server: app, request: "GET /cronjobs/get-provider-stats HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.1-fpm.sock", host: "app" 

我試圖改變PHP CLI配置如下:

max_inputution_time = 300 (from 30) 
max_input_time = 600 (from 60) 

這還沒雖然固定我的問題。任何想法我還可以嘗試什麼?

+0

請檢查nginx的配置就像fastcgi_read_timeout PARAMS。看起來你的php運行的時間比nginx想讀的時間長 - 如果我正確的做到了。 – BenRoob

+0

我在nginx config'fastcgi_read_timeout 300;'中添加了以下行:現在我收到另一個錯誤:'ERROR 502:Bad Gateway'和nginx日誌在從上游客戶端讀取響應頭時,收到以下消息:1849#1849:* 8 recv()失敗(104:由對等方重置) 46.xxx.xxx.xxx,server:app,請求:「GET/cronjobs/get-provider-stats HTTP/1.1」,上游:「fastcgi:// unix:/var/run/php/php7.1-fpm .sock:「,host:」app「' –

+0

好吧,對不起,是個假設...(你重新啓動了nginx?)也許這會有所幫助:https://serverfault.com/questions/543999/nginx-errors-recv -failed-104-connection-reset-by-peer-while-reading-respon – BenRoob

回答

0

這不是超時問題。

請重新檢查您的cron命令。

因爲它沒有得到任何迴應,它拋出504

嘗試指定的cron選項..