Node.js Jenkins服务在NodeJS构建过程中完全停止,在Ubuntu上获得一个带有nginx设置的502坏网关

Node.js Jenkins服务在NodeJS构建过程中完全停止,在Ubuntu上获得一个带有nginx设置的502坏网关,node.js,ubuntu,nginx,jenkins,Node.js,Ubuntu,Nginx,Jenkins,我已经在UbuntuVPS上安装了Jenkins,我正在做一个nodejs构建,在某个时候会触发nginx中的502坏网关,Jenkis服务停止 构建似乎在随机时间停止,有时是在安装npm模型时,有时是在使用gulp时,等等 我必须手动重新启动它(sudo服务jenkins restart) 以下是生成的控制台输出: + jspm -v 0.16.15 Running against local jspm install. [workspace] $ /bin/sh -xe /tmp/hudso

我已经在UbuntuVPS上安装了Jenkins,我正在做一个nodejs构建,在某个时候会触发nginx中的502坏网关,Jenkis服务停止

构建似乎在随机时间停止,有时是在安装npm模型时,有时是在使用gulp时,等等

我必须手动重新启动它(sudo服务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_参数 nano
/etc/default/jenkins
JAVA_ARGS=“-Xmx256m”

这对我很有效。

我在Ubuntu服务器上也遇到了同样的问题。我必须在中更改JAVA_ARGS值

/etc/default/jenkins

致:


react生成之前
进程停止抛出502网关错误消息。这是关于Jenkins 2.263.4的

你能解决你的问题吗?我也遇到了同样的问题。可能是因为您的服务器使用了太多的RAM而终止了进程?是否有人对此进行了更新?现在我在react项目中遇到了同样的问题。当Jenkins开始执行“npm构建”步骤时,它会卡在那里,当我尝试刷新或单击Jenkins页面中的其他链接时,它会显示来自nginx的502坏网关错误。我从其他渠道尝试了很多方法,包括超时和增加内存。@JoeLewis-你在这方面运气好吗?我还有一个react项目,在“npm构建”步骤中得到了同样的结果。。。如有任何建议/意见,将不胜感激:)
JAVA_ARGS="-Xmx128m"