Jack server unable to (re)start

3,186 views
Skip to first unread message

Naveen Chaudhary

unread,
Aug 10, 2017, 12:28:58 PM8/10/17
to Android Building
I am getting the following jack-server error : 

    15:46:17 [ 16% 8051/47793] Ensure Jack server is installed and started
    15:46:17 FAILED: /bin/bash -c "(prebuilts/sdk/tools/jack-admin install-server prebuilts/sdk/tools/jack-launcher.jar prebuilts/sdk/tools/jack-server-4.8.ALPHA.jar  2>&1 || (exit 0) ) && (JACK_SERVER_VM_ARGUMENTS=\"-Dfile.encoding=UTF-8 -XX:+TieredCompilation\" prebuilts/sdk/tools/jack-admin start-server 2>&1 || exit 0 ) && (prebuilts/sdk/tools/jack-admin update server prebuilts/sdk/tools/jack-server-4.8.ALPHA.jar 4.8.ALPHA 2>&1 || exit 0 ) && (prebuilts/sdk/tools/jack-admin update jack prebuilts/sdk/tools/jacks/jack-2.28.RELEASE.jar 2.28.RELEASE || exit 47; prebuilts/sdk/tools/jack-admin update jack prebuilts/sdk/tools/jacks/jack-3.36.CANDIDATE.jar 3.36.CANDIDATE || exit 47; prebuilts/sdk/tools/jack-admin update jack prebuilts/sdk/tools/jacks/jack-4.7.BETA.jar 4.7.BETA || exit 47 )"
    15:46:17 Jack server already installed in "/srv/jenkins/.jack-server"
    15:46:17 Launching Jack server java -XX:MaxJavaStackTraceDepth=-1 -Djava.io.tmpdir=/tmp -Dfile.encoding=UTF-8 -XX:+TieredCompilation -cp /srv/jenkins/.jack-server/launcher.jar com.android.jack.launcher.ServerLauncher
    15:46:17 Jack server failed to (re)start, try 'jack-diagnose' or see Jack server log
    15:46:17 No Jack server running. Try 'jack-admin start-server'
    15:46:17 No Jack server running. Try 'jack-admin start-server'

In the `~/.jack-server/logs/*`, I am not getting any error, its all clean. I tried starting the server manually using `jack-admin start-server`, it hangs for a while (2-3 minutes) with the following line on screen : 

    Launching Jack server java -XX:MaxJavaStackTraceDepth=-1 -Djava.io.tmpdir=/tmp -Dfile.encoding=UTF-8 -XX:+TieredCompilation -cp /srv/jenkins/.jack-server/launcher.jar com.android.jack.launcher.ServerLauncher

and then fails with the same error as above. I tried re-installing and re-starting the server, still same error. I searched the whole internet but none helped. This is my 7th day trying to fix this.I am almost exhausted, so any suggestion will be appreciated.

In the `cat ~/.jack-server/logs/*`, I am getting only 4 lines : 

    02:26:19.589: INFO: com.android.jack.server.JackHttpServer: Starting jack server version: 1.3-a8 '1.3' (291201 fcd657165d2fd6dcf1bf4c3002c9c8f75383e815 by android-...@google.com)
    02:26:19.644: INFO: com.android.jack.server.JackHttpServer: Starting service connection server on /127.0.0.1:8076
    02:26:19.651: INFO: com.android.jack.server.JackHttpServer: Starting admin connection on /127.0.0.1:8077
    02:26:19.858: INFO: com.android.jack.server.JackHttpServer: Start timer

Colin Cross

unread,
Aug 10, 2017, 3:38:25 PM8/10/17
to android-...@googlegroups.com
Have you tried jack-diagnose?

We've seen problems on our build servers where a java process gets
stuck in the kernel in a way that causes all future calls to ps -ax to
hang. The jack startup tries to run ps, so the visible symptom is
jack failures. Try running ps -ax, and if that hangs, reboot to clear
the stuck process.
> --
> --
> You received this message because you are subscribed to the "Android
> Building" mailing list.
> To post to this group, send email to android-...@googlegroups.com
> To unsubscribe from this group, send email to
> android-buildi...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-building?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "Android Building" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to android-buildi...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.

