Author

Topic: Armory trying to create directories when apache invokes python script (Read 783 times)

legendary
Activity: 3766
Merit: 1364
Armory Developer
Don't mess with the permissions. This error means the auto path detection believes your blockchain data is in '/Users/me/Library/Application Support/Bitcoin/'. Apparently the user you are logged under does not have permissions to create that path.

The fix is to force your Bitcoin path with the --satoshi-datadir argument.
newbie
Activity: 3
Merit: 0
Thanks for the reply. I'll give it a shot. To continue on I've set my perms to 777 but obviously this isn't ideal.
sr. member
Activity: 255
Merit: 250
Senior Developer - Armory
Long story short, the "from armoryengine import *" line is tripping you up. I believe changing it to "from armoryengine.PyBtcWallet import PyBtcWallet" will fix your problem. I haven't tried it for myself, so you may need to experiment a bit.

Good luck.
newbie
Activity: 3
Merit: 0
I'm having an issue. Currently using a watch-only wallet on my Mac for localhost web development. Once ready I'm moving to digitalocean. I do not need the blockchain, just generating addresses. Following both Armory's github and this post:

https://bitcointalksearch.org/topic/m.1492140

I can, via command line, retrieve an address (albeit with warnings, but nothing 2> /dev/null doesn't fix):

Code:
$ python /Users/me/repos/site/api/backend/armory/getNextAddress.py /Users/me/repos/site/api/backend/armory/armory_Z52GbQJB_.watchonly.wallet
(ERROR) ArmoryUtils.py:1172 - Error getting system details:
Traceback (most recent call last):
  File "/Users/me/repos/site/api/backend/armory/armoryengine/ArmoryUtils.py", line 1170, in
    SystemSpecs = GetSystemDetails()
  File "/Users/me/repos/site/api/backend/armory/armoryengine/ArmoryUtils.py", line 1165, in GetSystemDetails
    out.HddAvailB = getHddSize(BTC_HOME_DIR)    / (1024**3)
  File "/Users/me/repos/site/api/backend/armory/armoryengine/ArmoryUtils.py", line 1162, in getHddSize
    s = os.statvfs(adir)
OSError: [Errno 2] No such file or directory: '/Users/me/Library/Application Support/Bitcoin/'
(ERROR) ArmoryUtils.py:1173 - Skipping.
13QPCfgarnbup9T5oUfMT8bTReRjSb7vJV

However, when allowing apache to execute the same python script via:

Code:
$output = shell_exec('/usr/local/bin/python ../backend/armory/getNextAddress.py ../backend/armory/armory_Z52GbQJB_.watchonly.wallet');

I receive the following error in apache's error log:

Code:
==> /var/log/apache2/error_log <==
Traceback (most recent call last):
  File "../backend/armory/getNextAddress.py", line 5, in
    from armoryengine.ALL import *
  File "/Users/me/repos/site/api/backend/armory/armoryengine/ALL.py", line 8, in
    from armoryengine.ArmoryUtils import *
  File "/Users/me/repos/site/api/backend/armory/armoryengine/ArmoryUtils.py", line 457, in
    os.makedirs(ARMORY_HOME_DIR)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 150, in makedirs
    makedirs(head, mode)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 150, in makedirs
    makedirs(head, mode)
  File "/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/Library/WebServer/Library'


I have tried:

  • adding '--datadir=pathtoarmory' to my getNextAddress.py script
  • absolute paths in my shell_exec call
  • symlinks in /var/www/html to avoid _www user from possibly needing permissions

I understand a "solution" would be to grant 777 access to /Library/WebServer, but why should I? It doesn't sound like a great answer. Why is Armory trying to make this directory? I see it does not create it when I run the same python script from command line. I set a watch for 0.1s on /Library/WebServer in case it was trying to be sneaky and create/delete like a ninja when run via command line, but no. No directory is ever created.

What's going on? How can I avoid this? All I need is the next deterministic address.

Thanks in advance.
Jump to: