0

I'm trying to use the repo command which I installed via snap on Ubuntu 18.04. Most commands were working okay but when I try to run repo forall I get the follow error:

repo forall -c 'pwd'
Traceback (most recent call last):
  File "/home/user/aosp/.repo/repo/main.py", line 531, in <module>
    _Main(sys.argv[1:])
  File "/home/user/aosp/.repo/repo/main.py", line 507, in _Main
    result = repo._Run(argv) or 0
  File "/home/user/aosp/.repo/repo/main.py", line 180, in _Run
    result = cmd.Execute(copts, cargs)
  File "/home/user/aosp/.repo/repo/subcmds/forall.py", line 230, in Execute
    pool = multiprocessing.Pool(opt.jobs, InitWorker)
  File "/snap/git-repo/18/usr/lib/python2.7/multiprocessing/__init__.py", line 232, in Pool
    return Pool(processes, initializer, initargs, maxtasksperchild)
  File "/snap/git-repo/18/usr/lib/python2.7/multiprocessing/pool.py", line 138, in __init__
    self._setup_queues()
  File "/snap/git-repo/18/usr/lib/python2.7/multiprocessing/pool.py", line 234, in _setup_queues
    self._inqueue = SimpleQueue()
  File "/snap/git-repo/18/usr/lib/python2.7/multiprocessing/queues.py", line 354, in __init__
    self._rlock = Lock()
  File "/snap/git-repo/18/usr/lib/python2.7/multiprocessing/synchronize.py", line 147, in __init__
    SemLock.__init__(self, SEMAPHORE, 1, 1)
  File "/snap/git-repo/18/usr/lib/python2.7/multiprocessing/synchronize.py", line 75, in __init__
    sl = self._semlock = _multiprocessing.SemLock(kind, value, maxvalue)
OSError: [Errno 13] Permission denied

I looked into this question:

https://stackoverflow.com/questions/2009278/python-multiprocessing-permission-denied

But my /dev/shm directory seems okay:

ls -lad /dev/shm
drwxrwxrwt 2 root root 40 May 26 16:40 /dev/shm

The following commands work fine:

$ cd /dev/shm
$ touch test
$ ls -la test
-rw-rw-r-- 1 myuser myuser 0 May 26 21:00 test

Any other ideas?

Here are my repo version details:

repo version v1.12.37
       (from https://gerrit.googlesource.com/git-repo)
repo launcher version 1.23
       (from /snap/git-repo/18/bin/repo)
git version 2.12.0
Python 2.7.12 (default, Nov 19 2016, 06:48:10) 
[GCC 5.4.0 20160609]

Maybe the problem is coming from around this line of code?

https://github.com/python/cpython/blob/804fcf66559992db9d23695e501c502ab20b7712/Modules/_multiprocessing/semaphore.c#L195

When I write a sample program like so it works fine:

int main(void)
{
    const char *name = "/permission_test_semaphore";

    sem_t* sem = sem_open(name, O_CREAT | O_EXCL, 0600, 0);
    if (SEM_FAILED == sem) {
            printf("Create semaphore failed %s, errno = %d\n", name, errno);
    } else {
            printf("Created semaphore succeeded\n");
    }

    return 0;
}

So still searching...

2 Answers 2

2

Solution is do not use snap to install the repo command. Use apt instead. No idea why.

0

As an option you can open the anaconda navigator and install all from it.

  your@user$ conda activate
  (base)your@user$ conda-navigator

After that, you can create a new enviroment and then install packages from the anaconda navigator.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .