I'm installing ONOS and following this guide: https://wiki.onosproject.org/display/ONOS/Developer+Quick+Start

I executed the command

sudo bazel build onos

This will compile and assemble the installable onos.tar.gz, which is located in the bazel-bin directory.

But I get the following error:

tar: apache-karaf-4.2.6/examples/karaf-war-example: Cannot change ownership to uid 1001, gid 1001: Invalid argument

I know some people resolved this in this page, and it has to do with CIFS: https://www.krenger.ch/blog/linux-tar-cannot-change-ownership-to-permission-denied/

They used the parameter --no-same-owner with the command tar

# tar xzf $INPUT_FOLDER/archive.tar.gz --no-same-owner -C /mnt/test-nas/[..]

The problem is, that in my case, tar is used by bazel, I'm not calling tar from the superuser, bazel is using tar and it fails. How can I fix this ?


Adding user/group to the system with the uid/gid might fix your problem. Rename foobar to bazel or whatever

Add group foobar with gid 1001

sudo groupadd -g 1001 foobar

Adding user foobar with uid 1001 without a home directory

sudo useradd -M -u 1001 -g 1001 foobar
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.