trailofbits / algo

Set up a personal VPN in the cloud
https://blog.trailofbits.com/2016/12/12/meet-algo-the-vpn-that-works/
GNU Affero General Public License v3.0
28.66k stars 2.32k forks source link

Unexpected Exception, this is probably a bug: [Errno 13] Permission denied #1118

Closed broady closed 5 years ago

broady commented 6 years ago

Describe the bug

I tried running algo installer script on Raspberry Pi running Ubuntu.

Output is "Unexpected Exception, this is probably a bug: [Errno 13] Permission denied".

To Reproduce

Steps to reproduce the behavior:

  1. Install Ubuntu Core on Raspberry Pi
  2. Install classic mode
  3. Follow instructions in README.

Expected behavior

Algo installer runs without errors.

Full log

$ ./algo -vvv
ansible-playbook 2.5.2
  config file = /home/broady/algo/ansible.cfg
  configured module search path = [u'/home/broady/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /home/broady/algo/env/local/lib/python2.7/site-packages/ansible
  executable location = /home/broady/algo/env/bin/ansible-playbook
  python version = 2.7.12 (default, Dec  4 2017, 14:50:18) [GCC 5.4.0 20160609]
Using /home/broady/algo/ansible.cfg as config file
Parsed /home/broady/algo/inventory inventory source with ini pluginERROR! Unexpected Exception, this is probably a bug: [Errno 13] Permission denied
the full traceback was:

Traceback (most recent call last):
  File "/home/broady/algo/env/bin/ansible-playbook", line 118, in <module>
    exit_code = cli.run()
  File "/home/broady/algo/env/local/lib/python2.7/site-packages/ansible/cli/playbook.py", line 120, in run
    passwords=passwords)
  File "/home/broady/algo/env/local/lib/python2.7/site-packages/ansible/executor/playbook_executor.py", line 60, in __init__
    self._tqm = TaskQueueManager(inventory=inventory, variable_manager=variable_manager, loader=loader, options=options, passwords=self.passwords)
  File "/home/broady/algo/env/local/lib/python2.7/site-packages/ansible/executor/task_queue_manager.py", line 104, in __init__
    self._final_q = multiprocessing.Queue()
  File "/usr/lib/python2.7/multiprocessing/__init__.py", line 218, in Queue
    return Queue(maxsize)
  File "/usr/lib/python2.7/multiprocessing/queues.py", line 63, in __init__
    self._rlock = Lock()
  File "/usr/lib/python2.7/multiprocessing/synchronize.py", line 147, in __init__
    SemLock.__init__(self, SEMAPHORE, 1, 1)
  File "/usr/lib/python2.7/multiprocessing/synchronize.py", line 75, in __init__
    sl = self._semlock = _multiprocessing.SemLock(kind, value, maxvalue)
OSError: [Errno 13] Permission denied
Algo running on: Ubuntu 16.04.5 LTS
Created from git fork. Last commit: 4a42fbe Move to the ARM deployment schema (#1107)
Python 2.7.12
Runtime variables:
    algo_provider "local"
    algo_ondemand_cellular "False"
    algo_ondemand_wifi "False"
    algo_ondemand_wifi_exclude "_null"
    algo_local_dns "False"
    algo_ssh_tunneling "False"
    algo_windows "False"
    wireguard_enabled "True"
    dns_encryption "True"
broady commented 6 years ago

Running with sudo works.

I attached strace to the ansible-playbook process, and see this:

lstat64("/dev/shm/oZq735", 0x7e9cf938)  = -1 ENOENT (No such file or directory)
open("/dev/shm/oZq735", O_RDWR|O_CREAT|O_EXCL, 0600) = -1 EACCES (Permission denied)
write(2, "\33[0;31mERROR! Unexpected Excepti"..., 93ERROR! Unexpected Exception, this is probably a bug: [Errno 13] Permission denied

A better error message would be good.

Running sudo chown $USER /dev/shm allows me to proceed. I don't know if this is the right fix.

broady commented 6 years ago

Installation seemed to mostly work, up until...

TASK [common : Loopback for services configured] *********************************************************************************************************************************************************
changed: [localhost]
failed: [localhost] (item=systemd-networkd) => {"changed": false, "item": "systemd-networkd", "msg": "Service is in unknown state", "status": {}}
failed: [localhost] (item=systemd-resolved) => {"changed": false, "item": "systemd-resolved", "msg": "Service is in unknown state", "status": {}}
jackivanov commented 6 years ago

You didn't include the whole log from your last try

Raspberry Pi running Ubuntu

What version?

broady commented 6 years ago

It's at the bottom of the first message.

Algo running on: Ubuntu 16.04.5 LTS

Maybe systemd woes might be due to the chroot of classic mode in Ubuntu Core? I entered a shell via sudo classic, which still seems limited.

Edit: oh, I see. Maybe Ubuntu 16 is too old?

jackivanov commented 6 years ago

Ubuntu 16.04.5 LTS

We support only 18.04, sorry

broady commented 6 years ago

Can you add some detection for this requirement? It would have been good to know that I just need to get a newer Ubuntu instead of messing around for over an hour :(

Happy to file a different bug.

jackivanov commented 6 years ago

It's in the main readme actually https://github.com/trailofbits/algo#features

broady commented 6 years ago

It's in the readme and I read it, but still, I ended up installing Ubuntu 16.

I assumed that the latest version on Ubuntu's website would be compatible, but it wasn't.

In any case, can you really assume people will read through the entire README? I've worked on developer products for around 10 years. I learned early on that people don't read documentation. Products need to provide good error messages when something goes wrong.

jackivanov commented 6 years ago

All right. Some notes should be added either to the troubleshooting guide or directly to the error message. After an error occurs we need to ask the user to check if they are running the supported system and cloud providers