簡體   English   中英

Jenkins 服務在節點 js 構建期間完全停止,在 Ubuntu 上使用 nginx 設置獲得 502 錯誤網關

[英]Jenkins service stops completely during a node js build, getting a 502 bad gateway with an nginx setup on Ubuntu

我已經在 Ubuntu VPS 上安裝了 Jenkins 並且我正在構建 nodejs,這在某些時候會觸發 nginx 中的 502 錯誤網關並且 Jenkis 服務停止。

構建似乎隨機停止,有時在安裝 npm 模型時,有時在使用 gulp 等時。

我必須手動重新啟動它(sudo service jenkins restart)。

這是構建的控制台輸出:

+ jspm -v
0.16.15
Running against local jspm install.
[workspace] $ /bin/sh -xe /tmp/hudson1116016846111302145.sh
+ jspm install
     Looking up npm:babel-core
     Looking up npm:babel-runtime
     Looking up npm:core-js
     Updating registry cache...
ok   Up to date - babel as npm:babel-core@^5.8.24 (5.8.34)
     Looking up github:jspm/nodelibs-fs
     Looking up github:jspm/nodelibs-path
     Looking up github:jspm/nodelibs-process
     Looking up github:systemjs/plugin-json
     Looking up npm:process
     Looking up npm:path-browserify
     Looking up github:jspm/nodelibs-assert
     Looking up npm:assert
     Looking up npm:util
     Looking up npm:inherits
     Looking up github:jspm/nodelibs-util
ok   Up to date - core-js as npm:core-js@^1.1.4 (1.2.6)
ok   Up to date - babel-runtime as npm:babel-runtime@^5.8.24 (5.8.34)
ok   Install tree has no forks.

ok   Install complete.
[workspace] $ /bin/sh -xe /tmp/hudson4025483240884121474.sh
+ npm run build
> dxx-app@1.0.0 build /var/lib/jenkins/jobs/dxx-app/workspace
> gulp build

[15:31:11] Using gulpfile ~/jobs/dxx-app/workspace/gulpfile.js
[15:31:11] Starting 'build'...
[15:31:11] Starting 'clean'...
[15:31:11] Finished 'clean' after 19 ms
[15:31:11] Starting 'jspm-build'...
[15:31:11] Starting 'copy-assets'...
[15:31:11] Starting 'copy-fonts'...
[15:31:11] Starting 'less'...
[15:31:11] Finished 'copy-assets' after 226 ms
[15:31:12] Finished 'less' after 191 ms
[15:31:12] Finished 'copy-fonts' after 213 ms

502 Bad Gateway

nginx/1.4.6 (Ubuntu)

問題是,當 Jenkis 失敗時,它不會在我的構建日志中記錄任何內容,所以我不知道發生了什么。

我在網上看到你應該從 nginx.conf 增加超時,所以我在配置文件中添加了以下內容:

http {

        ##
        # Increased timeout to fix 502 bad gateway error
        ##
        fastcgi_buffers 800 10006k;
        fastcgi_buffer_size 1000k;
        fastcgi_connect_timeout 999999;
        fastcgi_send_timeout 999999;
        fastcgi_read_timeout 999999;


Also, in nginx, sites-available, I have the following configuration:




server {
        listen 80;
        server_name jenkins.domain.com;

        ignore_invalid_headers off;

        location / {
                proxy_set_header        Host $host;
                proxy_set_header        X-Real-IP $remote_addr;
                proxy_set_header        X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header        X-Forwarded-Proto $scheme;
                proxy_pass              http://127.0.0.1:8080;
                proxy_connect_timeout   999999999999;
                proxy_send_timeout      999999999999;
                proxy_read_timeout      999999999999;
        }
}

你有什么想法?

該線程中所述,您可以增加/etc/default/jenkins中的內存,您可以在其中調整以下標志

JAVA_ARGS="-Xmx256m" # Choose your desired memory instead of 256

我在 Ubuntu 服務器中遇到了同樣的問題。 我更新了 JAVA_ARGS nano /etc/default/jenkins JAVA_ARGS="-Xmx256m"它對我JAVA_ARGS="-Xmx256m"

我在 Ubuntu 服務器上遇到了同樣的問題。 我不得不改變 JAVA_ARGS 值

/etc/default/jenkins

到:

JAVA_ARGS="-Xmx128m"

react build過程停止拋出 502 網關錯誤消息之前。 這是在 Jenkins 2.263.4 上

暫無
暫無

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

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