ONOS build failure (no such package '@k8s_model//jar')

501 views
Skip to first unread message

aggarwala...@gmail.com

unread,
May 24, 2019, 6:54:29 AM5/24/19
to ONOS Developers
Hi,

I am trying to build ONOS from source. I followed the instructions : https://wiki.onosproject.org/display/ONOS/Developer+Quick+Start

My system configuration is :

OS                       : Ubuntu 16.04.6 LTS
JDK version         : jdk1.8.0_211
Python version     : 2.7.12
Bazel version       : 0.21.0

I tried branches : onos-2.1 and master, received the following error on both :

#bazel build onos

Starting local Bazel server and connecting to it...
INFO
: Invocation ID: c1f6d89b-303b-4bcc-acda-7749bab38f86
INFO
: Rule 'build_bazel_rules_nodejs' modified arguments {"commit": "70406e05de721520ca568a17186de73e972d7651", "shallow_since": "1551145517 -0800"} and dropped ["tag"]
INFO
: SHA256 (https://github.com/bazelbuild/rules_go/releases/download/0.16.3/rules_go-0.16.3.tar.gz) = b7a62250a3a73277ade0ce306d22f122365b513f5402222403e507f2f997d421
INFO
: SHA256 (https://github.com/bazelbuild/buildtools/archive/db073457c5a56d810e46efc18bb93a4fd7aa7b5e.zip) = e0b5b400cfef17d65886365dc7289cb4ef8dfe07066165607413a271a32aa2a4
ERROR
: Analysis of target '//:onos' failed; build aborted: no such package '@k8s_model//jar': java.io.IOException: thread interrupted
INFO
: Elapsed time: 772.484s
INFO
: 0 processes.
FAILED
: Build did NOT complete successfully (753 packages loaded, 12452 targets configured)
   
Fetching @k8s_model; fetching 168s


I tried with Bazel version 0.22.0, 0.25.3 as well, but got similar errors.

I also used the following commands :

#bazel clean --expunge

and

#bazel clean --async

But got the same error after I did #bazel build onos

Can anyone help me solve this problem please? Do let me know if any other input is needed

Regards,
Ankur Aggarwal

Percelsi Alessandro

unread,
May 24, 2019, 8:04:52 AM5/24/19
to aggarwala...@gmail.com, ONOS Developers

Hi,

Could it be related to jar command not accessible from /usr/bin or /bin?

 

I had similar behaviour with my installation of java. In my case, I installed my jdk1.8.0_212 in/opt/java. That’s what I did to resolve (don’t know if it is the best solution)

 

Add /opt/java/jdk1.8.0_212/bin to the PATH in /etc/environment

Add JAVA_HOME=”/opt/java/jdk1.8.0_212” to /etc/environment

 

make sure your JDK is properly installed and that java, javac, javadoc or jar commands are accesible from /usr/bin or /bin.

 

sudo update-alternatives --install "/usr/bin/java" "java" "/opt/java/jdk1.8.0_212/bin/java" 0

sudo update-alternatives –-config java

sudo update-alternatives --install "/usr/bin/javac" "javac" "/opt/java/jdk1.8.0_212/bin/javac" 0

sudo update-alternatives –-config javac

sudo update-alternatives --install "/usr/bin/jar" "jar" "/opt/java/jdk1.8.0_212/bin/jar" 0

sudo update-alternatives –-config jar

sudo update-alternatives --install "/usr/bin/javadoc" "javadoc" "/opt/java/jdk1.8.0_212/bin/javadoc" 0

sudo update-alternatives –-config javadoc

 

Regards,

Alessandro

 

 

__________________________________________________
cid:image001.png@01D15E53.BEA55DA0

Alessandro Percelsi
IP & Transport Innovation
Via Reiss Romoli 274, I-10148 TORINO
+39 011 2285856
+39 331 6001615
Tim Official: Facebook - Twitter
www.tim.it

--
You received this message because you are subscribed to the Google Groups "ONOS Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to onos-dev+u...@onosproject.org.
To post to this group, send email to onos...@onosproject.org.
Visit this group at https://groups.google.com/a/onosproject.org/group/onos-dev/.
To view this discussion on the web visit https://groups.google.com/a/onosproject.org/d/msgid/onos-dev/c38bbb1b-f349-4992-8fda-8b80e08ff006%40onosproject.org.

Questo messaggio e i suoi allegati sono indirizzati esclusivamente alle persone indicate. La diffusione, copia o qualsiasi altra azione derivante dalla conoscenza di queste informazioni sono rigorosamente vietate. Qualora abbiate ricevuto questo documento per errore siete cortesemente pregati di darne immediata comunicazione al mittente e di provvedere alla sua distruzione, Grazie.

This e-mail and any attachments is confidential and may contain privileged information intended for the addressee(s) only. Dissemination, copying, printing or use by anybody else is unauthorised. If you are not the intended recipient, please delete this message and any attachments and advise the sender by return e-mail, Thanks.

Rispetta l'ambiente. Non stampare questa mail se non è necessario.

Ankur Aggarwal

unread,
May 26, 2019, 11:33:56 PM5/26/19
to ONOS Developers, aggarwala...@gmail.com, alessandr...@telecomitalia.it
I have java installed at /usr/lib/jvm/jdk1.8.0_211. Even after following your steps, I am receiving the same error:

# update-alternatives --list java
/usr/lib/jvm/jdk1.8.0_211/bin/java
# update-alternatives --list javac
/usr/lib/jvm/jdk1.8.0_211/bin/javac
# update-alternatives --list jar
/usr/lib/jvm/jdk1.8.0_211/bin/jar
# update-alternatives --list javadoc
/usr/lib/jvm/jdk1.8.0_211/bin/javadoc
#bazel build onos
INFO
: Invocation ID: 6a2ae5ab-ebdb-4cc5-b3b6-11e1d376377d

ERROR
: Analysis of target '//:onos' failed; build aborted: no such package '@k8s_model//jar': java.io.IOException:
thread interrupted
INFO
: Elapsed time: 198.734s

INFO
: 0 processes.
FAILED
: Build did NOT complete successfully (753 packages loaded, 12452 targets configured)

   
Fetching @k8s_model; fetching 160s


Is k8s_model a critical dependency? Is there a way to manually download it and not fetch it using bazel?

Best Regards,
Ankur Aggarwal

Amit M

unread,
Jun 3, 2019, 8:52:08 AM6/3/19
to onos...@onosproject.org, aggarwala...@gmail.com, alessandr...@telecomitalia.it
All,

I am also facing same error while building onos from master branch on Ubuntu 16.04.6. I am using bazel version 0.23.2.

ERROR: /root/onos/apps/k8s-networking/BUILD:16:1: no such package '@k8s_model//jar': java.io.IOException: thread interrupted and referenced by '//apps/k8s-networking:onos-apps-k8s-networking-oar'
ERROR: Analysis of target '//:onos' failed; build aborted: no such package '@k8s_model//jar': java.io.IOException: thread interrupted
INFO: Elapsed time: 162.832s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (1 packages loaded, 2 targets configured)
    Fetching @k8s_model; fetching 160s

I had installed JDK as per steps mentioned in: https://wiki.onosproject.org/display/ONOS/Installing+required+tools.

for JavaCommand in java jar java2groovy javac javadoc javafxpackager javah javap javapackager javaws
do
    sudo update-alternatives --install /usr/bin/$JavaCommand $JavaCommand /root/jdk1.8.0_211/bin/$JavaCommand 1
done

Only for java2groovy, following error was there:
update-alternatives: error: alternative path /root/jdk1.8.0_211/bin/java2groovy doesn't exist


Please let me know me know if there is any solution/workaround to solve this compilation issue.

Regards,
Amit

To unsubscribe from this group and stop receiving emails from it, send an email to onos...@onosproject.org.

Amit M

unread,
Jun 6, 2019, 2:20:53 AM6/6/19
to ONOS Developers, aggarwala...@gmail.com, alessandr...@telecomitalia.it
All,

I am able to build ONOS 2.1.0 with the following changes:

  • Use Ubuntu 16.04 Desktop version instead of Ubuntu 16.04 Server version (earlier I was using Server version).
  • Build needs to be made as a non-root user.
Though I am not sure at this moment that what packages in desktop version are causing build to proceed successfully. If somebody has any clue, then please shed some light.

Regards,
Amit

osman...@gmail.com

unread,
Jun 7, 2019, 11:33:52 AM6/7/19
to ONOS Developers, aggarwala...@gmail.com, alessandr...@telecomitalia.it
Hi Amit,

You used buck or bazel to build the ONOS, also please can you list out any other tools you installed.

Thank You.
Reply all
Reply to author
Forward
0 new messages