Creation of authentication connection is failing - botframework

I am following the virtual assistant get started sample:
Virtual asistant
I am stuck on the step "Skill Authentication".
I tried to use the following command with all the arguments and generated botsecret for --secret argument.
msbot connect generic --name "Authentication" --keys "{\"YOUR_AUTH_CONNECTION_NAME\":\"Azure Active Directory v2\"}" --bot YOURBOTFILE.bot --secret "YOUR_BOT_SECRET" --url "portal.azure.net"
I still get the following error:
Error: You are attempting to perform an operation which needs access to the secret and --secret is missing
Can someone tell me what am I missing?

Related

AccessDenied when deploying serverless via aws-vault

I am trying to deploy serverless with the credentials stored in my aws-vault keychain.
However when I run aws-vault exec myprofile -- sls deploy I receive the following error:
An error occurred: MyLambdaFunction - AccessDenied. User doesn't have permission to call iam:GetRole.
The user has AdministratorAccess and I also gave him IAMFullAccess (which should not be needed)
When I deploy with the same credentials stored in ~.aws/credentials with sls deploy
it works.
According to the docs the session token generated by aws-vault has some restrictions:
You cannot call any IAM API operations unless MFA authentication information is included in the request.
You cannot call any AWS STS API except AssumeRole or GetCallerIdentity.
A work around is to use the --no-session
so aws-vault exec myprofile --no-session -- sls deploy works without any error.

ask init error: unable to get local issuer certificate

I am trying to initialize the ask cli using ask init on my git bash command line but it keeps throwing an error
I tried adding credentials to my env variables
i am using windows so the steps are
npm install -g --production windows-build-tools
npm install -g ask-cli
ask init
expect to ask for creds
got:
This command will initialize the ASK CLI with a profile associated with your Amazon developer credentials.
------------------------- Step 1 of 2 : ASK CLI Initialization -------------------------
Switch to "Login with Amazon" page and sign-in with your Amazon developer credentials.
If your browser did not open the page, run the initialization process again with command "ask init --no-browser".
[Error]: Cannot obtain access token. Error: unable to get local issuer certificate

How to start the Composer REST Server with the identity created through REST API?

I have configured my local REST server to use GitHub auth and Mongo DB. I have followed the deployment steps and can authenticate my GiHub ID putting the default Wallet into the Mongo DB. I then create a participant and issue an identity for that participant. I add the identity to the wallet and set that identity as the default. I was able to do a system/ping to return the current participant and also was able to call REST APIs.
Now I would like to start REST server with single user mode with identity which I created in the deployment steps as follow.
composer-rest-server -i nomura -s twidKDZiYFGw -m false -a false
I assume Blockchain identity specified on the command line at startup is created when issuing an identity for the participant.
But it shows the following error.
Discovering types from business network definition ...
Connection fails: Error: Error trying to ping. Error: Error trying to query chaincode. Error: chaincode error (status: 500, message: Error: The current identity has not been registered:nomura)
It will be retried for the next request.
Exception: Error: Error trying to ping. Error: Error trying to query chaincode. Error: chaincode error (status: 500, message: Error: The current identity has not been registered:nomura)
Error: Error trying to ping. Error: Error trying to query chaincode. Error: chaincode error (status: 500, message: Error: The current identity has not been registered:nomura)
What else do I have to do to create valid blockchain id for starting REST server?
your identity is fine. The problem appears to be how you're trying to start the REST server. You need to specify the connection profile (to connect to the business network).
Example syntax (where 'hlfv1' below is my HL Fabric v1 connection profile name) is:
composer-rest-server -p hlfv1 -n my-network -i nomura -s twidKDZiYFGw -m false -a false

