1

I am running Ubuntu Desktop 16.04 on a VM and am trying to run Volttron using the standard install instructions, however I keep getting an error after the following steps:

sudo apt-get update
sudo apt-get install build-essential python-dev openssl libssl-dev libevent-dev git
git clone https://github.com/VOLTTRON/volttron
cd volttron
python bootstrap.py

My problem is with the last step python bootstrap.py. As soon as I get to this step, I get the error bootstrap.py: error: refusing to run as root to prevent potential damage. from my terminal window.

Has anyone else encountered this problem? Thoughts?

Fabien
  • 4,862
  • 2
  • 19
  • 33
Doc-Boy23
  • 11
  • 1

2 Answers2

1

That comes from this part of bootstrap.py (and this commit)

# Refuse to run as root
if not getattr(os, 'getuid', lambda: -1)():
    sys.stderr.write('%s: error: refusing to run as root to prevent '
                     'potential damage.\n' % os.path.basename(argv[0]))
    sys.exit(77)

So check if you do have a os.getuid (current process’s real user id), because getattr mentions:

If the named attribute does not exist, default is returned if provided, otherwise AttributeError is raised.

See "What is difference between os.getuid() and os.geteuid()?".
Maybe your terminal windows was launched as root. (check the output of id -a)

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
0

I had similar problem, because volttron didn't have permission to setup virtual env so I typed this:

sudo chmod -R 777 /path_of_volttron_location
Stephen Rauch
  • 47,830
  • 31
  • 106
  • 135
mieck
  • 1