Setting default wallet failing

#1

For the purposes of completing a past task, I’ve created a wallet called sigmoidbell-wallet and I’m now trying to set it as default but it seems to fail.
I get the following response:

sigmoidbell@algorand:~/node$ ./goal wallet -f sigmoidbell-wallet -d data
ERRO[0000] [Stack] goroutine 1 [running]:
runtime/debug.Stack(0xc000128550, 0xc00000e090, 0xc000128eb0)
        /home/travis/.gimme/versions/go1.11.2.linux.amd64/src/runtime/debug/stack.go:24 +0xa7
github.com/algorand/go-algorand/logging.logger.Error(0xc000128550, 0xc00000e090, 0xc00002fcc0, 0x1, 0x1)
        /home/travis/gopath/src/github.com/algorand/go-algorand/logging/log.go:213 +0x4b
main.(*AccountsList).dumpList(0x1b15ac0)
        /home/travis/gopath/src/github.com/algorand/go-algorand/cmd/goal/accountsList.go:160 +0x1b5
main.(*AccountsList).setDefaultWalletID(0x1b15ac0, 0xc000029140, 0x20, 0x20)
        /home/travis/gopath/src/github.com/algorand/go-algorand/cmd/goal/accountsList.go:45 +0x83
main.glob..func41(0x1adc940, 0xc000069240, 0x0, 0x4)
        /home/travis/gopath/src/github.com/algorand/go-algorand/cmd/goal/wallet.go:53 +0x1b4
github.com/algorand/go-algorand/vendor/github.com/spf13/cobra.(*Command).execute(0x1adc940, 0xc000069200, 0x4, 0x4, 0x1adc940, 0xc000069200)
        /home/travis/gopath/src/github.com/algorand/go-algorand/vendor/github.com/spf13/cobra/command.go:766 +0x2cc
github.com/algorand/go-algorand/vendor/github.com/spf13/cobra.(*Command).ExecuteC(0x1ad86c0, 0x1b4c730, 0x100cff8, 0x7)
        /home/travis/gopath/src/github.com/algorand/go-algorand/vendor/github.com/spf13/cobra/command.go:852 +0x2fd
github.com/algorand/go-algorand/vendor/github.com/spf13/cobra.(*Command).Execute(0x1ad86c0, 0x45aeb0, 0xc000072058)
        /home/travis/gopath/src/github.com/algorand/go-algorand/vendor/github.com/spf13/cobra/command.go:800 +0x2b
main.main()
        /home/travis/gopath/src/github.com/algorand/go-algorand/cmd/goal/commands.go:81 +0x6b
  file=accountsList.go function="main.(*AccountsList).dumpList" line=160
ERRO[0000] open data/testnet-v26.1/accountList.json: permission denied  file=accountsList.go function="main.(*AccountsList).dumpList" line=160
open data/testnet-v26.1/accountList.json: permission deniedSet wallet 'sigmoidbell-wallet' to be the default wallet
#2

Are you running any of your commands as root, or using sudo? Can you cat data/testnet-v26.1/accountList.json?

Did you create the wallet after this afternoon’s update? You shouldn’t have to - I’m just curious.

#3

Hi andriko,

This looks like a permissions issue. I think if you run:

sudo chown -R sigmoidbell:sigmoidbell data

and then don’t use root for your subsequent commands, that should fix it. Please let me know if that works!

Max

#4

You guys were both right, some parts of the data folder were owned by root and this is because I set the update cronjob in the root’s crontab.

Problem resolved, thank you!
… and for the record:

sigmoidbell@algorand:~/node$ ls -la ./data
total 2756448
drwxrwxr-x 9 sigmoidbell sigmoidbell       4096 Feb 17 00:12 .
drwxrwxr-x 4 sigmoidbell sigmoidbell       4096 Feb 16 17:30 ..
-rw-r--r-- 1 root        root         655062090 Feb 17 00:20 agreement.cdv
-rw-rw-r-- 1 sigmoidbell sigmoidbell 1073742852 Feb 16 21:47 agreement.cdv.archive
-rw------- 1 sigmoidbell sigmoidbell          0 Feb 16 17:30 algod-err.log
-rw-r--r-- 1 root        root                15 Feb 16 17:30 algod.net
-rw------- 1 sigmoidbell sigmoidbell        294 Feb 16 17:30 algod-out.log
-rw-r--r-- 1 root        root                 5 Feb 16 17:30 algod.pid
-rw------- 1 sigmoidbell sigmoidbell         64 Feb  7 23:48 algod.token
drwxrwxr-x 2 sigmoidbell sigmoidbell       4096 Feb 14 23:28 backup
-rw-r--r-- 1 root        root                35 Feb 14 23:55 config.json
-rw-rw-r-- 1 sigmoidbell sigmoidbell       1017 Feb 16 17:30 config.json.example
-rw-rw-r-- 1 sigmoidbell sigmoidbell      44770 Feb 16 17:30 genesis.json
drwx------ 2 sigmoidbell sigmoidbell       4096 Feb 15 00:22 goal.cache
-rw-r--r-- 1 root        root              1114 Feb 14 20:24 homernet.json
drwx------ 3 sigmoidbell sigmoidbell       4096 Feb 14 23:26 kmd-v0.2
drwx------ 3 sigmoidbell sigmoidbell       4096 Feb 16 19:15 kmd-v0.5
lrwxrwxrwx 1 root        root                36 Feb 16 17:30 latest.log -> /home/sigmoidbell/node/data/node.log
-rw-r--r-- 1 root        root        1073741787 Feb 17 00:12 node.archive.log
-rw-r--r-- 1 root        root          19889196 Feb 17 00:20 node.log
-rw-r--r-- 1 sigmoidbell sigmoidbell      29785 Feb 16 17:30 swagger.json
drwxrwxr-x 2 sigmoidbell sigmoidbell       4096 Feb 14 23:10 testnet-v23.0
drwxrwxr-x 2 sigmoidbell sigmoidbell       4096 Feb 16 06:53 testnet-v26.0
drwxr-xr-x 2 root        root              4096 Feb 17 00:20 testnet-v26.1
-rw-rw-r-- 1 sigmoidbell sigmoidbell         14 Feb 16 17:30 wallet-genesis.id
sigmoidbell@algorand:~/node$ sudo chown -R sigmoidbell:sigmoidbell ./data
[sudo] password for sigmoidbell: 
sigmoidbell@algorand:~/node$ ./goal wallet -f sigmoidbell-wallet -d data
Set wallet 'sigmoidbell-wallet' to be the default wallet