[Error: EACCES: permission denied, open '/home/ubuntu/.hfc-key-store/

I am getting following error while running composer rest server. I am using aws ubuntu 16.04 server.
Hyperledger Composer
? Enter your Fabric Connection Profile Name: hlfv1
? Enter your Business Network Identifier : digitalproperty-network
? Enter your Fabric username : admin
? Enter your secret: Xurw3yU9zI0l
? Specify if you want namespaces in the generated REST API: never use namespaces
? Specify if you want the generated REST API to be secured: No
To restart the REST server using the same options, issue the following command:
composer-rest-server -p hlfv1 -n digitalproperty-network -i admin -s Xurw3yU9zI0l -N never
Discovering types from business network definition ...
Connection fails: Error: error trying login and get user Context.
Error: error trying to enroll user. Error: Failed to generate key for
enrollment due to error [Error: EACCES: permission denied, open
'/home/ubuntu/.hfc-key-store/be8405cef82cc00455de296664ccdcb35e4c707bb0e63a00d0bef76546528e13-priv']
It will be retried for the next request. Error: error trying login and
get user Context. Error: error trying to enroll user. Error: Failed to
generate key for enrollment due to error [Error: EACCES: permission
denied, open
'/home/ubuntu/.hfc-key-store/be8405cef82cc00455de296664ccdcb35e4c707bb0e63a00d0bef76546528e13-priv']
at client.getUserContext.then.then.catch (/home/ubuntu/.nvm/versions/node/v6.11.0/lib/node_modules/composer-rest-server/node_modules/composer-connector-hlfv1/lib/hlfconnection.js:293:34)
ubuntu#ip-172-31-19-220:~/composer-sample-networks/packages/digitalproperty-network$
when connecting to the running v1.0 Fabric dev environment using hlfv1 or running the REST server (as shown above) - you need to provide the default admin password of 'adminpw' - please try running composer-rest-server again and use the correct password. cheers Paul
On the similar set up, I could able to work with following command, basically use PeerAdmin user instead of admin. For example:
composer-rest-server -p hlfv1 -n my-network -i PeerAdmin -s PeerAdmin -N never
If you still face same issue, try with sudo

mongo as service error: Cannot determine state of server

I am trying to use mongodb as a service and started with heroku services ie dashboard.heroku.com/apps/scaleqamongo/resources. I tried multiple addons which they call like mongolab, mongohq. I create databases and then try to add that service address into my app as
db: 'mongodb://username:password#candidate.19.mongolayer.com:10292,candidate.18.mongolayer.com:10292/app25406086',
but it gives me error
Error: Cannot determine state of server
Error: No replica set primary available for query with ReadPreference PRIMARY
at ReplSet.checkoutReader (/prod/app/dashboard/node_modules/mongoose/node_modules/mongodb/lib/mongodb/connection/repl_set/repl_set.js:585:14)
at Cursor.nextObject (/prod/app/dashboard/node_modules/mongoose/node_modules/mongodb/lib/mongodb/cursor.js:723:48)
at Cursor.nextObject (/prod/app/dashboard/node_modules/mongoose/node_modules/mongodb/lib/mongodb/scope.js:22:20)
at Collection.findOne (/prod/app/dashboard/node_modules/mongoose/node_modules/mongodb/lib/mongodb/collection/query.js:157:10)
at /prod/app/dashboard/node_modules/connect-mongo/lib/connect-mongo.js:214:18
at MongoStore._get_collection (/prod/app/dashboard/node_modules/connect-mongo/lib/connect-mongo.js:148:21)
at MongoStore.get (/prod/app/dashboard/node_modules/connect-mongo/lib/connect-mongo.js:213:10)
at Object.session [as handle] (/prod/app/dashboard/node_modules/express/node_modules/connect/lib/middleware/session.js:311:11)
at next (/prod/app/dashboard/node_modules/express/node_modules/connect/lib/proto.js:193:15)
at Object.methodOverride [as handle] (/prod/app/dashboard/node_modules/express/node_modules/connect/lib/middleware/methodOverride.js:48:5)
While I am able to connect to the database using the shell command
mongo candidate.19.mongolayer.com:10292/app25406086 -u username -p password
What is the problem? Why am I not able to connect?
This is an intermittent error which got appeared for some time after I started the server but disappeared later on.

Resources