Naveen Chaudhary

unread,
Aug 11, 2017, 9:57:12 AM8/11/17
to Android Building
I did try
 ps -ax

and it didn't hang for me.

I tried jack-diagnose and this is really mysterious. When I try
 $ ./jack-diagnose
for the first time, it exists with no output on the shell. Then, I did 
$ ./jack-admin start-server
and as described earlier, it hangs me for few minutes (300 seconds to be precise, this time I put log in the jack-admin and it times out everytime) and then it throws the error 
Jack server failed to (re)start, try 'jack-diagnose' or see Jack server log
Now, if I again do 
$ ./jack-diagnose
it gives me the following output on the screen
error: process ID list syntax error


Usage:
 ps
[options]


 
Try 'ps --help <simple|list|output|threads|misc|all>'
 
or 'ps --help <s|l|o|t|m|a>'
 
for additional help text.


For more details see ps(1).
Port 8077 is used by another process (pid=), please ensure to free the port or change port configuration in '/srv/jenkins/.jack-settings' and '/srv/jenkins/.jack-server/config.properties'
error
: process ID list syntax error


Usage:
 ps
[options]


 
Try 'ps --help <simple|list|output|threads|misc|all>'
 
or 'ps --help <s|l|o|t|m|a>'
 
for additional help text.


For more details see ps(1).
Port 8076 is used by another process (pid=), please ensure to free the port or change port configuration in '/srv/jenkins/.jack-settings' and '/srv/jenkins/.jack-server/config.properties'
Now, if the server failed to start, then how it occupied the ports 8076 and 8077?

Secondly, I put logs in the jack-admin code and I am getting curl code 7, until the timeout.

Naveen Chaudhary

unread,
Aug 11, 2017, 9:57:23 AM8/11/17
to Android Building
Moreover, I put more logs and I get the following output : 

Launching Jack server java -XX:MaxJavaStackTraceDepth=-1 -Djava.io.tmpdir=/tmp -Dfile.encoding=UTF-8 -XX:+TieredCompilation -cp /srv/jenkins/.jack-server/launcher.jar com.android.jack.launcher.ServerLauncher

waiting
for the server to get started
 
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 
Dload  Upload   Total   Spent    Left  Speed
 
0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (7) Failed to connect to 127.0.0.1 port 8077: No route to host
 
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 
Dload  Upload   Total   Spent    Left  Speed
 
0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (7) Failed to connect to 127.0.0.1 port 8077: No route to host
 
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 
Dload  Upload   Total   Spent    Left  Speed
 
0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (7) Failed to connect to 127.0.0.1 port 8077: No route to host
 
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 
Dload  Upload   Total   Spent    Left  Speed
 
0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (7) Failed to connect to 127.0.0.1 port 8077: No route to host
 
% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 
Dload  Upload   Total   Spent    Left  Speed
 
0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (7) Failed to connect to 127.0.0.1 port 8077: No route to host


The machines I am trying to build upon, are behind a corporate firewall. Can some proxies to port restrictions affect this in anyway? 

PS:
I am able to access internet on this machine. I did 
$ ./jack-admin kill-server
and then 
$ curl 120.0.0.1
I get 
curl: (7) Failed to connect to 127.0.0.1 port 80: No route to host
Then I did
$ curl --proxy <proxy-adress>:<port> 127.0.0.1
I got 
<HTML>
<HEAD><TITLE>Redirection</TITLE></HEAD>
<BODY><H1>Redirect</H1></BODY>




On Thursday, August 10, 2017 at 9:58:58 PM UTC+5:30, Naveen Chaudhary wrote:

Naveen Chaudhary

unread,
Aug 11, 2017, 9:57:35 AM8/11/17
to Android Building
Also, I did 
netstat -nlp

and I can see 
tcp6       0      0 127.0.0.1:8076          :::*                    LISTEN      4917/java      
tcp6      
0      0 127.0.0.1:8077          :::*                    LISTEN      4917/java

which means the server has started. The only problem seems to be the connection and thus the curl replies with error code 7.

On Thursday, August 10, 2017 at 9:58:58 PM UTC+5:30, Naveen Chaudhary wrote:
Reply all
Reply to author
Forward
0 new messages