Closed WadeBarnes closed 1 year ago
@WadeBarnes — DCO needs to be fixed for this PR.
I’m still getting the same error. I figured it might be because the .gitattributes
change wouldn’t apply by just checkout out the new PR, so I cloned you fork of the repo from scratch and used it, and got the same error at the same place. Any ideas on what else I should try?
swcur@docket:~/test/von-network$ ./manage \
> indy-cli create-wallet \
> walletName=local_net_trustee_wallet
./scripts/manage: line 129: ./cli-scripts/create-wallet.run: Permission denied
It seems the issue might not be line endings at all, but rather some parsing issues in the ./scripts/manage
script.
To troubleshoot, modify this code: https://github.com/bcgov/von-network/blob/211d18174efbe8f047d011560de8db151eee8f8f/scripts/manage#L127-L130
To look like this:
escapedArgs=$(echo ${batchFileArgs} | sed "s~'~\\\'~g" | sed 's~\"~\\"~g' | sed 's~(~\\(~g' | sed 's~)~\\)~g')
cmd="${escapedArgs} envsubst < ${batchTemplate} > ${batchfile}"
echo
echo -e "cmd:\n\t${cmd}"
echo
eval ${cmd}
indyCliArgs="${batchfile}"
Then run:
./manage build
./manage \
indy-cli create-wallet \
walletName=local_net_trustee_wallet
The output of the command should look like this:
$ ./manage indy-cli create-wallet walletName=local_net_trustee_wallet
cmd:
walletName=local_net_trustee_wallet storageType=default storageConfig={} storageCredentials={} envsubst < ./cli-scripts/create-wallet > ./cli-scripts/create-wallet.run
load-plugin library=libindystrgpostgres.so initializer=postgresstorage_init
Plugin has been loaded: "libindystrgpostgres.so"
wallet create local_net_trustee_wallet key storage_type=default storage_config={} storage_credentials={}
...
I suspect the generated cmd
will not look the same on your machine. Provide the result and we can troubleshoot further from there.
Here is the result of the run with that code in place:
./manage \
> indy-cli create-wallet \
> walletName=local_net_trustee_wallet
cmd:
walletName=local_net_trustee_wallet storageType=default storageConfig={} storageCredentials={} envsubst < ./cli-scripts/create-wallet > ./cli-scripts/create-wallet.run
./scripts/manage: line 132: ./cli-scripts/create-wallet.run: Permission denied
Debugging further:
Added an ls -al
to the script and I see while most things are owned by Indy in the directory, cli-scripts is not:
drwxrwxr-x 2 1000 1000 4096 Feb 28 16:31 cli-scripts
Could that be it?
That appears to be the issue. The permissions are set correctly on the folder by the Dockerfile, however when your local folder is mounted it's using the permissions of your local folder. When the container is running in the context of the Indy user. Which does not have write permission to your local cli-scripts
folder. Docs here indicate your should run the following on your working copy:
mkdir tmp
chmod a+rws tmp cli-scripts
That will set tmp
and cli-scripts
to drwxrwxrwx
so indy can write to those folders.
OK — that fixed it. I’ll do some updates to the CLI document for that and a couple of other clarifications.
To summarize the problem I ran into: Whenever you create a von-network, the creation of the tmp and cli-scripts dance needs to be done immediately after the cloning. Is there a way to put that in to the build process?
Can this be fixed in the manage
scripts? I’m not sure of the relationship between the manage
script in the root and the one in the scripts
folder, so am not sure into which it would go. It seems like a bit of pain to have to tell everyone using von-network that if they think they might want to use CLI scripts, they have to install von-network using the following:
git clone https://github.com/bcgov/von-network`
mkdir -p tmp
chmod a+rws tmp cli-scripts
Ideas?
@swcurran, I've updated the scripts to create the ./tmp
folder if it does not exist, and check the permissions on the folders and set them if needed.
@lynnbendixsen, This PR also fixes the issue you were having with genesis_from_files.py
. It's now set to executable when downloaded.
./cli-scripts
folder../tmp
and./cli-scripts
genesis_from_files.py
is executable after download